public static string DeleteFunType(string id) { if (string.IsNullOrWhiteSpace(id)) { return(ReturnString.JsonToString(Prompt.error, "请选中一个选中项", null)); } var bll = new EDRS.BLL.XT_QX_GNFL(request); try { //是否有下级 var funType = GetFunTypeDataTable(id); var fun = GetFunDataTable(id); if ((funType != null && funType.Rows.Count > 0) || (fun != null && fun.Rows.Count > 0)) { return(ReturnString.JsonToString(Prompt.error, "删除失败当前功能下项存在功能定义", null)); } //修改“是否删除”为“Y” var mode = bll.GetModel(id); mode.SFSC = "Y"; bll.Update(mode); } catch (Exception) { return(ReturnString.JsonToString(Prompt.error, "删除数据发生异常", null)); } return(ReturnString.JsonToString(Prompt.win, "删除成功", null)); }
public static string Edit(string data) { //TODO: 权限验证 //将表单实例化 var gnfl = JsonHelper.ParseFormJson <EDRS.Model.XT_QX_GNFL>(data); try { //更新数据库 var bll = new EDRS.BLL.XT_QX_GNFL(request); bll.Update(gnfl); return(ReturnString.JsonToString(Prompt.win, "修改成功!", null)); } catch (Exception) { return(ReturnString.JsonToString(Prompt.error, "修改失败!", null)); } }