private void btnadd_Click(object sender, EventArgs e) { if (Class1.stuId != -1) { SqlConnection newcon1 = new SqlConnection(con); newcon1.Open(); string qu = "UPDATE RubricLevel SET RubricId='" + Convert.ToInt32(comboBoxrubricid.Text) + "',Details='" + txtrubriclvldet.Text.ToString() + "', MeasurementLevel = '" + txtmeasulvl.Text.ToString() + "' WHERE Id='" + Class1.stuId + "'"; SqlCommand newcom = new SqlCommand(qu, newcon1); newcom.ExecuteNonQuery(); newcon1.Close(); Class1.stuId = -1; btnadd.Text = "Add"; } else { SqlConnection newcon = new SqlConnection(con); newcon.Open(); string qu = "insert into RubricLevel(RubricId,Details,MeasurementLevel) values('" + Convert.ToInt32(comboBoxrubricid.Text) + "','" + txtrubriclvldet.Text.ToString() + "','" + txtmeasulvl.Text.ToString() + "')"; SqlCommand newcom = new SqlCommand(qu, newcon); newcom.ExecuteNonQuery(); newcon.Close(); } this.Hide(); ManageRubricLevel newf = new ManageRubricLevel(); newf.Show(); }
private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.Hide(); ManageRubricLevel addnew = new ManageRubricLevel(); addnew.Show(); }