示例#1
0
 private void btn_login_Click(object sender, EventArgs e)
 {
     using (PatientDbContext db = new PatientDbContext())
     {
         Patient obj1 = db.Patients.Where(x => x.Email == txbx_email.Text).FirstOrDefault();
         Patient obj2 = db.Patients.Where(x => x.Password == txbx_pws.Text).FirstOrDefault();
     }
 }
示例#2
0
        private void btn_register_Click(object sender, EventArgs e)
        {
            using (PatientDbContext db = new PatientDbContext())
            {
                Patient patient = new Patient
                {
                    Name     = txbx_name.Text,
                    Email    = txbx_email.Text,
                    Password = txbx_password.Text
                };

                db.Patients.Add(patient);


                db.SaveChanges();

                MessageBox.Show("You have registered");
            }
        }