public void AddAppointment(Appointment app) { using (var context = new MedAllEntities2()) { context.Appointments.Add(app); context.SaveChanges(); } }
public void AddDoctor(Doctor doctor) { using (var context = new MedAllEntities2()) { context.Doctors.Add(doctor); context.SaveChanges(); } }
public void AddAdmin(Admin admin) { using (var context = new MedAllEntities2()) { context.Admins.Add(admin); context.SaveChanges(); } }
public void AddRole(Role role) { using (var context = new MedAllEntities2()) { context.Roles.Add(role); context.SaveChanges(); } }
public void AddUser(User user) { using (var context = new MedAllEntities2()) { context.Users.Add(user); context.SaveChanges(); } }
public void AddPatient(Patient patient) { using (var context = new MedAllEntities2()) { context.Patients.Add(patient); context.SaveChanges(); } }
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(); } }