Exemplo n.º 1
0
 public bool InsertOrUpdate(bool opt, SafeDetail_Object safeDetailObject)
 {
     using (var db = new CarOnlineEntities())
     {
         var result = db.WEB_CARONLINE_SP_SafeDetail_InsertOrUpdate(opt, safeDetailObject.SafeDetailId,
                                                                    safeDetailObject.PostId, safeDetailObject.SafeCategoryId, safeDetailObject.Applyed,
                                                                    safeDetailObject.IsDeleted);
         return(result > 0);
     }
 }
        public ActionResult Edit(SafeDetail_Object safeDetailObject)
        {
            if (ModelState.IsValid)
            {
                var result = new SafeDetail_BCL().InsertOrUpdate(true, safeDetailObject);
                if (result)
                {
                    return(RedirectToAction("Index", "SafeDetail"));
                }
                ModelState.AddModelError("", "Cập nhật không thành công !");
            }

            return(View(safeDetailObject));
        }
Exemplo n.º 3
0
 public bool InsertOrUpdate(bool opt, SafeDetail_Object safeDetailObject)
 {
     return(new SafeDetail_DAO().InsertOrUpdate(opt, safeDetailObject));
 }