You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
670 lines
27 KiB
670 lines
27 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using FangYar.Model.TBL;
|
|
using System.Text;
|
|
using System.Web.Script.Serialization;
|
|
|
|
namespace FangYar.WebUI.ashx
|
|
{
|
|
/// <summary>
|
|
/// SysMenuHandler 的摘要说明
|
|
/// </summary>
|
|
public class SysMenuHandler : IHttpHandler
|
|
{
|
|
private FangYar.BLL.TBL.SysMenuBLL bll = new BLL.TBL.SysMenuBLL();
|
|
private FangYar.BLL.ToTree_BLL blltree = new BLL.ToTree_BLL();
|
|
public void ProcessRequest(HttpContext context)
|
|
{
|
|
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Other, "基础菜单操作请求", "");
|
|
|
|
context.Response.ContentType = "text/plain";
|
|
string action = context.Request.Params["Action"];
|
|
string returnstr = "";
|
|
switch (action)
|
|
{
|
|
case "List":
|
|
returnstr = GetModelList(context);
|
|
break;
|
|
case "Del":
|
|
returnstr = DelModel(context);
|
|
break;
|
|
case "Add":
|
|
returnstr = AddModel(context);
|
|
break;
|
|
case "Edit":
|
|
returnstr = EditModel(context);
|
|
break;
|
|
case "EditFlag":
|
|
returnstr = EditFlag(context);
|
|
break;
|
|
case "getMenuTree":
|
|
returnstr = getMenuTree(context);
|
|
break;
|
|
case "getMenuTitile":
|
|
returnstr = getMenuTitile(context);
|
|
break;
|
|
// 权限控制下的方法
|
|
case "List_Authoritytype":
|
|
returnstr = GetModelList_Authoritytype(context);
|
|
break;
|
|
case "getMenuTree_Authoritytype":
|
|
returnstr = getMenuTree_Authoritytype(context);
|
|
break;
|
|
case "Add_Authoritytype":
|
|
returnstr = AddModel_Authoritytype(context);
|
|
break;
|
|
case "Edit_Authoritytype":
|
|
returnstr = EditModel_Authoritytype(context);
|
|
break;
|
|
}
|
|
|
|
|
|
context.Response.Write(returnstr);
|
|
}
|
|
|
|
//查询
|
|
private string GetModelList(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string keywords = context.Request.Params["keywords"];
|
|
string limit = context.Request.Params["limit"];
|
|
string page = context.Request.Params["page"];
|
|
string menuid = context.Request.Params["menuid"]; //点击菜单ID
|
|
int pageIndex = 1;
|
|
int pageSize = 10;
|
|
if (!string.IsNullOrEmpty(limit)) { pageIndex = int.Parse(page); }
|
|
if (!string.IsNullOrEmpty(page)) { pageSize = int.Parse(limit); }
|
|
string where = " 1=1 ";
|
|
|
|
//搜索
|
|
if (!string.IsNullOrEmpty(keywords))
|
|
{
|
|
where += " and (APP_ID like'%" + keywords + "%' or MENU_TITLE like'%" + keywords + "%') ";
|
|
}
|
|
//菜单树点击
|
|
if (!string.IsNullOrEmpty(menuid))
|
|
{
|
|
where += " and( ID like'%" + menuid.Replace(",", "") + "%' or MENU_PARENT like'%" + menuid.Replace(",", "") + "%') ";
|
|
}
|
|
where += "order by menu_order ";
|
|
returnstr = "{\"code\":0,\"msg\":\"\",";
|
|
int count = bll.Count(where);
|
|
returnstr += "\"count\":" + count + ",\"data\":";
|
|
if (count == 0)
|
|
{
|
|
returnstr += "[]";
|
|
}
|
|
else
|
|
{
|
|
|
|
List<FangYar.Model.TBL.TBL_SYS_MENU_Model> list = bll.QueryList(pageIndex, pageSize, where, null);
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(list);
|
|
|
|
}
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "基础菜单操作请求", "查询异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "基础菜单操作请求", "查询");
|
|
return returnstr;
|
|
|
|
}
|
|
//删除
|
|
private string DelModel(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
int code = -1;
|
|
string msg = "";
|
|
try
|
|
{
|
|
string UIDList = context.Request.Params["UIDList"];
|
|
UIDList = UIDList.Replace(",", "','");
|
|
|
|
if (bll.Delete(UIDList))
|
|
{
|
|
bll.DeleteRoleMenu(UIDList);
|
|
msg = "删除成功!";
|
|
code = 1;
|
|
}
|
|
else
|
|
{
|
|
msg = "删除失败!";
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
msg = "删除失败!";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "基础菜单操作请求", "删除异常:" + e);
|
|
}
|
|
returnstr = "{\"code\":" + code + ",\"msg\":\"" + msg + "\"}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Delete, "基础菜单操作请求", "删除");
|
|
return returnstr;
|
|
}
|
|
//添加
|
|
private string AddModel(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
int code = -1;
|
|
string msg = "";
|
|
try
|
|
{
|
|
string appID = context.Request.Params["appID"];
|
|
string menuTitle = context.Request.Params["menuTitle"];
|
|
string menuIcon = context.Request.Params["menuIcon"];
|
|
string menuUrl = context.Request.Params["menuUrl"];
|
|
string menuParent = context.Request.Params["menuParent"];
|
|
string menuType = context.Request.Params["menuType"];//菜单类型
|
|
string menuFlag = context.Request.Params["menuFlag"];//菜单状态
|
|
string menuLevel = context.Request.Params["menuLevel"];
|
|
string menuOrder = context.Request.Params["menuOrder"];
|
|
string menuMap = context.Request.Params["needmap"];
|
|
string menuAction = context.Request.Params["menuAction"];
|
|
string authoritytype = context.Request.Params["authoritytype"];
|
|
string org_id = context.Request.Params["org_id"];
|
|
if (string.IsNullOrEmpty(appID))
|
|
{
|
|
msg = "所属应用不能为空";
|
|
}
|
|
else if (string.IsNullOrEmpty(menuTitle))
|
|
{
|
|
msg = "菜单名称不能为空";
|
|
}
|
|
else
|
|
{
|
|
FangYar.Model.TBL.TBL_SYS_MENU_Model model = new Model.TBL.TBL_SYS_MENU_Model();
|
|
model.ID = Guid.NewGuid().ToString("N");
|
|
model.APP_ID = appID;
|
|
model.MENU_TITLE = menuTitle;
|
|
model.MENU_ICON = menuIcon;
|
|
model.MENU_URL = menuUrl;
|
|
model.MENU_PARENT = menuParent;
|
|
model.MENU_TYPE = menuType;
|
|
model.MENU_FLAG = menuFlag;
|
|
model.MENU_LEVEL = menuLevel;
|
|
model.MENU_ORDER = int.Parse(menuOrder);
|
|
model.MENU_MAP = menuMap;
|
|
model.MENU_ACTION = menuAction;
|
|
model.AUTHORITYTYPE = authoritytype;
|
|
model.ORG_ID = org_id;
|
|
if (bll.Add(model))
|
|
{
|
|
msg = "添加成功!";
|
|
code = 1;
|
|
}
|
|
else { msg = "添加失败!"; }
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
msg = "添加失败!";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "基础菜单操作请求", "添加异常:" + ex);
|
|
}
|
|
returnstr = "{\"msg\":\"" + msg + "\",\"code\":" + code + "}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Add, "基础菜单操作请求", "添加");
|
|
return returnstr;
|
|
}
|
|
//修改
|
|
private string EditModel(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
int code = -1;
|
|
string msg = "";
|
|
try
|
|
{
|
|
string ID = context.Request.Params["ID"];
|
|
string appID = context.Request.Params["appID"];
|
|
|
|
string menuTitle = context.Request.Params["menuTitle"];
|
|
string menuIcon = context.Request.Params["menuIcon"];
|
|
string menuUrl = context.Request.Params["menuUrl"];
|
|
string menuParent = context.Request.Params["menuParent"];
|
|
string menuType = context.Request.Params["menuType"];
|
|
string menuFlag = context.Request.Params["menuFlag"];
|
|
string menuLevel = context.Request.Params["menuLevel"];
|
|
string menuOrder = context.Request.Params["menuOrder"];
|
|
string menuMap = context.Request.Params["needmap"];
|
|
string menuAction = context.Request.Params["menuAction"];
|
|
string authoritytype = context.Request.Params["authoritytype"];
|
|
string org_id = context.Request.Params["org_id"];
|
|
FangYar.Model.TBL.TBL_SYS_MENU_Model model = bll.GetModelByID(ID);
|
|
if (model == null)
|
|
{
|
|
msg = "应用记录不存在!";
|
|
}
|
|
else
|
|
{
|
|
model.MENU_TITLE = menuTitle;
|
|
model.MENU_ICON = menuIcon;
|
|
model.MENU_URL = menuUrl;
|
|
model.MENU_PARENT = menuParent;
|
|
model.MENU_TYPE = menuType;
|
|
model.MENU_FLAG = menuFlag;
|
|
model.MENU_LEVEL = menuLevel;
|
|
model.MENU_ORDER = int.Parse(menuOrder);
|
|
model.MENU_MAP = menuMap;
|
|
model.MENU_ACTION = menuAction;
|
|
model.APP_ID = appID;
|
|
model.AUTHORITYTYPE = authoritytype;
|
|
model.ORG_ID = org_id;
|
|
|
|
if (bll.Edit(model))
|
|
{
|
|
msg = "修改成功!";
|
|
code = 1;
|
|
}
|
|
else { msg = "修改失败"; }
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
msg = "修改失败!";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "基础菜单操作请求", "修改异常:" + e);
|
|
|
|
}
|
|
returnstr = "{\"code\":" + code + ",\"msg\":\"" + msg + "\"}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Update, "基础菜单操作请求", "修改");
|
|
return returnstr;
|
|
|
|
}
|
|
//菜单状态,禁用与启用
|
|
private string EditFlag(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
int code = -1;
|
|
string msg = "";
|
|
try
|
|
{
|
|
string id = context.Request.Params["ID"];
|
|
string menuFlag = context.Request.Params["menuFlag"];
|
|
FangYar.Model.TBL.TBL_SYS_MENU_Model model = bll.GetModelByID(id);
|
|
if (model == null)
|
|
{
|
|
msg = "该记录不存在";
|
|
}
|
|
else
|
|
{
|
|
if (menuFlag == "0")
|
|
{
|
|
model.MENU_FLAG = "1";
|
|
}
|
|
else if (menuFlag == "1")
|
|
{
|
|
model.MENU_FLAG = "0";
|
|
}
|
|
if (bll.Edit(model))
|
|
{
|
|
msg = "修改成功!";
|
|
code = 1;
|
|
}
|
|
else
|
|
{
|
|
msg = "修改失败!";
|
|
}
|
|
}
|
|
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
msg = "修改失败!";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "基础菜单操作请求", "菜单状态,禁用与启用异常:" + e);
|
|
}
|
|
returnstr = "{\"code\":" + code + ",\"msg\":\"" + msg + "\"}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Update, "基础菜单操作请求", "菜单状态,禁用与启用");
|
|
return returnstr;
|
|
|
|
}
|
|
//菜单树
|
|
private string getMenuTree(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string treeid = context.Request.Params["treeid"];
|
|
|
|
|
|
string where = null;
|
|
if (!string.IsNullOrEmpty(treeid))
|
|
{
|
|
where = " ID = " + treeid;
|
|
}
|
|
List<FangYar.Model.TreeNodeModel> list = new List<Model.TreeNodeModel>();
|
|
list = blltree.GetTree("ID", "MENU_PARENT", " CONCAT(MENU_TITLE, IFNULL(CONCAT('(',MENU_ACTION,')'),'') ) ", "TBL_SYS_MENU", where, list);
|
|
returnstr = "{\"data\":";
|
|
if (list.Count == 0)
|
|
{
|
|
returnstr += "[]";
|
|
}
|
|
else
|
|
{
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(list);
|
|
}
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "基础菜单操作请求", "菜单树异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "基础菜单操作请求", "菜单树");
|
|
return returnstr;
|
|
}
|
|
//查询一条记录
|
|
private string getMenuTitile(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string ID = context.Request.Params["ID"];
|
|
int count = bll.Count("ID ='" + ID + "'");
|
|
if (count > 0)
|
|
{
|
|
returnstr = "{\"code\":1,\"data\":";
|
|
FangYar.Model.TBL.TBL_SYS_MENU_Model model = bll.GetModelByID(ID);
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(model);
|
|
returnstr += "}";
|
|
}
|
|
else
|
|
{
|
|
returnstr = "{\"code\":0,\"data\":[]}";
|
|
}
|
|
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "基础菜单操作请求", "查询一条记录异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "基础菜单操作请求", "查询一条记录");
|
|
return returnstr;
|
|
|
|
|
|
}
|
|
|
|
//-----------------------权限下的方法------------------------
|
|
//查询
|
|
private string GetModelList_Authoritytype(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string keywords = context.Request.Params["keywords"];
|
|
string limit = context.Request.Params["limit"];
|
|
string page = context.Request.Params["page"];
|
|
string menuid = context.Request.Params["menuid"]; //点击菜单ID
|
|
string authoritytype = context.Request.Params["authoritytype"];
|
|
string org_id = context.Request.Params["org_id"];
|
|
int pageIndex = 1;
|
|
int pageSize = 10;
|
|
if (!string.IsNullOrEmpty(limit)) { pageIndex = int.Parse(page); }
|
|
if (!string.IsNullOrEmpty(page)) { pageSize = int.Parse(limit); }
|
|
string where = " 1=1 ";
|
|
|
|
//搜索
|
|
if (!string.IsNullOrEmpty(keywords))
|
|
{
|
|
where += " and (APP_ID like'%" + keywords + "%' or MENU_TITLE like'%" + keywords + "%') ";
|
|
}
|
|
//菜单树点击
|
|
if (!string.IsNullOrEmpty(menuid))
|
|
{
|
|
where += " and( ID like'%" + menuid.Replace(",", "") + "%' or MENU_PARENT like'%" + menuid.Replace(",", "") + "%') ";
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(authoritytype))
|
|
{
|
|
where += " and AUTHORITYTYPE ='" + authoritytype + "'";
|
|
}
|
|
if (!string.IsNullOrEmpty(org_id))
|
|
{
|
|
where += " and ORG_ID='" + org_id + "' ";
|
|
}
|
|
|
|
|
|
where += "order by menu_order ";
|
|
returnstr = "{\"code\":0,\"msg\":\"\",";
|
|
int count = bll.Count(where);
|
|
returnstr += "\"count\":" + count + ",\"data\":";
|
|
if (count == 0)
|
|
{
|
|
returnstr += "[]";
|
|
}
|
|
else
|
|
{
|
|
|
|
List<FangYar.Model.TBL.TBL_SYS_MENU_Model> list = bll.QueryList(pageIndex, pageSize, where, null);
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(list);
|
|
|
|
}
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "基础菜单操作请求", "查询异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "基础菜单操作请求", "查询");
|
|
return returnstr;
|
|
|
|
}
|
|
//菜单树
|
|
private string getMenuTree_Authoritytype(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string treeid = context.Request.Params["treeid"];
|
|
string authoritytype = context.Request.Params["authoritytype"];
|
|
string org_id = context.Request.Params["org_id"];
|
|
|
|
string where = " (( 1=1 ";
|
|
if (!string.IsNullOrEmpty(treeid))
|
|
{
|
|
where += " and ID = " + treeid;
|
|
}
|
|
if (!string.IsNullOrEmpty(authoritytype))
|
|
{
|
|
where += " and AUTHORITYTYPE ='" + authoritytype + "'";
|
|
}
|
|
if (!string.IsNullOrEmpty(org_id))
|
|
{
|
|
where += " and ORG_ID='" + org_id + "' ";
|
|
}
|
|
where += " ) ";
|
|
where += " or AUTHORITYTYPE='0') ";
|
|
|
|
//string where = null;
|
|
//if (!string.IsNullOrEmpty(treeid))
|
|
//{
|
|
// where += " ID = " + treeid;
|
|
//}
|
|
|
|
List<FangYar.Model.TreeNodeModel> list = new List<Model.TreeNodeModel>();
|
|
list = blltree.GetTree("ID", "MENU_PARENT", " CONCAT(MENU_TITLE, IFNULL(CONCAT('(',MENU_ACTION,')'),'') ) ", "TBL_SYS_MENU", where, list);
|
|
returnstr = "{\"data\":";
|
|
if (list.Count == 0)
|
|
{
|
|
returnstr += "[]";
|
|
}
|
|
else
|
|
{
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(list);
|
|
}
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "基础菜单操作请求", "菜单树异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "基础菜单操作请求", "菜单树");
|
|
return returnstr;
|
|
}
|
|
//添加
|
|
private string AddModel_Authoritytype(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
int code = -1;
|
|
string msg = "";
|
|
try
|
|
{
|
|
string appID = context.Request.Params["appID"];
|
|
string menuTitle = context.Request.Params["menuTitle"];
|
|
string menuIcon = context.Request.Params["menuIcon"];
|
|
string menuUrl = context.Request.Params["menuUrl"];
|
|
string menuParent = context.Request.Params["menuParent"];
|
|
string menuType = context.Request.Params["menuType"];//菜单类型
|
|
string menuFlag = context.Request.Params["menuFlag"];//菜单状态
|
|
string menuLevel = context.Request.Params["menuLevel"];
|
|
string menuOrder = context.Request.Params["menuOrder"];
|
|
string menuMap = context.Request.Params["needmap"];
|
|
string menuAction = context.Request.Params["menuAction"];
|
|
string authoritytype = context.Request.Params["authoritytype"];
|
|
string org_id = context.Request.Params["org_id"];
|
|
if (string.IsNullOrEmpty(appID))
|
|
{
|
|
msg = "所属应用不能为空";
|
|
}
|
|
else if (string.IsNullOrEmpty(menuTitle))
|
|
{
|
|
msg = "菜单名称不能为空";
|
|
}
|
|
else
|
|
{
|
|
FangYar.Model.TBL.TBL_SYS_MENU_Model model = new Model.TBL.TBL_SYS_MENU_Model();
|
|
model.ID = Guid.NewGuid().ToString("N");
|
|
model.APP_ID = appID;
|
|
model.MENU_TITLE = menuTitle;
|
|
model.MENU_ICON = menuIcon;
|
|
model.MENU_URL = menuUrl;
|
|
model.MENU_PARENT = menuParent;
|
|
model.MENU_TYPE = menuType;
|
|
model.MENU_FLAG = menuFlag;
|
|
model.MENU_LEVEL = menuLevel;
|
|
model.MENU_ORDER = int.Parse(menuOrder);
|
|
model.MENU_MAP = menuMap;
|
|
model.MENU_ACTION = menuAction;
|
|
model.AUTHORITYTYPE = authoritytype;
|
|
model.ORG_ID = org_id;
|
|
if (bll.Add(model))
|
|
{
|
|
msg = "添加成功!";
|
|
code = 1;
|
|
}
|
|
else { msg = "添加失败!"; }
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
msg = "添加失败!";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "基础菜单操作请求", "添加异常:" + e);
|
|
}
|
|
returnstr = "{\"msg\":\"" + msg + "\",\"code\":" + code + "}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Add, "基础菜单操作请求", "添加");
|
|
return returnstr;
|
|
}
|
|
//修改
|
|
private string EditModel_Authoritytype(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
int code = -1;
|
|
string msg = "";
|
|
try
|
|
{
|
|
string ID = context.Request.Params["ID"];
|
|
string appID = context.Request.Params["appID"];
|
|
|
|
string menuTitle = context.Request.Params["menuTitle"];
|
|
string menuIcon = context.Request.Params["menuIcon"];
|
|
string menuUrl = context.Request.Params["menuUrl"];
|
|
string menuParent = context.Request.Params["menuParent"];
|
|
string menuType = context.Request.Params["menuType"];
|
|
string menuFlag = context.Request.Params["menuFlag"];
|
|
string menuLevel = context.Request.Params["menuLevel"];
|
|
string menuOrder = context.Request.Params["menuOrder"];
|
|
string menuMap = context.Request.Params["needmap"];
|
|
string menuAction = context.Request.Params["menuAction"];
|
|
string authoritytype = context.Request.Params["authoritytype"];
|
|
string org_id = context.Request.Params["org_id"];
|
|
FangYar.Model.TBL.TBL_SYS_MENU_Model model = bll.GetModelByID(ID);
|
|
if (model == null)
|
|
{
|
|
msg = "应用记录不存在!";
|
|
}
|
|
else
|
|
{
|
|
model.MENU_TITLE = menuTitle;
|
|
model.MENU_ICON = menuIcon;
|
|
model.MENU_URL = menuUrl;
|
|
model.MENU_PARENT = menuParent;
|
|
model.MENU_TYPE = menuType;
|
|
model.MENU_FLAG = menuFlag;
|
|
model.MENU_LEVEL = menuLevel;
|
|
model.MENU_ORDER = int.Parse(menuOrder);
|
|
model.MENU_MAP = menuMap;
|
|
model.MENU_ACTION = menuAction;
|
|
model.APP_ID = appID;
|
|
model.AUTHORITYTYPE = authoritytype;
|
|
model.ORG_ID = org_id;
|
|
|
|
if (bll.Edit(model))
|
|
{
|
|
msg = "修改成功!";
|
|
code = 1;
|
|
}
|
|
else { msg = "修改失败"; }
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
msg = "修改失败!";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "基础菜单操作请求", "修改异常:" + e);
|
|
|
|
}
|
|
returnstr = "{\"code\":" + code + ",\"msg\":\"" + msg + "\"}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Update, "基础菜单操作请求", "修改");
|
|
return returnstr;
|
|
|
|
}
|
|
public bool IsReusable
|
|
{
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|