Exemple #1
0
        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"));
        }
Exemple #2
0
        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"));
        }