public bool Update(Service service) { try { serviceDb.Update(service); return true; } catch (Exception) { return false; } }
public bool Insert(Service service) { try { serviceDb.Insert(service); return true; } catch (Exception) { return false; } }
public ActionResult AddService(Service service) { var result = db.ServiceDb.Insert(service); if (result) { return RedirectToAction("Adminka", new {message = "Услуга добавлена"}); } else { return RedirectToAction("Adminka", new {message = "Оишбка"}); } }
public void Update(Service service) { db.Entry(service).State = EntityState.Modified; this.Save(); }
public void Insert(Service service) { db.Service.Add(service); this.Save(); }
public ActionResult EditService(Service service) { var result = db.ServiceDb.Update(service); if (result) { return RedirectToAction("Adminka", new {message = "Сохранения изменены"}); } else { return RedirectToAction("Adminka", new {message = "Оишбка"}); } }