SVN r499
SVN-Revision: r499
This commit is contained in:
@@ -1201,8 +1201,26 @@ namespace Lskj.Business.Impl
|
||||
{
|
||||
try
|
||||
{
|
||||
string sqlValue = "select * from p_systemDlltabDetail where tab=@tab and (charindex('," + ERPInfo.Instance.UserName + ",',','+privilegeOper+',')>0 or isnull(privilegeOper,'')='') and ISNULL(isVisible,0)=0 order by orderid";
|
||||
return SqlHelper.ExecuteDataTable(sqlValue, new SqlParameter[] { new SqlParameter("@tab", menuCode) });
|
||||
string sqlTemplate = @"WITH UserRoles AS (
|
||||
SELECT r.roleName
|
||||
FROM p_systemRoleOperSetTab AS ro
|
||||
JOIN p_systemRoleSetTab AS r ON r.id = ro.roleId
|
||||
WHERE ro.operatorname = '{0}'
|
||||
)
|
||||
SELECT pm.*
|
||||
FROM p_systemDlltabDetail AS pm WITH (NOLOCK)
|
||||
WHERE ISNULL(pm.isvisible, 0) = 0
|
||||
AND pm.tab = '{1}'
|
||||
AND (
|
||||
ISNULL(pm.privilegeOper, '') = ''
|
||||
OR CHARINDEX(',' + '{0}' + ',', ',' + pm.privilegeOper + ',') > 0
|
||||
OR EXISTS (
|
||||
SELECT 1
|
||||
FROM UserRoles AS ur
|
||||
WHERE CHARINDEX('{{&' + ur.roleName + '&}}', pm.privilegeOper) > 0)
|
||||
) ORDER BY pm.orderid;";
|
||||
string sqlValue = string.Format(sqlTemplate, ERPInfo.Instance.UserName, menuCode);
|
||||
return SqlHelper.ExecuteDataTable(sqlValue);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -1260,29 +1278,4 @@ namespace Lskj.Business.Impl
|
||||
/// <param name="comfirmAdvice">确认意见.</param>
|
||||
/// <returns>System.Int32.</returns>
|
||||
public static bool isParamComplete(string storedName, string[] Param)
|
||||
{
|
||||
string whereConfig = string.Empty;
|
||||
for (int i = 0; i < Param.Length; i++)
|
||||
{
|
||||
whereConfig += string.Format(" LOWER(PARAMETER_NAME)=LOWER('{0}') or", Param[i]);
|
||||
}
|
||||
string sql = string.Format("SELECT PARAMETER_NAME AS [参数名称] FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='{1}' and ({0})", whereConfig.Substring(0, whereConfig.Length - 2), storedName);
|
||||
return SqlHelper.ExecuteDataTable(sql).Rows.Count == Param.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建只读列
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public static DataTable getDetail_Details(string key)
|
||||
{
|
||||
string sql = string.Format("select * from p_systembillsourcedetail where sourceid=0 and sourcekey='{0}' and mxflag=1 and isnull(isVisible,0)=0 order by orderid", key);
|
||||
return GetDataTableResult(sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Lskj.Business.Impl
|
||||
int result = ExecSqlValue(detailSql, true);
|
||||
if (result > 0)
|
||||
{
|
||||
SqlParameter pMsg = ERPInfo.Instance.ChangeParameterType ? new SqlParameter("@msg", SqlDbType.NVarChar, 4000) :new SqlParameter("@msg", SqlDbType.VarChar, 2000);
|
||||
SqlParameter pMsg = ERPInfo.Instance.ChangeParameterType ? new SqlParameter("@msg", SqlDbType.NVarChar, 4000) : new SqlParameter("@msg", SqlDbType.VarChar, 2000);
|
||||
pMsg.Direction = ParameterDirection.Output;
|
||||
SqlParameter returnValue = new SqlParameter("@return", SqlDbType.Int, 4);
|
||||
returnValue.Direction = ParameterDirection.ReturnValue;
|
||||
@@ -590,15 +590,30 @@ namespace Lskj.Business.Impl
|
||||
conditions = "and isnull(mxflag,0)=0";
|
||||
}
|
||||
string cond = !string.IsNullOrEmpty(sourceCond) ? string.Format(" and id in ({0})", sourceCond.Trim(',')) : string.Empty;
|
||||
string sqlValue = string.Format("select * from p_systembillsource where typeCode=@typeCode" + cond + " and isnull(isVisible,0)=0 and (isnull(viewOper,'')='' or CHARINDEX(',' + '{0}' + ',', ',' + viewOper + ',')>0) order by orderid", ERPInfo.Instance.UserName);
|
||||
string sqlDetail = string.Format(@"SELECT id,sourceId,fieldName,sysName,userName,orderid,isVisible,sourceKey,privilegeView,DataFormat,isSum,ifmerge,{2}
|
||||
isnull(CASE WHEN isVisible=1 OR (ISNULL(b.userList,'')='' AND ISNULL(a.PrivilegeView,'')<>'') THEN 0 ELSE width END,0) width
|
||||
FROM p_systembillsourcedetail a
|
||||
LEFT JOIN (
|
||||
SELECT userList,privTypeId from p_systemPrivilege b where modId = '{0}'
|
||||
AND CHARINDEX(',' + '{1}' + ',', ',' + userList + ',') > 0
|
||||
) b on CHARINDEX(',' + CAST(b.privTypeId AS VARCHAR(5)) + ',',',' + PrivilegeView + ',') > 0
|
||||
where sourceId in (select id from p_systembillsource where typeCode=@typeCode" + cond + " and isnull(isVisible,0)=0 and (isnull(viewOper,'')='' or CHARINDEX(',' + '{1}' + ',', ',' + viewOper + ',')>0)) {3} order by sourceId,orderid", menuCode, ERPInfo.Instance.UserName, otherfield, conditions);
|
||||
string sqlValue = string.Format(@"WITH UserRoles AS (
|
||||
SELECT r.roleName
|
||||
FROM p_systemRoleOperSetTab AS ro
|
||||
JOIN p_systemRoleSetTab AS r ON r.id = ro.roleId
|
||||
WHERE ro.operatorname = '{0}'
|
||||
)
|
||||
select * from p_systembillsource where typeCode=@typeCode" + cond +
|
||||
@" and isnull(isVisible,0)=0 and (isnull(viewOper,'')='' or CHARINDEX(',' + '{0}' + ',', ',' + viewOper + ',')>0 OR EXISTS (
|
||||
SELECT 1 FROM UserRoles AS ur WHERE CHARINDEX('{{&' + ur.roleName + '&}}', viewOper) > 0)) order by orderid", ERPInfo.Instance.UserName);
|
||||
string sqlDetail = string.Format(@"WITH UserRoles AS (
|
||||
SELECT r.roleName
|
||||
FROM p_systemRoleOperSetTab AS ro
|
||||
JOIN p_systemRoleSetTab AS r ON r.id = ro.roleId
|
||||
WHERE ro.operatorname = '{0}'
|
||||
)
|
||||
SELECT id,sourceId,fieldName,sysName,userName,orderid,isVisible,sourceKey,privilegeView,DataFormat,isSum,ifmerge,{2}
|
||||
isnull(CASE WHEN isVisible=1 OR (ISNULL(b.userList,'')='' AND ISNULL(a.PrivilegeView,'')<>'') THEN 0 ELSE width END,0) width
|
||||
FROM p_systembillsourcedetail a
|
||||
LEFT JOIN (
|
||||
SELECT userList,privTypeId from p_systemPrivilege b where modId = '{0}'
|
||||
AND CHARINDEX(',' + '{1}' + ',', ',' + userList + ',') > 0
|
||||
) b on CHARINDEX(',' + CAST(b.privTypeId AS VARCHAR(5)) + ',',',' + PrivilegeView + ',') > 0
|
||||
where sourceId in (select id from p_systembillsource where typeCode=@typeCode" + cond + @" and isnull(isVisible,0)=0 and (isnull(viewOper,'')='' or CHARINDEX(',' + '{1}' + ',', ',' + viewOper + ',')>0) OR EXISTS (
|
||||
SELECT 1 FROM UserRoles AS ur WHERE CHARINDEX('{{&' + ur.roleName + '&}}', viewOper) > 0)) {3} order by sourceId,orderid", menuCode, ERPInfo.Instance.UserName, otherfield, conditions);
|
||||
|
||||
htTable["master"] = SqlHelper.ExecuteDataTable(sqlValue, new SqlParameter[] { new SqlParameter("@typeCode", menuCode) });
|
||||
htTable["detail"] = SqlHelper.ExecuteDataTable(sqlDetail, new SqlParameter[] { new SqlParameter("@typeCode", menuCode) });
|
||||
|
||||
@@ -23,14 +23,15 @@ namespace Lskj.Business.Impl
|
||||
/// <returns>DataTable.</returns>
|
||||
public static DataTable GetPurview(string condition)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(condition)) {
|
||||
if (string.IsNullOrWhiteSpace(condition))
|
||||
{
|
||||
string allSql = string.Format("select * from p_formmenuconfigtab where len(MenuStruct)>2");
|
||||
return GetDataTableResult(allSql);
|
||||
}
|
||||
string sqlValue = string.Format("select * from p_formmenuconfigtab where len(MenuStruct)>2 and menuId in({0})", condition);
|
||||
return GetDataTableResult(sqlValue);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:获取子系统表</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
@@ -46,7 +47,7 @@ namespace Lskj.Business.Impl
|
||||
string sqlValue = "select * from P_SubSystemTab where UseEd='1'";
|
||||
return GetDataTableResult(sqlValue);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:获取子系统表模块</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
@@ -57,9 +58,9 @@ namespace Lskj.Business.Impl
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>DataTable.</returns>
|
||||
public static DataTable GetSystemsTable(string way,bool isChildren)
|
||||
public static DataTable GetSystemsTable(string way, bool isChildren)
|
||||
{
|
||||
string sqlValue = isChildren ? "select * from p_formmenuconfigtab where " + way:"select * from p_formmenuconfigtab where ParentMenuId='-1' and LEN(MenuStruct)=2 " + way;
|
||||
string sqlValue = isChildren ? "select * from p_formmenuconfigtab where " + way : "select * from p_formmenuconfigtab where ParentMenuId='-1' and LEN(MenuStruct)=2 " + way;
|
||||
return GetDataTableResult(sqlValue);
|
||||
}
|
||||
/// <summary>
|
||||
@@ -108,7 +109,7 @@ namespace Lskj.Business.Impl
|
||||
{
|
||||
string where = string.Empty;
|
||||
if (!string.IsNullOrEmpty(depid))
|
||||
where = string.Format(" where operatorid='{0}'",depid);
|
||||
where = string.Format(" where operatorid='{0}'", depid);
|
||||
if (!string.IsNullOrEmpty(mf))
|
||||
where = string.Format(" and (loginaccount like '%{0}%' or employeename like '%{0}%' or dbo.P_getpy(employeename) like '%{0}%')", mf);
|
||||
|
||||
@@ -215,13 +216,15 @@ namespace Lskj.Business.Impl
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>System.Int32.</returns>
|
||||
public static bool SaveRoleOperDate(string OperId, string OperName, string departemnt, string readdate, string editdate,bool IsBrowse)
|
||||
public static bool SaveRoleOperDate(string OperId, string OperName, string departemnt, string readdate, string editdate, bool IsBrowse)
|
||||
{
|
||||
string sqlValue = string.Empty;
|
||||
if (IsBrowse) {
|
||||
if (IsBrowse)
|
||||
{
|
||||
sqlValue = string.Format(" if exists (select * from p_systemRoleOperSetTab s where s.operatorid='{0}') update p_systemRoleOperSetTab set ReadPurview='{4}' where operatorid = '{0}' ELSE insert into p_systemRoleOperSetTab (roleId,roleOperatorId,operatorid,operatorname,operatedate,department,ReadPurview,EditPurview) values ('0','{0}','{0}','{1}','{2}','{3}','{4}','{5}')", OperId, OperName, DateTime.Now, departemnt, readdate, "");
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
sqlValue = string.Format(" if exists (select * from p_systemRoleOperSetTab s where s.operatorid='{0}') update p_systemRoleOperSetTab set EditPurview='{5}' where operatorid = '{0}' ELSE insert into p_systemRoleOperSetTab (roleId,roleOperatorId,operatorid,operatorname,operatedate,department,ReadPurview,EditPurview) values ('0','{0}','{0}','{1}','{2}','{3}','{4}','{5}')", OperId, OperName, DateTime.Now, departemnt, "", editdate);
|
||||
}
|
||||
|
||||
@@ -281,10 +284,10 @@ namespace Lskj.Business.Impl
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>System.Int32.</returns>
|
||||
public static bool DropDate(int OperId,string JobNumber,string OperName, string departemnt, string id)
|
||||
public static bool DropDate(int OperId, string JobNumber, string OperName, string departemnt, string id)
|
||||
{
|
||||
|
||||
string sqlValue = string.Format("INSERT INTO p_systemRoleOperSetTab (roleId, roleOperatorId,operatorid,operatorname,department,operatedate,JobNumber) VALUES ('{0}','{1}','{1}','{2}','{3}','{4}','{5}')", id, OperId, OperName, departemnt, DateTime.Now,JobNumber);
|
||||
string sqlValue = string.Format("INSERT INTO p_systemRoleOperSetTab (roleId, roleOperatorId,operatorid,operatorname,department,operatedate,JobNumber) VALUES ('{0}','{1}','{1}','{2}','{3}','{4}','{5}')", id, OperId, OperName, departemnt, DateTime.Now, JobNumber);
|
||||
return ExecSqlValue(sqlValue) > 0;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -312,7 +315,7 @@ namespace Lskj.Business.Impl
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>System.Int32.</returns>
|
||||
public static bool deletRoleDate(string id,string roleId)
|
||||
public static bool deletRoleDate(string id, string roleId)
|
||||
{
|
||||
string sqlValue = string.Format("DELETE FROM p_systemRoleOperSetTab WHERE operatorid = '{0}' and roleId='{1}'", id, roleId);
|
||||
return ExecSqlValue(sqlValue) > 0;
|
||||
@@ -349,7 +352,7 @@ namespace Lskj.Business.Impl
|
||||
where = string.Format(" where (员工姓名 like '%{0}%' or dbo.P_getpy(员工姓名) like '%{0}%')", mc);
|
||||
if (!string.IsNullOrEmpty(dc))
|
||||
{
|
||||
where +=string.IsNullOrWhiteSpace(mc)?string.Format(" where 员工工号 like '%{0}%'",dc):string.Format(" and 员工工号 like '%{0}%'",dc);
|
||||
where += string.IsNullOrWhiteSpace(mc) ? string.Format(" where 员工工号 like '%{0}%'", dc) : string.Format(" and 员工工号 like '%{0}%'", dc);
|
||||
}
|
||||
string sqlValue = "select 员工ID,员工工号,员工姓名,所属部门 from P_employeeBaseView " + where;
|
||||
return GetDataTableResult(sqlValue);
|
||||
@@ -366,7 +369,7 @@ namespace Lskj.Business.Impl
|
||||
/// <returns>System.Int32.</returns>
|
||||
public static bool intnewOper(string OperName)
|
||||
{
|
||||
string sqlValue = string.Format("INSERT INTO p_systemRoleSetTab (roleName,operatedate) VALUES ('{0}','{1}')", OperName,DateTime.Now);
|
||||
string sqlValue = string.Format("INSERT INTO p_systemRoleSetTab (roleName,operatedate) VALUES ('{0}','{1}')", OperName, DateTime.Now);
|
||||
return ExecSqlValue(sqlValue) > 0;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -379,9 +382,9 @@ namespace Lskj.Business.Impl
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>System.Int32.</returns>
|
||||
public static bool UpdOper(string OperName,string id)
|
||||
public static bool UpdOper(string OperName, string id)
|
||||
{
|
||||
string sqlValue = string.Format("Update p_systemRoleSetTab set roleName='{0}',operatedate='{1}' where id={2} ", OperName, DateTime.Now,id);
|
||||
string sqlValue = string.Format("Update p_systemRoleSetTab set roleName='{0}',operatedate='{1}' where id={2} ", OperName, DateTime.Now, id);
|
||||
return ExecSqlValue(sqlValue) > 0;
|
||||
}
|
||||
|
||||
@@ -396,7 +399,7 @@ namespace Lskj.Business.Impl
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>System.Int32.</returns>
|
||||
public static DataTable GetAllModulesData()
|
||||
public static DataTable GetAllModulesData()
|
||||
{
|
||||
string sqlValue = "select convert(varchar(50), SubSysId)+'_'+ MenuStruct ID ,MenuId,MenuCaption,PurviewId,'0' as Editflag ,'0' as Readflag,DllFilename from P_FormMenuConfigTab order by MenuId";
|
||||
return GetDataTableResult(sqlValue);
|
||||
@@ -461,9 +464,9 @@ namespace Lskj.Business.Impl
|
||||
public static DataTable GetBillAboveData(string tab)
|
||||
{
|
||||
//string Sql = string.Format(@" select * from
|
||||
// (select top 1000 formkey,typeCode,id,orderid,fieldName,sysName,userName,fieldTypeId,nullable,isVisible,edited, width, defaultValue,UserBak,UserOpname,UserOpDt,privilegeView,privilegeOper,'0' as OperValue,'0' as ViewValue from p_systembillInfo
|
||||
// where 1=1 and isnull(isvisible,0)=0 order by orderid ) a
|
||||
// where 1=1 and typeCode='{0}'", tab);
|
||||
// (select top 1000 formkey,typeCode,id,orderid,fieldName,sysName,userName,fieldTypeId,nullable,isVisible,edited, width, defaultValue,UserBak,UserOpname,UserOpDt,privilegeView,privilegeOper,'0' as OperValue,'0' as ViewValue from p_systembillInfo
|
||||
// where 1=1 and isnull(isvisible,0)=0 order by orderid ) a
|
||||
// where 1=1 and typeCode='{0}'", tab);
|
||||
string Sql = string.Format(@" select * from
|
||||
(select formkey,typeCode,id,orderid,fieldName,sysName,userName,fieldTypeId,nullable,isVisible,edited, width, defaultValue,UserBak,UserOpname,UserOpDt,privilegeView,privilegeOper from p_systembillInfo
|
||||
where 1=1 and isnull(isvisible,0)=0) a
|
||||
@@ -485,9 +488,9 @@ namespace Lskj.Business.Impl
|
||||
public static DataTable GetBillDetailData(string tab)
|
||||
{
|
||||
//string Sql = string.Format(@" select * from
|
||||
// (select top 1000 DataFormat,typeCode,id,orderid,fieldName,sysName,userName,fieldTypeId,nullable,isVisible,edited, width, defaultValue,UserBak,UserOpname,UserOpDt,privilegeView,privilegeOper,'0' as OperValue,'0' as ViewValue from p_systembilldetail
|
||||
// where 1=1 and isnull(isvisible,0)=0 and width>0 order by orderid )a
|
||||
// where 1=1 and typeCode='{0}' ", tab);
|
||||
// (select top 1000 DataFormat,typeCode,id,orderid,fieldName,sysName,userName,fieldTypeId,nullable,isVisible,edited, width, defaultValue,UserBak,UserOpname,UserOpDt,privilegeView,privilegeOper,'0' as OperValue,'0' as ViewValue from p_systembilldetail
|
||||
// where 1=1 and isnull(isvisible,0)=0 and width>0 order by orderid )a
|
||||
// where 1=1 and typeCode='{0}' ", tab);
|
||||
string Sql = string.Format(@" select * from
|
||||
(select DataFormat,typeCode,id,orderid,fieldName,sysName,userName,fieldTypeId,nullable,isVisible,edited, width, defaultValue,UserBak,UserOpname,UserOpDt,privilegeView,privilegeOper from p_systembilldetail
|
||||
where 1=1 and isnull(isvisible,0)=0 and width>0 )a
|
||||
@@ -497,27 +500,28 @@ namespace Lskj.Business.Impl
|
||||
}
|
||||
|
||||
//获得全部权限人员
|
||||
public static string getAllPersonnel(string name)
|
||||
public static string getAllPersonnel(string name)
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(name)) return "";
|
||||
if (string.IsNullOrWhiteSpace(name)) return "";
|
||||
|
||||
//获得所有角色
|
||||
List<string> condition = ReplaceHelper.GetParamFields(name);
|
||||
|
||||
DataTable dataTable=GetWorkRole("", "");
|
||||
DataTable dataTable = GetWorkRole("", "");
|
||||
|
||||
foreach (string role in condition)
|
||||
foreach (string role in condition)
|
||||
{
|
||||
string newName = string.Empty;
|
||||
string roleName = role.Replace("{&", "").Replace("&}", "");
|
||||
DataRow[] drs = dataTable.Select("roleName='"+ roleName + "'");
|
||||
DataRow[] drs = dataTable.Select("roleName='" + roleName + "'");
|
||||
if (drs.Length < 1) continue;
|
||||
string id = drs[0]["id"] + "";
|
||||
DataTable PersonnelDt = GetWorkUsers(id);
|
||||
foreach (DataRow dr in PersonnelDt.Rows) {
|
||||
foreach (DataRow dr in PersonnelDt.Rows)
|
||||
{
|
||||
newName += dr["员工姓名"] + ",";
|
||||
}
|
||||
name=name.Replace(role, newName.TrimEnd(','));//
|
||||
name = name.Replace(role, newName.TrimEnd(','));
|
||||
}
|
||||
|
||||
|
||||
@@ -585,7 +589,7 @@ namespace Lskj.Business.Impl
|
||||
/// <returns>System.Int32.</returns>
|
||||
public static bool deletPermissionClassification(string id)
|
||||
{
|
||||
if (BaseImpl.HasExistsColumn("p_systemPrivilege", "roleid"))
|
||||
if (BaseImpl.HasExistsColumn("p_systemPrivilege", "roleid"))
|
||||
{
|
||||
string sqlValue = string.Format("DELETE FROM p_systemPrivilege WHERE roleid = '{0}'", id);
|
||||
return ExecSqlValue(sqlValue) > 0;
|
||||
@@ -650,7 +654,7 @@ namespace Lskj.Business.Impl
|
||||
/// <param name="roleid"></param>
|
||||
/// <param name="roleName"></param>
|
||||
/// <param name="moduleCodes"></param>
|
||||
public static void SetRolePermissionclassification(string roleid,string roleName, DataTable Module)
|
||||
public static void SetRolePermissionclassification(string roleid, string roleName, DataTable Module)
|
||||
{
|
||||
|
||||
BaseImpl.HasExistsColumn("p_systemPrivilege", "roleid", "int");
|
||||
@@ -676,7 +680,7 @@ namespace Lskj.Business.Impl
|
||||
NewModule.Add(PurviewId);
|
||||
}
|
||||
}
|
||||
DataTable dataTable= GetDataTableResult(string.Format("select * from p_systemPrivilege where roleid='{0}'", roleid));
|
||||
DataTable dataTable = GetDataTableResult(string.Format("select * from p_systemPrivilege where roleid='{0}'", roleid));
|
||||
foreach (DataRow item in dataTable.Rows)
|
||||
{
|
||||
string PurviewId = item["modId"] + "";
|
||||
@@ -687,7 +691,7 @@ namespace Lskj.Business.Impl
|
||||
}
|
||||
|
||||
string Sql = string.Empty;
|
||||
List<string> AddList= NewModule.Except(OldModule).ToList();
|
||||
List<string> AddList = NewModule.Except(OldModule).ToList();
|
||||
List<string> DeleteList = OldModule.Except(NewModule).ToList();
|
||||
|
||||
//添加新增的权限模块
|
||||
@@ -698,7 +702,7 @@ namespace Lskj.Business.Impl
|
||||
if (dr != null) privTypeId = int.Parse(dr["privTypeId"] + "") + 1;
|
||||
|
||||
Sql += string.Format(" insert into p_systemPrivilege(privTypeId,privTypeName,modId,userList,remark,roleid) VALUES ('{0}','{1}','{2}','{3}','{4}','{5}'); ",
|
||||
privTypeId + "", roleName, item, text,"", roleid);
|
||||
privTypeId + "", roleName, item, text, "", roleid);
|
||||
}
|
||||
//删除移除的权限模块
|
||||
foreach (string item in DeleteList)
|
||||
@@ -709,27 +713,4 @@ namespace Lskj.Business.Impl
|
||||
|
||||
//拼接添加权限分类sql
|
||||
//List<string> moduleNumbers = new List<string>();
|
||||
//string Sql = string.Format("delete p_systemPrivilege where roleid='{0}';", roleid);
|
||||
//foreach (DataRow item in Module.Rows)
|
||||
//{
|
||||
// string PurviewId = item["PurviewId"] + "";
|
||||
// if (!string.IsNullOrWhiteSpace(PurviewId) && !moduleNumbers.Contains(PurviewId))
|
||||
// {
|
||||
// moduleNumbers.Add(PurviewId);
|
||||
// DataRow dr= GetDataRowResult(string.Format("select top 1 privTypeId from p_systemPrivilege where modId='{0}' order by privTypeId desc ", PurviewId));
|
||||
// int privTypeId =1;
|
||||
// if (dr != null) privTypeId = int.Parse(dr["privTypeId"] + "") + 1;
|
||||
|
||||
// Sql += string.Format(" insert into p_systemPrivilege(privTypeId,privTypeName,modId,userList,remark,roleid) VALUES ('{0}','{1}','{2}','{3}','{4}','{5}'); ",
|
||||
// privTypeId+"", roleName, PurviewId, text,"", roleid);
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
//ExecSqlValue(Sql);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//string Sql = string.Format("delete p_sy
|
||||
Reference in New Issue
Block a user