public void UpdateMail(TheMail mail) { using (var db = new TwinkleDbContext()) { db.Entry(mail).State = EntityState.Modified; db.SaveChanges(); } }
public void DeleteCustomer(int id) { using (var db = new TwinkleDbContext()) { var customer = db.Customers.Find(id); db.Customers.Remove(customer); db.SaveChanges(); } }
public void DeletePerformer(int id) { using (var db = new TwinkleDbContext()) { var performer = db.Performers.Find(id); db.Performers.Remove(performer); db.SaveChanges(); } }
public void DeleteDeal(int id) { using (var db = new TwinkleDbContext()) { var deal = db.Deals.Find(id); db.Deals.Remove(deal); db.SaveChanges(); } }
public void DeleteAppointment(int appointmentId) { using (var db = new TwinkleDbContext()) { var appt = db.Mails.Find(appointmentId); db.Mails.Remove(appt); db.SaveChanges(); } }
public void CancelAppointment(int appointmentId) { using (var db = new TwinkleDbContext()) { var appt = db.Deals.Find(appointmentId); appt.VehicleId = null; db.SaveChanges(); } }
public void AssignAppointment(int appointmentId, int resourceId) { using (var db = new TwinkleDbContext()) { var appt = db.Deals.Find(appointmentId); appt.VehicleId = resourceId; db.SaveChanges(); } }
public void RemoveMail(string id) { using (var db = new TwinkleDbContext()) { var mail = db.Mails.Find(id); db.Mails.Remove(mail); db.SaveChanges(); } }
public void InsertCustomer(Customer customer) { using (var db = new TwinkleDbContext()) { customer.CreatedBy = -1; customer.CreationDate = DateTime.Now; db.Customers.Add(customer); db.SaveChanges(); } }
public void InsertPerformer(Performer performer) { using (var db = new TwinkleDbContext()) { performer.CreatedBy = -1; performer.CreationDate = DateTime.Now; db.Performers.Add(performer); db.SaveChanges(); } }
public void InsertDeal(Deal deal) { using (var db = new TwinkleDbContext()) { deal.CreatedBy = -1; deal.CreationDate = DateTime.Now; db.Deals.Add(deal); db.SaveChanges(); } }
public void InsertMail(TheMail mail) { using (var db = new TwinkleDbContext()) { if (!db.Mails.Select(x => x.Id).Contains(mail.Id)) { db.Mails.Add(mail); db.SaveChanges(); } } }