public ActionResult Add(About model) { try { if (string.IsNullOrEmpty(model.Contents)) { return(Json(new { IsSuccess = false, Message = "Vui lòng thêm nội dung" }, JsonRequestBehavior.AllowGet)); } model.Createddate = DateTime.Now; aboutRepository.Add(model); return(Json(new { IsSuccess = true, Message = "Thêm mới thành công" }, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(new { IsSuccess = false, Message = "Thêm mới thất bại" }, JsonRequestBehavior.AllowGet)); } }
public void Add(About about) { _aboutRepository.Add(about); }
public ResultMessage <About> Add(About data) { data.isActive = true; return(_aboutRepository.Add(data)); }