private void button7_Click(object sender, EventArgs e) { Form24 frm11 = new Form24(); this.Hide(); frm11.Show(); }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Form24 frm5 = new Form24(); this.Hide(); frm5.Show(); }
private void btnAdd_Click(object sender, EventArgs e) { SqlConnection conmm = new SqlConnection(conn); conmm.Open(); string iddd = "Select id from RubricLevel where Details='" + cmbRubricLevelId.Text.ToString() + "'"; SqlCommand cmddd = new SqlCommand(iddd, conmm); var rdd = cmddd.ExecuteReader(); rdd.Read(); int idddno = rdd.GetInt32(0); SqlConnection conm = new SqlConnection(conn); conm.Open(); string idd = "Select id from AssessmentComponent where Name='" + cmbAssComponentId.Text.ToString() + "'"; SqlCommand cmdd = new SqlCommand(idd, conm); var rd = cmdd.ExecuteReader(); rd.Read(); int iddno = rd.GetInt32(0); SqlConnection con = new SqlConnection(conn); con.Open(); string id = "Select id from student where RegistrationNumber='" + cmbStudentId.Text.ToString() + "'"; SqlCommand cmd = new SqlCommand(id, con); var r = cmd.ExecuteReader(); r.Read(); int idno = r.GetInt32(0); string Query = "insert into StudentResult(StudentId,AssessmentComponentId ,RubricMeasurementId,EvaluationDate) values('" + idno + "','" + iddno + "','" + idddno + "','" + dtEvaluationDate.Value.Date + "')"; SqlConnection myconnection2 = new SqlConnection(conn); SqlCommand MyCommand2 = new SqlCommand(Query, myconnection2); SqlDataReader MyReader2; myconnection2.Open(); MyReader2 = MyCommand2.ExecuteReader(); MessageBox.Show("Data inserted Successfully!"); Form24 frm5 = new Form24(); this.Hide(); frm5.Show(); }