private void EditInterface(HttpContext context) { int interid = Convert.ToInt32(context.Request["ItemId"]); string name = context.Request["Name"]; jsonModel = bll.IsNameExists(name, interid); if (jsonModel.errNum == 0) { if (jsonModel.retData.ToString().ToLower() == "true") { jsonModel = new JsonModel() { errNum = -1, errMsg = "exist", retData = "" }; } else { jsonModel = bll.GetEntityById(interid); if (jsonModel.errNum == 0) { Sys_Interface inter = jsonModel.retData as Sys_Interface; inter.Id = interid; inter.Name = name; inter.Description = context.Request["Description"]; inter.EditUID = context.Request["LoginUID"]; inter.EditTime = DateTime.Now; jsonModel = bll.Update(inter); } } } }
private void AddInterface(HttpContext context) { string name = context.Request["Name"]; jsonModel = bll.IsNameExists(name); if (jsonModel.errNum == 0) { if (jsonModel.retData.ToString().ToLower() == "true") { jsonModel = new JsonModel() { errNum = -1, errMsg = "exist", retData = "" }; } else { Sys_Interface inter = new Sys_Interface(); inter.Name = name; inter.Description= context.Request["Description"]; inter.CreateUID = context.Request["LoginUID"]; inter.CreateTime = DateTime.Now; jsonModel = bll.Add(inter); } } }