/// <summary> /// 检查权限授权情况。返回true 则该菜单已经授权当然登录人允许操作 /// </summary> /// <param name="alName">菜单类名,同权限表</param> /// <param name="oldeName">原(离职人)姓名</param> /// <returns>true / false 为true则该菜单已经授权当然登录人允许操作</returns> public static bool CheckAuthorityEmpower(string alName, string oldeName) { if (UserInfo.eName.Equals(oldeName)) { return(true); } else { StringBuilder sb = new StringBuilder(); sb.Append(" SELECT TOP 1 1 FROM B_AuthorityEmpower m"); sb.Append(" INNER JOIN B_AuthorityEmpowerDetail d"); sb.Append(" ON d.aeID=m.aeID"); sb.Append(" WHERE d.isEmpower=1 AND m.[State]=99"); sb.Append(" AND d.alName='" + alName + "'"); sb.Append(" AND m.oldeName='" + oldeName + "'"); sb.Append(" AND m.neweID=" + UserInfo.eID); if (YKDataClass.Exists(sb.ToString())) { return(true); } else { return(false); } } }
/// <summary> /// 判断操作人是否存在流程中 /// 2013-6-25 张 /// </summary> /// <param name="table"></param> /// <param name="key"></param> /// <param name="value"></param> /// <param name="eID"></param> /// <returns></returns> public static bool InFlow(string table, string key, int value, int eID) { string sql = " SELECT TOP 1 1 FROM dbo.B_ApproveMain AS bam INNER JOIN dbo.B_FlowApproveView AS bfa ON bam.fmID = bfa.fmID " + " WHERE amTable = '" + table + "' AND amKey = '" + key + "' AND amValue = " + value + " AND bfa.eID = " + eID.ToString(); return(YKDataClass.Exists(sql)); }
/// <summary> /// 判断是否设置了审批流程 /// </summary> /// <returns></returns> public static bool IfSetApproveFlow(string mName) { try { string sql = "SELECT TOP 1 1 FROM dbo.B_FlowMain AS bfm WHERE mName = '" + mName + "'"; return(YKDataClass.Exists(sql)); } catch { return(false); } }
/// <summary> /// 判断菜单的编码是否为只读 /// 6-26 张 /// </summary> /// <param name="CHN"></param> /// <returns></returns> public static bool AutoCodeIsReadOnly(string CHN) { string sql = " SELECT TOP 1 1 FROM AutoCode WHERE A_TableCHN = '" + CHN + "' AND A_ReadOnly = 1"; return(YKDataClass.Exists(sql)); }
/// <summary> /// 判断是否显示分公司 /// 张镇波 5-29 /// </summary> /// <param name="mName"></param> /// <returns></returns> public static bool ShowCompany(string mName) { string sql = " SELECT TOP 1 1 FROM B_ShowCompany WHERE scName = '" + mName + "'"; return(YKDataClass.Exists(sql)); }