/// <summary> /// 检查是否有搜索权限 /// </summary> /// <returns></returns> public static bool CheckSearch() { bool isSearch = false; StringBuilder sbmenu = new StringBuilder(); DataSet ds = WebAccess.GetInstance().GetUserUrl(WebBeanUse.GetInstance().Account); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; string urlParams = string.Empty; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = ds.Tables[0].Rows[i];//UrlParams urlParams = dr["UrlParams"].ToString(); if ("top".Equals(dr["UrlCode"].ToString().Trim().ToLower()) && !string.Empty.Equals(urlParams)) { if ("search".Equals(urlParams.Trim().ToLower())) { isSearch = true; break; } } } } return(isSearch); }
/// <summary> /// 得到权限菜单 /// </summary> /// <returns></returns> public static string GetPage() { StringBuilder sbmenu = new StringBuilder(); DataSet ds = WebAccess.GetInstance().GetUserUrl(WebBeanUse.GetInstance().Account); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; string tmpmenu = "<a href=\"javascript:showUrl('{0}');\">[{1}]</a>"; string url = string.Empty; string urlParams = string.Empty; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = ds.Tables[0].Rows[i];//UrlParams url = dr["Url"].ToString(); urlParams = dr["UrlParams"].ToString(); if ("top".Equals(dr["UrlCode"].ToString().Trim().ToLower()) && !string.Empty.Equals(urlParams) && "search".Equals(urlParams.Trim().ToLower())) { continue; } if (!string.Empty.Equals(urlParams)) { url += "?" + dr["UrlParams"].ToString(); } sbmenu.AppendFormat(tmpmenu, url, dr["UrlName"].ToString()); } } return(sbmenu.ToString()); }
///// <summary> ///// 用户登录。 ///// </summary> ///// <param name="account">账号。</param> ///// <param name="password">密码。</param> ///// <returns>登录结果。</returns> //public bool UserLogin(string account, string password) //{ // HttpContext currentHttpContext = HttpContext.Current; // string clientPassword = string.Empty; // var info = WebAccess.GetInstance().CheckUserCertificate(account, // password, // string.Format("{0}@{1}", currentHttpContext.Session.SessionID, currentHttpContext.Request.UserHostAddress), // ref clientPassword // ); // Message = info.PermissionVerifyMessage; // if (info.PermissionVerifyState == DataModel.Enum_PermissionVerifyState.用户验证通过) // { // Account = account; // ClientPassword = clientPassword; // return true; // } // else // { // Account = string.Empty; // ClientPassword = string.Empty; // return false; // } //} ///// <summary> ///// 检查用户登录状况。 ///// </summary> ///// <returns>检查结果。</returns> //public bool CheckUser() //{ // HttpContext currentHttpContext = HttpContext.Current; // string account = Account; // string clientPassword = ClientPassword; // var info = WebAccess.GetInstance().CheckUserCertificate( // Account, // string.Empty, // string.Format("{0}@{1}", currentHttpContext.Session.SessionID, currentHttpContext.Request.UserHostAddress), // ref clientPassword // ); // Message = info.PermissionVerifyMessage; // if (info.PermissionVerifyState == DataModel.Enum_PermissionVerifyState.用户验证通过) // { // Account = account; // ClientPassword = clientPassword; // return true; // } // else // { // Account = string.Empty; // ClientPassword = string.Empty; // return false; // } //} /// <summary> /// 验证用户url权限。 /// </summary> /// <returns>验证结果。</returns> public bool CheckUrl() { HttpRequest currentRequest = HttpContext.Current.Request; var info = WebAccess.GetInstance().CheckUrl(string.Format("~{0}", currentRequest.Path), currentRequest["Code"], Account); Message = info.PermissionVerifyMessage; if (info.PermissionVerifyState == DataModel.Enum_PermissionVerifyState.该地址验证成功) { return(true); } else { return(false); } }
/// <summary> /// 得到权限菜单 /// </summary> /// <returns></returns> public static string GetPage() { StringBuilder sbmenu = new StringBuilder(); DataSet ds = WebAccess.GetInstance().GetUserChildeUrl("ReportManagement", WebBeanUse.GetInstance().Account); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; string htmLeft = "<tr><td align ='center'>" + "<a href='{0}'>" + "<img src='Images/{1}.jpg' />" + "<br />{2}" + "</a></td></tr>"; string url = string.Empty; string urlParams = string.Empty; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = ds.Tables[0].Rows[i]; url = dr["Url"].ToString(); string img = string.Empty; if (!string.Empty.Equals(dr["UrlParams"].ToString())) { //取图片文件名 &img=aaa urlParams = dr["UrlParams"].ToString(); string[] arr = urlParams.Split('&'); foreach (var param in arr) { if (param.IndexOf("img") == 0) { img = param.Substring(param.IndexOf("=") + 1); break; } } url += "?" + dr["UrlParams"].ToString(); } sbmenu.AppendFormat(htmLeft, url, img, dr["UrlName"].ToString()); } } return(sbmenu.ToString()); }
/// <summary> /// 得到权限菜单 /// </summary> /// <returns></returns> public static string GetPage() { StringBuilder sbmenu = new StringBuilder(); DataSet ds = WebAccess.GetInstance().GetUserChildeUrl("myPage", WebBeanUse.GetInstance().Account); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; string htmLeft = "<li id='menuGroup{2}' style=’cursor: pointer;'>" + "<img onclick='displayMenu({2})' id='groupimg{2}' src='images/t_list_09.jpg' style='cursor: pointer;' />" + "<a href=\"javascript:showUrl('{0}');\">[{1}]</a></li>"; string url = string.Empty; string urlParams = string.Empty; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = ds.Tables[0].Rows[i]; url = dr["Url"].ToString(); string displayMenu = string.Empty; if (!string.Empty.Equals(dr["UrlParams"].ToString())) { //取 &displayMenu=98 urlParams = dr["UrlParams"].ToString(); string[] arr = urlParams.Split('&'); foreach (var param in arr) { if (param.IndexOf("displayMenu") == 0) { displayMenu = param.Substring(param.IndexOf("=") + 1); break; } } url += "?" + dr["UrlParams"].ToString(); } sbmenu.AppendFormat(htmLeft, url, dr["UrlName"].ToString(), displayMenu); } } return(sbmenu.ToString()); }
/// <summary> /// 得到权限菜单 /// </summary> /// <returns></returns> public static string GetPage() { StringBuilder sbmenu = new StringBuilder(); DataSet ds = WebAccess.GetInstance().GetUserChildeUrl("SystemManagementfrm", WebBeanUse.GetInstance().Account); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; string htmLeft = "<li id='menuGroup99' style='cursor:pointer;'><a href=\"javascript:showUrl('{0}');\">[{1}]</a></li>"; string url = string.Empty; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = ds.Tables[0].Rows[i]; url = dr["Url"].ToString(); if (!string.Empty.Equals(dr["UrlParams"].ToString())) { url += "?" + dr["UrlParams"].ToString(); } sbmenu.AppendFormat(htmLeft, url, dr["UrlName"].ToString()); } } return(sbmenu.ToString()); }
/// <summary> /// 保存权限分配信息 /// </summary> /// <param name="urlGuid">地址</param> /// <param name="userGroupGuid">用户组</param> /// <param name="proirotyLevel">优先级</param> /// <param name="type">是否禁止-1:未分配0:禁止1:允许</param> public void SavePermission(string urlGuid, string userGroupGuid, int proirotyLevel, string type) { WebAccess.GetInstance().SavePermission(urlGuid, userGroupGuid, proirotyLevel, type); }
/// <summary> /// 修改一条数据 /// </summary> /// <param name="model"></param> public void UpdateUrl(UrlDataModel model) { WebAccess.GetInstance().UpdateUrl(model); }
/// <summary> /// 把用户插入用户数组 /// </summary> /// <param name="userGUID">用户GUID</param> /// <param name="userGroupGUID">用户组GUID</param> public void AddUserToUserGroup(string userGUID, string userGroupGUID, bool addOrDelete) { WebAccess.GetInstance().AddUserToUserGroup(userGUID, userGroupGUID, addOrDelete); }
/// <summary> /// 查询用户组的所有用户。 /// </summary> /// <param name="userGroup_GUID">用户组GUID。</param> /// <param name="userAccount">用户帐号</param> /// <param name="userName">用户名。</param> /// <param name="isBelongto">是否属于</param> /// <returns>用户和用户组信息数据集。</returns> public DataSet SelectGroupUsersData(string userGroup_GUID, string userAccount, string userName, bool?ban, bool isBelongto) { return(WebAccess.GetInstance().SelectGroupUsersData(userGroup_GUID, userAccount, userName, ban, isBelongto)); }
/// <summary> /// 根据用户编号删除一个用户 /// </summary> /// <param name="userGUID">用户GUID</param> public void DeleteUserData(string userGUID) { WebAccess.GetInstance().DeleteUserData(userGUID); }
/// <summary> /// 查询用户信息。 /// </summary> /// <param name="guid">GUID。</param> /// <param name="account">账号。</param> /// <param name="userName">用户名。模糊查询。</param> /// <param name="password">密码。</param> /// <param name="ban">是否禁止。</param> /// <returns>用户信息查询结果数据集。</returns> public DataSet Select_User_Data(string guid = null, string account = null, string userName = null, string password = null, bool?ban = null) { return(WebAccess.GetInstance().Select_User_Data(guid, account, userName, password, ban)); }
/// <summary> /// 获取最大UrlIndex值 /// </summary> /// <returns></returns> public int GetMaxUrlIndex() { return(WebAccess.GetInstance().GetMaxUrlIndex()); }
/// <summary> /// 删除一条Module_Data数据 /// </summary> public void DeleteUrl(string strWhere) { WebAccess.GetInstance().DeleteUrl(strWhere); }
/// <summary> /// 获取用户和用户组信息。 /// </summary> /// <param name="user_GUID">用户GUID。</param> /// <param name="userGroup_GUID">用户组GUID。</param> /// <param name="account">用户账号。</param> /// <param name="userName">用户名。</param> /// <param name="userGroupName">用户组名。</param> /// <returns>用户和用户组信息数据集。</returns> public DataSet Select_UserGroup_Type_User_Data(string user_GUID = null, string userGroup_GUID = null, string account = null, string userName = null, string userGroupName = null) { return(WebAccess.GetInstance().Select_UserGroup_Type_User_Data(user_GUID, userGroup_GUID, account, userName, userGroupName)); }
public DataSet GetUserGroupList(string userGroup_GUID, string userGroupName) { return(WebAccess.GetInstance().GetUserGroupList(userGroup_GUID, userGroupName)); }
/// <summary> /// 导入表Module_Data /// </summary> public void ImportUrl(string values) { WebAccess.GetInstance().ImportUrl(values); }
/// <summary> /// 根据操作类型插入或更新一条用户数据 /// </summary> /// <param name="model"></param> /// <param name="type"></param> public void AddOrUpdateUser(UserDataModel model, string type) { WebAccess.GetInstance().AddOrUpdateUser(model, type); }
/// <summary> /// 获取所有Module_Data /// </summary> public DataSet SelectUrlData(UrlDataModel model) { return(WebAccess.GetInstance().SelectUrlData(model)); }
/// <summary> /// 保存用户组信息。 /// </summary> /// <param name="userGroup_GUID">用户组GUID。</param> /// <param name="userGroupName">用户组名。</param> /// <param name="type">保存方式add:增加 update:更新</param> /// <returns>用户和用户组信息数据集。</returns> public DataSet SaveUserGroupData(string userGroup_GUID, string userGroupName, string type) { return(WebAccess.GetInstance().SaveUserGroupData(userGroup_GUID, userGroupName, type)); }
/// <summary> /// 查询url信息。 /// </summary> /// <param name="guid">urlId。</param> /// <param name="url">url地址。</param> /// <param name="urlCode">url代码。</param> /// <param name="urlName">url名称。</param> /// <param name="userAuthentication">是否验证用户。</param> /// <param name="show">是否显示。</param> /// <returns>url信息数据集。</returns> public DataSet Select_Url_Data(string guid = null, string parentGuid = null, string url = null, string urlCode = null, string urlName = null, int userAuthentication = -1, int show = -1) { return(WebAccess.GetInstance().Select_Url_Data(guid, parentGuid, url, urlCode, urlName, userAuthentication, show)); }
/// <summary> /// 更新用户的禁止状态 /// </summary> /// <param name="userGUID">用户GUID</param> /// <param name="ban">当前状态</param> public void ChangeUserState(string userGUID, bool ban) { WebAccess.GetInstance().ChangeUserState(userGUID, ban); }
/// <summary> /// 用户组与地址关联性查询。 /// </summary> /// <param name="userGroup_GUID">用户组GUID。</param> /// <param name="url_GUID">地址GUID。</param> /// <param name="url">地址。</param> /// <param name="urlCode">地址编码。</param> /// <returns>用户组与地址关联性数据集。</returns> public DataSet Select_Url_Data_UserGroup_Type(string userGroup_GUID = null, string url_GUID = null, string url = null, string urlCode = null, bool?forbidden = null) { return(WebAccess.GetInstance().Select_Url_Data_UserGroup_Type(userGroup_GUID, url_GUID, url, urlCode, forbidden)); }
/// <summary> /// 插入一条数据 /// </summary> /// <param name="model"></param> public void AddUrl(UrlDataModel model) { WebAccess.GetInstance().AddUrl(model); }
/// <summary> /// 获取所有子节点URL数据集 /// </summary> /// <param name="parentGuid">父节点</param> /// <returns></returns> public DataSet GetSubUrlData(string parentGuid) { return(WebAccess.GetInstance().GetSubUrlData(parentGuid)); }
/// <summary> /// 清空表Module_Data /// </summary> public void DeleteAllUrl() { WebAccess.GetInstance().DeleteAllUrl(); }
/// <summary> /// 获取地址和地址用户组关联信息 /// </summary> /// <param name="userGroupGuid"></param> /// <param name="urlGuid"></param> /// <param name="parentGuid"></param> /// <param name="forbidden"></param> /// <returns></returns> public DataSet GetUrlAndUserGroupLink(string userGroupGuid, string urlGuid, string parentGuid, string forbidden) { return(WebAccess.GetInstance().GetUrlAndUserGroupLink(userGroupGuid, parentGuid, urlGuid, forbidden)); }