private void button15_Click(object sender, EventArgs e) { DBDataContext DB = new DBDataContext(); string id = textBox1.Text; FR s = DB.FRs.SingleOrDefault(x => x.Username == id); if (s != null) { s.Name = textBox2.Text; s.Email = textBox3.Text; s.Address = textBox4.Text; s.Contact_Number = textBox5.Text; s.Gender = comboBox1.Text; s.Blood_Group = comboBox3.Text; s.Books_Type = comboBox4.Text; s.Books_Name = textBox6.Text; s.Author_Editor = textBox7.Text; s.Book_Can_Hold = textBox8.Text; s.Designation = textBox10.Text; DB.SubmitChanges(); MessageBox.Show("Information Updated!!"); } }
private void button15_Click(object sender, EventArgs e) { DBDataContext DB = new DBDataContext(); Login w = new Login(); w.Username = textBox1.Text; w.Password = textBox9.Text; w.Role = "Faculty"; FR m = new FR(); m.Username = textBox1.Text; m.Name = textBox2.Text; m.Email = textBox3.Text; m.Designation = textBox10.Text; m.Address = textBox4.Text; m.Contact_Number = textBox5.Text; m.Gender = comboBox1.Text; m.Blood_Group = comboBox3.Text; m.Books_Type = comboBox4.Text; m.Books_Name = textBox6.Text; m.Author_Editor = textBox7.Text; m.Book_Can_Hold = textBox8.Text; m.Password = textBox9.Text; DB.FRs.InsertOnSubmit(m); DB.Logins.InsertOnSubmit(w); DB.SubmitChanges(); MessageBox.Show("Faculty Added!!"); }
private void button15_Click(object sender, EventArgs e) { DBDataContext DB = new DBDataContext(); Login w = new Login(); w.Username = textBox1.Text; //new user k login database e pathysi w.Password = textBox9.Text; //new password k login database e pathysi w.Role = "Student"; //this is only for student MR m = new MR(); m.Username = textBox1.Text; m.Name = textBox2.Text; m.Email = textBox3.Text; m.Department = comboBox2.Text; m.Address = textBox4.Text; m.Contact_No = textBox5.Text; m.Gender = comboBox1.Text; m.Blood_Group = comboBox3.Text; m.Books_Type = comboBox4.Text; m.Books_Name = textBox6.Text; m.Author_Editor = textBox7.Text; m.Book_Can_Hold = textBox8.Text; m.Password = textBox9.Text; DB.MRs.InsertOnSubmit(m); DB.Logins.InsertOnSubmit(w); DB.SubmitChanges(); MessageBox.Show("Student Added!!"); }
private void button2_Click(object sender, EventArgs e) { DBDataContext DB = new DBDataContext(); AB w = new AB(); w.Book_Id = textBox2.Text; w.Book_Name = textBox1.Text; w.Quantity = textBox3.Text; DB.ABs.InsertOnSubmit(w); DB.SubmitChanges(); MessageBox.Show("Book Added!!"); }
private void button2_Click(object sender, EventArgs e) { DBDataContext DB = new DBDataContext(); string id = textBox2.Text; AB s = DB.ABs.SingleOrDefault(x => x.Book_Id == id); if (s != null) { s.Book_Id = textBox2.Text; s.Book_Name = textBox1.Text; s.Quantity = textBox3.Text; DB.SubmitChanges(); MessageBox.Show("Information Updated!!"); } }
private void button18_Click(object sender, EventArgs e) { DBDataContext DB = new DBDataContext(); string id = textBox1.Text; MR s = DB.MRs.SingleOrDefault(x => x.Username == id); if (s != null) { DB.MRs.DeleteOnSubmit(s); DB.SubmitChanges(); } else { MessageBox.Show("Data not found"); } MessageBox.Show("Successfully Deleted The Information", "Delete Student", MessageBoxButtons.OK, MessageBoxIcon.Stop); }