private void button15_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) { s.Name = textBox2.Text; s.Email = textBox3.Text; s.Department = comboBox4.Text; s.Address = textBox4.Text; s.Contact_No = textBox5.Text; s.Gender = comboBox5.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.Password = textBox9.Text; DB.SubmitChanges(); MessageBox.Show("Information Updated!!"); } }
private void button16_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) { textBox9.Text = s.Password; textBox9.Text = s.Password; textBox2.Text = s.Name; textBox3.Text = s.Email; comboBox2.Text = s.Department; textBox4.Text = s.Address; textBox5.Text = s.Contact_No; comboBox5.Text = s.Gender; comboBox3.Text = s.Blood_Group; comboBox4.Text = s.Books_Type; textBox6.Text = s.Books_Name; textBox7.Text = s.Author_Editor; textBox8.Text = s.Book_Can_Hold; } else { MessageBox.Show("Data not found"); } }
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 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); }
private void button2_Click(object sender, EventArgs e) { DBDataContext DB = new DBDataContext(); string id = textBox4.Text; MR s = DB.MRs.SingleOrDefault(x => x.Username == id); if (s != null) { textBox6.Text = s.Books_Name; textBox7.Text = s.Author_Editor; } else { MessageBox.Show("Data not found"); } }
public StudentDashboard(String j) { InitializeComponent(); this.j = j; DBDataContext DB = new DBDataContext(); using (DB) { MR ci = DB.MRs.SingleOrDefault(p => p.Username == j); if (ci != null) { textBox1.Text = ci.Username; textBox2.Text = ci.Name; textBox3.Text = ci.Email; //textBox4.Text = ci.Designation; textBox5.Text = ci.Address; } } }
partial void DeleteMR(MR instance);
partial void UpdateMR(MR instance);
partial void InsertMR(MR instance);