public JsonResult RemoveCateItem(string cateId, string ptpId, short isPk, short isRq) { var module = new PoliceTypeModule(CurrentUser); var data = module.Remove(cateId, ptpId, isPk, isRq); return(Json(new { code = 0, msg = "Ok", data = true })); }
public JsonResult Remove(string id) { var module = new PoliceTypeModule(CurrentUser); var data = module.Remove(t => t.Id == id); return(Json(new { code = 0, msg = "Ok", data = data })); }
public JObject GetData(string orgId) { var module = new PoliceTypeModule(CurrentUser); var items = module.FeatchAll(orgId); var json = TablePoliceTypeDataModel.Model.GetJson(items, TablePoliceTypeHeaderModel.Header); return(json); }
public JsonResult Tree(string orgId) { var module = new PoliceTypeModule(CurrentUser); var items = module.FeatchMany(orgId); var data = items.Select(t => new ComboTreeModel { children = new ComboTreeModel[0], id = t.Id, text = t.Name }); return(Json(data, JsonRequestBehavior.AllowGet)); }
public JsonResult AddCateItem(string ptpId, string cateId, short num, short isPk, short isRq) { var module = new PoliceTypeModule(CurrentUser); var item = new StandardEquipment { CateId = cateId, IsDel = (short)DeleteStatus.No, IsPrimary = isPk, IsRequire = isRq, Num = num, PtId = ptpId }; var data = module.Add(item); return(Json(new { code = 0, msg = "Ok", data = data }, "text/html")); }
public JsonResult FormSubmit(string id, string orgId, string name) { var module = new PoliceTypeModule(CurrentUser); var ptp = new PoliceType { Name = name, OrgId = orgId }; var data = false; if (string.IsNullOrWhiteSpace(id)) { data = module.Add(ptp); } else { ptp.Id = id; data = module.Modify(ptp, t => t.Id == id); } return(Json(new { code = 0, msg = "Ok", data = data }, "text/html")); }