private void button1_Click(object sender, EventArgs e) { BloodDataContext D = new BloodDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# projects\finalProject\Blood Donation\Blood.mdf;Integrated Security=True;Connect Timeout=30"); AdminInfo pr = new AdminInfo(); if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "") { pr.Password = textBox4.Text; pr.Name = textBox2.Text; pr.Phone = textBox1.Text; pr.Username = textBox3.Text; D.AdminInfos.InsertOnSubmit(pr); D.SubmitChanges(); MessageBox.Show("New Admin Added"); a.Show(); this.Hide(); } else { MessageBox.Show("Fill up all information"); } }
partial void UpdateAdminInfo(AdminInfo instance);
partial void DeleteAdminInfo(AdminInfo instance);
partial void InsertAdminInfo(AdminInfo instance);