示例#1
0
 public void AddAppointment(Appointment app)
 {
     using (var context = new MedAllEntities2())
     {
         context.Appointments.Add(app);
         context.SaveChanges();
     }
 }
示例#2
0
 public void AddDoctor(Doctor doctor)
 {
     using (var context = new MedAllEntities2())
     {
         context.Doctors.Add(doctor);
         context.SaveChanges();
     }
 }
示例#3
0
 public void AddAdmin(Admin admin)
 {
     using (var context = new MedAllEntities2())
     {
         context.Admins.Add(admin);
         context.SaveChanges();
     }
 }
示例#4
0
 public void AddRole(Role role)
 {
     using (var context = new MedAllEntities2())
     {
         context.Roles.Add(role);
         context.SaveChanges();
     }
 }
示例#5
0
 public void AddUser(User user)
 {
     using (var context = new MedAllEntities2())
     {
         context.Users.Add(user);
         context.SaveChanges();
     }
 }
示例#6
0
 public void AddPatient(Patient patient)
 {
     using (var context = new MedAllEntities2())
     {
         context.Patients.Add(patient);
         context.SaveChanges();
     }
 }
示例#7
0
        public void UpdateUserPassword(string email, string password)
        {
            var user = new User {
                Email = email, Password = password
            };

            using (var context = new MedAllEntities2())
            {
                context.Users.Attach(user);
                context.Entry(user).Property(x => x.Password).IsModified = true;
                context.SaveChanges();
            }
        }