private void btnadd_Click(object sender, EventArgs e) { if (Class1.stuId != -1) { SqlConnection newcon1 = new SqlConnection(con); newcon1.Open(); string qu = "update Clo set Name='" + txtcloname.Text.ToString() + "',DateUpdated='" + DateTime.Now + "' where Id='" + Class1.stuId + "'"; SqlCommand newcom = new SqlCommand(qu, newcon1); newcom.ExecuteNonQuery(); newcon1.Close(); Class1.stuId = -1; } else { SqlConnection newcon = new SqlConnection(con); newcon.Open(); string qu = "insert into Clo(Name,DateCreated,DateUpdated) values('" + txtcloname.Text.ToString() + "','" + DateTime.Now + "','" + DateTime.Now + "') "; SqlCommand newcom = new SqlCommand(qu, newcon); newcom.ExecuteNonQuery(); newcon.Close(); } this.Hide(); ManageCLOs addnew = new ManageCLOs(); addnew.Show(); }
private void linkLabel2_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e) { this.Hide(); ManageCLOs addnew = new ManageCLOs(); addnew.Show(); }