public bool InsertOrUpdate(bool opt, SafeCategory_Object safeCategoryObject) { using (var db = new CarOnlineEntities()) { var result = db.WEB_CARONLINE_SP_SafeCategory_InsertOrUpdate(opt, safeCategoryObject.SafeCategoryId, safeCategoryObject.SafeCategoryName); return(result > 0); } }
public ActionResult Edit(SafeCategory_Object safeCategoryObject) { if (ModelState.IsValid) { var result = new SafeCategory_BCL().InsertOrUpdate(true, safeCategoryObject); if (result) { return(RedirectToAction("Index", "SafeCategory")); } ModelState.AddModelError("", "Cập nhật không thành công"); } return(View(safeCategoryObject)); }
public bool InsertOrUpdate(bool opt, SafeCategory_Object safeCategoryObject) { return(new SafeCategory_DAO().InsertOrUpdate(opt, safeCategoryObject)); }