private void btnPrevious_Click(object sender, EventArgs e) { CountRating(); if (i == ds.Tables[0].Rows.Count - 1 || i != 0) { i--; ShowData(); } else { MessageBox.Show("no record found"); } }
public void CountRating() { try { if (radioButton1.Checked == true) { RB = radioButton1.Text; radioButton1.Checked = false; } else if (radioButton2.Checked == true) { RB = radioButton2.Text; radioButton2.Checked = false; } else if (radioButton3.Checked == true) { RB = radioButton3.Text; radioButton3.Checked = false; } else if (radioButton4.Checked == true) { RB = radioButton4.Text; radioButton4.Checked = false; } if (RB == "Excellent") { rating = 5; } else if (RB == "Yes") { rating = 5; } else if (RB == "Good") { rating = 4; } else if (RB == "Average") { rating = 3; } else if (RB == "Fair" || RB == "No") { rating = 1; } else { MessageBox.Show("masla"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void ShowData() { key = Convert.ToInt32(ds.Tables[0].Rows[i]["qus_id"]); lblQ.Text = "Q. " + ds.Tables[0].Rows[i]["qus_id"].ToString(); lblQues.Text = ds.Tables[0].Rows[i]["questions"].ToString(); radioButton1.Text = ds.Tables[0].Rows[i]["Ans1"].ToString(); radioButton2.Text = ds.Tables[0].Rows[i]["Ans2"].ToString(); if (ds.Tables[0].Rows[i].IsNull("Ans3")) { radioButton3.Hide(); radioButton4.Hide(); } else { radioButton3.Show(); radioButton4.Show(); radioButton3.Text = ds.Tables[0].Rows[i]["Ans3"].ToString(); radioButton4.Text = ds.Tables[0].Rows[i]["Ans4"].ToString(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)