public ActionResult Edit(tbl_GalleryCategory obj) { try { _galleryCategoryReporitory.Edit(obj); return(Json(new { IsSuccess = true, Messenger = "Cập nhật danh mục thư viện ảnh thành công", }, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(new { IsSuccess = false, Messenger = string.Format("Cập nhật danh mục thư viện ảnh thất bại") }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Add(tbl_GalleryCategory obj) { try { obj.CreatedDate = DateTime.Now; _galleryCategoryReporitory.Add(obj); return(Json(new { IsSuccess = true, Messenger = "Thêm mới danh mục thư viện ảnh thành công", }, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(new { IsSuccess = false, Messenger = string.Format("Thêm mới danh mục thư viện ảnh thất bại") }, JsonRequestBehavior.AllowGet)); } }
public void Edit(tbl_GalleryCategory obj) { HelperCache.RemoveCache(KeyCache); _entities.Entry(obj).State = EntityState.Modified; _entities.SaveChanges(); }
public void Add(tbl_GalleryCategory obj) { HelperCache.RemoveCache(KeyCache); _entities.tbl_GalleryCategory.Add(obj); _entities.SaveChanges(); }