Ejemplo n.º 1
0
    /// <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);
    }
Ejemplo n.º 2
0
    /// <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());
    }
Ejemplo n.º 3
0
    ///// <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());
    }
Ejemplo n.º 5
0
    /// <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());
    }
Ejemplo n.º 6
0
    /// <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());
    }
Ejemplo n.º 7
0
 /// <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);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 修改一条数据
 /// </summary>
 /// <param name="model"></param>
 public void UpdateUrl(UrlDataModel model)
 {
     WebAccess.GetInstance().UpdateUrl(model);
 }
Ejemplo n.º 9
0
 /// <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);
 }
Ejemplo n.º 10
0
 /// <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));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 根据用户编号删除一个用户
 /// </summary>
 /// <param name="userGUID">用户GUID</param>
 public void DeleteUserData(string userGUID)
 {
     WebAccess.GetInstance().DeleteUserData(userGUID);
 }
Ejemplo n.º 12
0
 /// <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));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 获取最大UrlIndex值
 /// </summary>
 /// <returns></returns>
 public int GetMaxUrlIndex()
 {
     return(WebAccess.GetInstance().GetMaxUrlIndex());
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 删除一条Module_Data数据
 /// </summary>
 public void DeleteUrl(string strWhere)
 {
     WebAccess.GetInstance().DeleteUrl(strWhere);
 }
Ejemplo n.º 15
0
 /// <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));
 }
Ejemplo n.º 16
0
 public DataSet GetUserGroupList(string userGroup_GUID, string userGroupName)
 {
     return(WebAccess.GetInstance().GetUserGroupList(userGroup_GUID, userGroupName));
 }
Ejemplo n.º 17
0
 /// <summary>
 /// 导入表Module_Data
 /// </summary>
 public void ImportUrl(string values)
 {
     WebAccess.GetInstance().ImportUrl(values);
 }
Ejemplo n.º 18
0
 /// <summary>
 /// 根据操作类型插入或更新一条用户数据
 /// </summary>
 /// <param name="model"></param>
 /// <param name="type"></param>
 public void AddOrUpdateUser(UserDataModel model, string type)
 {
     WebAccess.GetInstance().AddOrUpdateUser(model, type);
 }
Ejemplo n.º 19
0
 /// <summary>
 /// 获取所有Module_Data
 /// </summary>
 public DataSet SelectUrlData(UrlDataModel model)
 {
     return(WebAccess.GetInstance().SelectUrlData(model));
 }
Ejemplo n.º 20
0
 /// <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));
 }
Ejemplo n.º 21
0
 /// <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));
 }
Ejemplo n.º 22
0
 /// <summary>
 /// 更新用户的禁止状态
 /// </summary>
 /// <param name="userGUID">用户GUID</param>
 /// <param name="ban">当前状态</param>
 public void ChangeUserState(string userGUID, bool ban)
 {
     WebAccess.GetInstance().ChangeUserState(userGUID, ban);
 }
Ejemplo n.º 23
0
 /// <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));
 }
Ejemplo n.º 24
0
 /// <summary>
 /// 插入一条数据
 /// </summary>
 /// <param name="model"></param>
 public void AddUrl(UrlDataModel model)
 {
     WebAccess.GetInstance().AddUrl(model);
 }
Ejemplo n.º 25
0
 /// <summary>
 /// 获取所有子节点URL数据集
 /// </summary>
 /// <param name="parentGuid">父节点</param>
 /// <returns></returns>
 public DataSet GetSubUrlData(string parentGuid)
 {
     return(WebAccess.GetInstance().GetSubUrlData(parentGuid));
 }
Ejemplo n.º 26
0
 /// <summary>
 /// 清空表Module_Data
 /// </summary>
 public void DeleteAllUrl()
 {
     WebAccess.GetInstance().DeleteAllUrl();
 }
Ejemplo n.º 27
0
 /// <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));
 }