예제 #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();
            }
        }