public JsonResult ListAllPaging(int?page = 1, int?rows = 10) { int pageIndex = page.HasValue ? (int)page : 1; int pageSize = rows.HasValue ? (int)rows : 10; int total = 0; var result = new NotifyTypeDao().ListAllPaging(out total, pageIndex, pageSize); if (result == null) { return(NotifyError("Liệt kê")); } return(Json(new { total = total, rows = result })); }
public JsonResult Destroy(int id) { bool ok = new NotifyTypeDao().Delete(id); if (ok) { return(Json(new { success = true })); } else { return(NotifyError("xóa")); } }
public JsonResult Create(TM_NotifyType entity) { byte SymptomId = new NotifyTypeDao().Create(entity); entity.Id = SymptomId; if (SymptomId > 0) { return(Json(entity)); } else { return(NotifyError("Tạo")); } }
public JsonResult Update(TM_NotifyType entity) { bool ok = new NotifyTypeDao().Update(entity); if (ok) { return(Json(new { isNewRecord = false, Id = entity.Id, Name = entity.Name, Status = entity.Status })); } else { return(NotifyError("Cập nhật"));; } }
/// <summary> /// Lấy danh sách trieu chung nạp vào combobox /// </summary> /// <returns></returns> public JsonResult ListAll() { var entity = new NotifyTypeDao().ListAll(); return(Json(entity, JsonRequestBehavior.AllowGet)); }