public void Insert(Appointment app) { var context = new VetDbContext(); context.Appointments.Add(app); context.SaveChanges(); }
public void Delete(int id) { var context = new VetDbContext(); context.Appointments.Remove(context.Appointments.Find(id)); context.SaveChanges(); }
public void Insert(Client cli) { var context = new VetDbContext(); context.Clients.Add(cli); context.SaveChanges(); }
public void Insert(Doctor doc) { var db = new VetDbContext(); db.Doctors.Add(doc); db.SaveChanges(); }
public void Insert(Patient patient) { var context = new VetDbContext(); context.Patients.Add(patient); context.SaveChanges(); }
public void Insert(Room room) { var db = new VetDbContext(); db.Rooms.Add(room); db.SaveChanges(); }
public void Delete(int id) { var db = new VetDbContext(); var doc = db.Doctors.Find(id); db.Doctors.Remove(doc); db.SaveChanges(); }
public void Delete(int id) { var context = new VetDbContext(); var patient = context.Patients.Find(id); context.Patients.Remove(patient); context.SaveChanges(); }
public void Delete(int id) { var db = new VetDbContext(); Room room = db.Rooms.Find(id); db.Rooms.Remove(room); db.SaveChanges(); }
public void Update(Room entity) { var context = new VetDbContext(); Room editRoom = context.Rooms.Find(entity.Id); if (entity != null) { editRoom.Location = entity.Location; editRoom.Name = entity.Name; } context.SaveChanges(); }
public void Update(Client updated) { var context = new VetDbContext(); var client = context.Clients.Find(updated.Id); if (client != null) { client.FullName = updated.FullName; client.Email = updated.Email; client.PhoneNumber = updated.PhoneNumber; } context.SaveChanges(); }
public void Update(Doctor update) { var db = new VetDbContext(); Doctor doc = db.Doctors.Find(update.Id); if (doc != null) { doc.Name = update.Name; doc.LastName = update.LastName; doc.Email = update.Email; doc.Address = update.Address; doc.PhoneNumber = update.PhoneNumber; } db.SaveChanges(); }
public void Update(Patient updated) { var context = new VetDbContext(); var patient = context.Patients.Find(updated.Id); if (!(patient is null)) { patient.Name = updated.Name; patient.Gender = updated.Gender; patient.Owner = updated.Owner; patient.ClientId = updated.ClientId; patient.ImgPath = updated.ImgPath; } context.SaveChanges(); }
public void Update(Appointment updated) { var context = new VetDbContext(); var app = context.Appointments.Find(updated.Id); if (app != null) { app.PatientId = updated.PatientId; app.RoomId = updated.RoomId; app.DoctorId = updated.DoctorId; app.StartDate = updated.StartDate; app.EndDate = updated.EndDate; app.Description = updated.Description; } context.SaveChanges(); }