private void Button2_Click(object sender, EventArgs e) { DBConnections c = new DBConnections(); c.Inserts("insert into student ([FirstName],[LastName],[Gender],[DateofBirth],[HomeAddress],[EmailAddress],[PhoneNumber],[EmergencyContactNumber],[BloodGroup],[Religion],[Nationality],[PrimaryLanguage],[BirthPlace]) " + "Values('" + fname.Text + "', '" + lname.Text + "', '" + gender.Text + "', '" + Convert.ToDateTime(dob.Text) + "' ,'" + address.Text + "' , '" + email.Text + "','" + textBox1.Text + "','" + em.Text + "','" + blood.Text + "','" + religion.Text + "','" + nationality.Text + "','" + plang.Text + "','" + birthpl.Text + "')"); Guardian gg = new Guardian(); this.Hide(); gg.ShowDialog(); }
private void Button2_Click(object sender, EventArgs e) { DBConnections c = new DBConnections(); for (int i = 0; i < checkedListBox1.Items.Count; i++) { if (checkedListBox1.GetItemChecked(i) && checkedListBox2.GetItemChecked(i)) { c.Inserts("insert into TeacherAttendance ([Date], Faculty_idFaculty, Attended, late) Values('" + Convert.ToDateTime(dateTimePicker1.Text) + "' , (select idfaculty from Faculty where FirstName = '" + checkedListBox1.Items[i].ToString() + "'),1,1)"); } else if (checkedListBox1.GetItemChecked(i) == false && checkedListBox2.GetItemChecked(i) == false) { c.Inserts("insert into TeacherAttendance ([Date], Faculty_idFaculty, Attended, late) Values('" + Convert.ToDateTime(dateTimePicker1.Text) + "' , (select idfaculty from Faculty where FirstName = '" + checkedListBox1.Items[i].ToString() + "'),0,0)"); } else if (checkedListBox1.GetItemChecked(i) == true && checkedListBox2.GetItemChecked(i) == false) { c.Inserts("insert into TeacherAttendance ([Date], Faculty_idFaculty, Attended, late) Values('" + Convert.ToDateTime(dateTimePicker1.Text) + "' , (select idfaculty from Faculty where FirstName = '" + checkedListBox1.Items[i].ToString() + "'),1,0)"); } } this.Close(); }
private void Button1_Click_1(object sender, EventArgs e) { DBConnections c = new DBConnections(); c.Inserts("insert into guardian (Student_idStudent, gname, gaddress, phonenumber, relationshipwithstudent, Cnic, office, education) " + "Values((select max(idStudent) from student), '" + gname.Text + "', '" + address.Text + "', '" + phone.Text + "' ,'" + textBox1.Text + "' , '" + cnic.Text + "','" + office.Text + "','" + education.Text + "')"); Sibling_and_Emergency_Information gg = new Sibling_and_Emergency_Information(); this.Hide(); gg.ShowDialog(); }