private void btn_level_Click(object sender, EventArgs e) { assessment_details r = new assessment_details(); r.Show(); this.Hide(); }
private void btn_assessment_Click(object sender, EventArgs e) { assessment_details d = new assessment_details(); d.Show(); this.Hide(); }
private void btn_submit_Click(object sender, EventArgs e) { if (txt_title.Text != "" && txt_marks.Text != "" && txt_weightage.Text != "") { SqlConnection conn = new SqlConnection("Data Source=DESKTOP-M9PBVHQ;Initial Catalog=ProjectB;Integrated Security=True"); if (update == 1) { conn.Open(); string query2 = "Update Assessment set Title = '" + txt_title.Text + " ', DateCreated = '" + this.date + "' , TotalMarks = '" + txt_marks.Text + "' ,TotalWeightage = '" + txt_weightage.Text + "' where Id = '" + this.id + "'"; SqlCommand update_command = new SqlCommand(query2, conn); int j = update_command.ExecuteNonQuery(); if (j != 0) { MessageBox.Show("Assessment Record Updated Successfully"); assessment ff = new assessment(); ff.Close(); assessment_details ss = new assessment_details(); ss.Show(); this.Hide(); } conn.Close(); } else { conn.Open(); string query = "Insert into Assessment (Title, DateCreated, TotalMarks, TotalWeightage) values('" + txt_title.Text + "', '" + DateTime.Today + "', '" + txt_marks.Text + "' , '" + txt_weightage.Text + "')"; SqlCommand command = new SqlCommand(query, conn); int i = command.ExecuteNonQuery(); if (i != 0) { MessageBox.Show("Assessment Record Inserted Successfully"); assessment f = new assessment(); f.Close(); assessment_details s = new assessment_details(); this.Hide(); s.Show(); } conn.Close(); } } else { error_msg.Show(); } }