Exemplo n.º 1
0
        /// <summary>
        /// 创建子节点
        /// </summary>
        /// <param name="list">list</param>
        /// <param name="dt">list</param>
        /// <returns></returns>
        public string GetTreeNode(IList list, DataTable dt)
        {
            StringBuilder            sb_TreeNode = new StringBuilder();
            List <BPMS_Organization> itemNode    = IListHelper.IListToList <BPMS_Organization>(list).FindAll(t => t.Category == "公司");
            int    index    = 0;
            string strclass = "";

            if (itemNode.Count > 0)
            {
                sb_TreeNode.Append("<ul>");
                foreach (BPMS_Organization entity in itemNode)
                {
                    if (index == 0)
                    {
                        strclass = "collapsableselected";
                    }
                    else
                    {
                        strclass = "";
                    }
                    sb_TreeNode.Append("<li>");
                    sb_TreeNode.Append("<div class='" + strclass + "' id='" + entity.OrganizationId + "'><img src='/Themes/images/16/chart_organisation.png' style='vertical-align: middle;' alt=''/>" + entity.FullName + "</div>");
                    sb_TreeNode.Append("</li>");
                    NodeRole(dt, entity.OrganizationId);
                    index++;
                }
                sb_TreeNode.Append("</ul>");
            }
            return(sb_TreeNode.ToString());
        }
Exemplo n.º 2
0
        //加载部门成员
        public void NodeMember(IList ListNotMember, string DepartmentId)
        {
            List <BPMS_User> itemNode = IListHelper.IListToList <BPMS_User>(ListNotMember).FindAll(t => t.DepartmentId == DepartmentId);

            sbMember.Append("<div id='GroupsMember_" + DepartmentId + "' class='DepartmentMember'  style='display:none;'>");
            if (itemNode.Count > 0)
            {
                foreach (BPMS_User item in itemNode)
                {
                    string Genderimg = "user_red.png";
                    string Gender    = item.Gender;
                    if (Gender == "男")
                    {
                        Genderimg = "user_mature.png";
                    }
                    sbMember.Append("<div title='编号:" + item.Code + "\r\n账户:" + item.Account + "' class=\"checkbuttonNo panelcheck\">");
                    sbMember.Append("<div id=\"" + item.UserId + "\" class=\"checktext\">");
                    sbMember.Append("<img src=\"../../Themes/Images/16/" + Genderimg + "\" />" + item.RealName + "");
                    sbMember.Append("</div>");
                    sbMember.Append("<div class=\"triangleNo\"></div>");
                    sbMember.Append("</div>");
                }
            }
            else
            {
                sbMember.Append(" <span style='color:red;'>暂无成员</span>");
            }
            sbMember.Append("</div>");
        }
Exemplo n.º 3
0
        /// <summary>
        /// URL权限验证,加强安全验证防止未授权匿名不合法的请求
        /// </summary>
        public void IsUrlPermission()
        {
            bool IsOK = false;
            //获取当前访问页面地址
            string requestPath = RequestHelper.GetScriptName;

            string[] filterUrl = { "/Frame/HomeIndex.aspx", "/RMBase/SysUser/UpdateUserPwd.aspx" };//过滤特别页面
            for (int i = 0; i < filterUrl.Length; i++)
            {
                if (requestPath == filterUrl[i])
                {
                    IsOK = true;
                    break;
                }
            }
            if (!IsOK)
            {
                string UserId   = RequestSession.GetSessionUser().UserId;
                IList  list     = (IList)StorePermission.Instance.GetModulePermission(UserId);
                IList  itemNode = IListHelper.IListToList <BPMS_ModulePermission>(list).FindAll(t => t.NavigateUrl == requestPath);
                if (itemNode.Count == 0)
                {
                    StringBuilder strHTML = new StringBuilder();
                    strHTML.Append("<div><script type=\"text/javascript\">alert('很抱歉!您的权限不足,访问被拒绝!')</script>");
                    strHTML.Append("</div>");
                    HttpContext.Current.Response.Write(strHTML.ToString());
                    HttpContext.Current.Response.End();
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 创建子节点
        /// </summary>
        /// <param name="parentID">父节点主键</param>
        /// <param name="list">菜单集合</param>
        /// <returns></returns>
        public string GetTreeNode(string ParentId, IList list)
        {
            StringBuilder sb_TreeNode             = new StringBuilder();
            List <BPMS_ModulePermission> itemNode = IListHelper.IListToList <BPMS_ModulePermission>(list).FindAll(t => t.ParentId == ParentId);
            int    index    = 0;
            string strclass = "";

            if (itemNode.Count > 0)
            {
                sb_TreeNode.Append("<ul>");
                foreach (BPMS_ModulePermission entity in itemNode)
                {
                    if (index == 0)
                    {
                        strclass = "collapsableselected";
                    }
                    else
                    {
                        strclass = "";
                    }
                    sb_TreeNode.Append("<li>");
                    sb_TreeNode.Append("<div class='" + strclass + "' id='" + entity.MenuId + "'><img src='/Themes/images/32/" + entity.Img + "' style='width:18px; height:18px;vertical-align: middle;' alt=''/><span>" + entity.FullName + "</span></div>");
                    sb_TreeNode.Append("</li>");
                    index++;
                }
                sb_TreeNode.Append("</ul>");
            }
            return(sb_TreeNode.ToString());
        }
Exemplo n.º 5
0
        /// <summary>
        /// 初始化绑定下拉框
        /// </summary>
        public void InitBindDrop()
        {
            BPMS_ItemDetailsIBLL bpms_itemdetailsibll = new BPMS_ItemDetailsBLL();
            IList list = bpms_itemdetailsibll.GetList();
            //职称
            IList TitleIdList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "2acba9e8-5fa7-4b6f-8ebd-56e753dd059a");

            ControlBindHelper.BindHtmlSelect(TitleIdList, TitleId, "ItemName", "ItemCode", "==请选择==");
            //职位
            IList DutyIdList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "137a2d97-d1d9-4752-9c5e-239097e2ed68");

            ControlBindHelper.BindHtmlSelect(DutyIdList, DutyId, "ItemName", "ItemCode", "==请选择==");
        }
Exemplo n.º 6
0
        /// <summary>
        /// 加载,未选择字段、己选择字段
        /// </summary>
        public void InitBind()
        {
            if (!string.IsNullOrEmpty(_Menu_Id))
            {
                IList list = bpms_tablecolumnsibll.GetList(_Menu_Id);

                //未选择字段
                IList itemfrom_sel = IListHelper.IListToList <BPMS_TableColumns>(list).FindAll(t => t.IsPublic == 0);
                ControlBindHelper.BindHtmlSelect(itemfrom_sel, search_fields_from_sel, "Title", "TableColumnsId", "");
                //己选择字段
                IList itemto_sel = IListHelper.IListToList <BPMS_TableColumns>(list).FindAll(t => t.IsPublic == 1);
                ControlBindHelper.BindHtmlSelect(itemto_sel, search_fields_to_sel, "Title", "TableColumnsId", "");
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 组织机构
        /// </summary>
        public void GetTree()
        {
            IList list = bpms_organizationibll.GetList();
            List <BPMS_Organization> itemNode = IListHelper.IListToList <BPMS_Organization>(list).FindAll(t => t.ParentId == "0");

            foreach (BPMS_Organization entity in itemNode)
            {
                strHtml.Append("<li>");
                strHtml.Append("<div class='divTree' id='" + entity.OrganizationId + "'><img src='/Themes/images/16/house.png' style='vertical-align: middle;' alt=''/><span>" + entity.FullName + "</span></div>");
                //创建子节点
                strHtml.Append(GetTreeNode(entity.OrganizationId, list));
                strHtml.Append("</li>");
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 组织机构
        /// </summary>
        public void GetTree()
        {
            DataTable dt   = bpms_userroleibll.GetUserRoleList(_UserId);
            IList     list = bpms_organizationibll.GetList();
            List <BPMS_Organization> itemNode = IListHelper.IListToList <BPMS_Organization>(list).FindAll(t => t.ParentId == "0");

            foreach (BPMS_Organization entity in itemNode)
            {
                sbCompany.Append("<li>");
                sbCompany.Append("<div id='" + entity.OrganizationId + "'><img src='/Themes/images/16/house.png' style='vertical-align: middle;' alt=''/>" + entity.FullName + "</div>");
                //创建子节点
                sbCompany.Append(GetTreeNode(list, dt));
                sbCompany.Append("</li>");
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 机构列表
        /// </summary>
        public void GetTreeOrgChart()
        {
            IList list = bpms_organizationibll.GetListSys();
            List <BPMS_Organization> itemNode = IListHelper.IListToList <BPMS_Organization>(list).FindAll(t => t.ParentId == "0");

            foreach (BPMS_Organization entity in itemNode)
            {
                string itemid = "v" + entity.OrganizationId.Replace("-", "");
                strHtml_OrgChart.Append("var " + itemid + " = new OrgNode();");
                strHtml_OrgChart.Append("" + itemid + ".Text = \"" + entity.FullName + "\";");
                strHtml_OrgChart.Append("" + itemid + ".Description = \"" + entity.ShortName + "\";");
                //strHtml_OrgChart.Append("" + itemid + ".Link = \"#\";");
                //创建子节点
                strHtml_OrgChart.Append(GetTreeNodeOrgChart(entity.OrganizationId, list));
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 将职位code转换为名称
        /// </summary>
        /// <param name="DutyID"></param>
        /// <returns></returns>
        public string toPosition(string DutyId)
        {
            BPMS_ItemDetailsIBLL bpms_itemdetailsibll = new BPMS_ItemDetailsBLL();
            IList list       = bpms_itemdetailsibll.GetList();
            IList DutyIdList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "137a2d97-d1d9-4752-9c5e-239097e2ed68");

            foreach (BPMS_ItemDetails entity in DutyIdList)
            {
                if (entity.ItemCode == DutyId)
                {
                    return(entity.ItemName);
                }
            }

            return("");
        }
Exemplo n.º 11
0
        /// <summary>
        /// 主功能项
        /// </summary>
        public string GetMenuTree()
        {
            string        UserId   = RequestSession.GetSessionUser().UserId;
            StringBuilder sbModule = new StringBuilder();
            IList         list     = bpms_permissionibll.GetModulePermission(UserId);
            List <BPMS_ModulePermission> itemNode = IListHelper.IListToList <BPMS_ModulePermission>(list).FindAll(t => t.ParentId == "0");

            foreach (BPMS_ModulePermission entity in itemNode)
            {
                sbModule.Append("<li>");
                sbModule.Append("<div id=''><img src='/Themes/images/32/" + entity.Img + "' style='width:18px; height:18px;vertical-align: middle;' alt=''/><span>" + entity.FullName + "</span></div>");
                //创建子节点
                sbModule.Append(GetTreeNode(entity.MenuId, list));
                sbModule.Append("</li>");
            }
            return(sbModule.ToString());
        }
Exemplo n.º 12
0
        /// <summary>
        /// 模块菜单树
        /// </summary>
        public string GetMenuTreeTable(IList list)
        {
            StringBuilder       strHtml  = new StringBuilder();
            List <BPMS_SysMenu> itemNode = IListHelper.IListToList <BPMS_SysMenu>(list).FindAll(t => t.ParentId == "0");

            strHtml.Append("<li>");
            strHtml.Append("<div id='0'>父节点</div>");
            strHtml.Append("</li>");
            foreach (BPMS_SysMenu entity in itemNode)
            {
                strHtml.Append("<li>");
                strHtml.Append("<div id='" + entity.MenuId + "'>" + entity.FullName + "</div>");
                //创建子节点
                strHtml.Append(GetTreeNode(entity.MenuId, list));
                strHtml.Append("</li>");
            }
            return(strHtml.ToString());
        }
Exemplo n.º 13
0
        /// <summary>
        /// 机构列表
        /// </summary>
        public string GetTreeList(IList list)
        {
            StringBuilder            strHtml  = new StringBuilder();
            List <BPMS_Organization> itemNode = IListHelper.IListToList <BPMS_Organization>(list).FindAll(t => t.ParentId == "0");

            strHtml.Append("<li>");
            strHtml.Append("<div id='0'><img src='/Themes/images/16/house.png' style='vertical-align: middle;' alt=''/><span>父节点</span></div>");
            strHtml.Append("</li>");
            foreach (BPMS_Organization entity in itemNode)
            {
                strHtml.Append("<li>");
                strHtml.Append("<div id='" + entity.OrganizationId + "'><img src='/Themes/images/16/house.png' style='vertical-align: middle;' alt=''/><span>" + entity.FullName + "</span></div>");
                //创建子节点
                strHtml.Append(GetTreeNode(entity.OrganizationId, list));
                strHtml.Append("</li>");
            }
            return(strHtml.ToString());
        }
Exemplo n.º 14
0
        /// <summary>
        /// 数据字典主表
        /// </summary>
        public void GetTree()
        {
            List <BPMS_Items>  list    = IListHelper.IListToList <BPMS_Items>(bpms_itemsibll.GetList());
            IList <BPMS_Items> listnew = list.Distinct(new Comparint <BPMS_Items>("Category")).ToList();

            foreach (BPMS_Items entity in listnew)
            {
                strHtml.Append("<li>");
                strHtml.Append("<div>");
                strHtml.Append("<img src='/Themes/images/16/advancedsettings.png' style='vertical-align: middle;' alt=''/>" + entity.Category + "");
                strHtml.Append("</div>");
                strHtml.Append("<ul>");
                //创建子节点
                strHtml.Append(GetTreeNode(entity.Category, list));
                strHtml.Append("</ul>");
                strHtml.Append("</li>");
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// 创建子节点
        /// </summary>
        /// <param name="parentID">父节点主键</param>
        /// <param name="list">菜单集合</param>
        /// <returns></returns>
        public string GetTreeNode(string ParentId, IList list)
        {
            StringBuilder       sb_TreeNode = new StringBuilder();
            List <BPMS_SysMenu> itemNode    = IListHelper.IListToList <BPMS_SysMenu>(list).FindAll(t => t.ParentId == ParentId);

            if (itemNode.Count > 0)
            {
                sb_TreeNode.Append("<ul>");
                foreach (BPMS_SysMenu entity in itemNode)
                {
                    sb_TreeNode.Append("<li>");
                    sb_TreeNode.Append("<div id='" + entity.MenuId + "'>" + entity.FullName + "</div>");
                    //创建子节点
                    sb_TreeNode.Append(GetTreeNode(entity.MenuId, list));
                    sb_TreeNode.Append("</li>");
                }
                sb_TreeNode.Append("</ul>");
            }
            return(sb_TreeNode.ToString());
        }
Exemplo n.º 16
0
        /// <summary>
        /// 创建子节点
        /// </summary>
        /// <param name="parentID">父节点主键</param>
        /// <param name="list">菜单集合</param>
        /// <returns></returns>
        public string GetTreeNode(string ParentId, IList list)
        {
            StringBuilder            sb_TreeNode = new StringBuilder();
            List <BPMS_Organization> itemNode    = IListHelper.IListToList <BPMS_Organization>(list).FindAll(t => t.ParentId == ParentId);

            if (itemNode.Count > 0)
            {
                sb_TreeNode.Append("<ul>");
                foreach (BPMS_Organization entity in itemNode)
                {
                    sb_TreeNode.Append("<li title='" + entity.Category + "'>");
                    sb_TreeNode.Append("<div class='divTree' Category='" + entity.Category + "' id='" + entity.OrganizationId + "'><img src='/Themes/images/16/" + CategoryToImg(entity.Category) + "' style='vertical-align: middle;' alt=''/><span>" + entity.FullName + "</span></div>");
                    //创建子节点
                    sb_TreeNode.Append(GetTreeNode(entity.OrganizationId, list));
                    sb_TreeNode.Append("</li>");
                }
                sb_TreeNode.Append("</ul>");
            }
            return(sb_TreeNode.ToString());
        }
Exemplo n.º 17
0
        /// <summary>
        /// 初始化绑定下拉框
        /// </summary>
        public void InitBindDrop()
        {
            BPMS_ItemDetailsIBLL bpms_itemdetailsibll = new BPMS_ItemDetailsBLL();
            IList list = bpms_itemdetailsibll.GetList();
            //最高学历
            IList EducationList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "1559ff6d-8b04-48f7-952c-333305bc526d");

            ControlBindHelper.BindHtmlSelect(EducationList, Education, "ItemName", "ItemCode", "==请选择==");
            //最高学位
            IList DegreeList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "964d6a06-5282-4fcb-b805-f192ae0de922");

            ControlBindHelper.BindHtmlSelect(DegreeList, Degree, "ItemName", "ItemCode", "==请选择==");
            //职称
            IList TitleIdList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "2acba9e8-5fa7-4b6f-8ebd-56e753dd059a");

            ControlBindHelper.BindHtmlSelect(TitleIdList, TitleId, "ItemName", "ItemCode", "==请选择==");
            //职称等级
            IList TitleLevelList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "b65809f0-3b7b-44d1-b2f5-c93ef9afa12d");

            ControlBindHelper.BindHtmlSelect(TitleLevelList, TitleLevel, "ItemName", "ItemCode", "==请选择==");
            //职位
            IList DutyIdList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "137a2d97-d1d9-4752-9c5e-239097e2ed68");

            ControlBindHelper.BindHtmlSelect(DutyIdList, DutyId, "ItemName", "ItemCode", "==请选择==");
            //用工性质
            IList WorkingPropertyList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "0e08fdaa-8e7a-4890-98d5-e2f36f55c512");

            ControlBindHelper.BindHtmlSelect(WorkingPropertyList, WorkingProperty, "ItemName", "ItemCode", "==请选择==");
            //政治面貌
            IList PartyList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "44e210fb-5afd-4511-a56c-a438d947d5bc");

            ControlBindHelper.BindHtmlSelect(PartyList, Party, "ItemName", "ItemCode", "==请选择==");
            //国籍
            IList NationList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "e2e78aec-31f7-4de5-af7b-bb5bc7c09a61");

            ControlBindHelper.BindHtmlSelect(NationList, Nation, "ItemName", "ItemCode", "==请选择==");
            //民族
            IList NationalityList = IListHelper.IListToList <BPMS_ItemDetails>(list).FindAll(t => t.ItemsId == "104bfd21-5bbe-4b96-b5c2-448b84dbe0d8");

            ControlBindHelper.BindHtmlSelect(NationalityList, Nationality, "ItemName", "ItemCode", "==请选择==");
        }
Exemplo n.º 18
0
        /// <summary>
        /// 创建子节点
        /// </summary>
        /// <param name="parentID">父节点主键</param>
        /// <param name="list">菜单集合</param>
        /// <returns></returns>
        public string GeOrgtTreeNode(string ParentId, IList list, string[] array)
        {
            StringBuilder            sb_TreeNode = new StringBuilder();
            List <BPMS_Organization> itemNode    = IListHelper.IListToList <BPMS_Organization>(list).FindAll(t => t.ParentId == ParentId);

            if (itemNode.Count > 0)
            {
                sb_TreeNode.Append("<ul>");
                foreach (BPMS_Organization entity in itemNode)
                {
                    bool exists = ((IList)array).Contains(entity.OrganizationId);
                    sb_TreeNode.Append("<li title='" + entity.Category + "'>");
                    sb_TreeNode.Append("<input " + GetChecked(exists) + " style='vertical-align: middle;margin-bottom:2px;' type=\"checkbox\" value=\"" + entity.OrganizationId + "\" name=\"checkbox\" /><img src='/Themes/images/16/" + CategoryToImg(entity.Category) + "' style='vertical-align: middle;' alt=''/>" + entity.FullName + "");
                    //创建子节点
                    sb_TreeNode.Append(GeOrgtTreeNode(entity.OrganizationId, list, array));
                    sb_TreeNode.Append("</li>");
                }
                sb_TreeNode.Append("</ul>");
            }
            return(sb_TreeNode.ToString());
        }
Exemplo n.º 19
0
        /// <summary>
        /// 创建子节点
        /// </summary>
        /// <param name="parentID">父节点主键</param>
        /// <param name="list">菜单集合</param>
        /// <returns></returns>
        public string GetTreeNodeOrgChart(string ParentId, IList list)
        {
            StringBuilder            sb_TreeNode = new StringBuilder();
            List <BPMS_Organization> itemNode    = IListHelper.IListToList <BPMS_Organization>(list).FindAll(t => t.ParentId == ParentId);

            if (itemNode.Count > 0)
            {
                foreach (BPMS_Organization entity in itemNode)
                {
                    string itemid       = "v" + entity.OrganizationId.Replace("-", "");
                    string itemParentId = "v" + ParentId.Replace("-", "");
                    sb_TreeNode.Append("var " + itemid + " = new OrgNode();");
                    sb_TreeNode.Append("" + itemid + ".Text = \"" + entity.FullName + "\";");
                    sb_TreeNode.Append("" + itemid + ".Description = \"" + entity.ShortName + "\";");
                    //sb_TreeNode.Append("" + itemid + ".Link = \"#\";");
                    sb_TreeNode.Append("" + itemParentId + ".Nodes.Add(" + itemid + ");");
                    //创建子节点
                    sb_TreeNode.Append(GetTreeNodeOrgChart(entity.OrganizationId, list));
                }
            }
            return(sb_TreeNode.ToString());
        }
Exemplo n.º 20
0
        /// <summary>
        /// 创建子节点
        /// </summary>
        /// <param name="parentID">父节点主键</param>
        /// <param name="list">菜单集合</param>
        /// <returns></returns>
        public string GetTreeNode(string Category, IList list)
        {
            StringBuilder     sb_TreeNode = new StringBuilder();
            List <BPMS_Items> itemNode    = IListHelper.IListToList <BPMS_Items>(list).FindAll(t => t.Category == Category);

            foreach (BPMS_Items entity in itemNode)
            {
                if (index == 0)
                {
                    strclass = "collapsableselected";
                }
                else
                {
                    strclass = "";
                }
                sb_TreeNode.Append("<li>");
                sb_TreeNode.Append("<div title='" + entity.Code + "' class='" + strclass + "' id='" + entity.ItemsId + "'><img src='/Themes/images/16/wrench.png' style='vertical-align: middle;' alt=''/><span>" + entity.FullName + "</span></div>");
                sb_TreeNode.Append("</li>");
                index++;
            }
            return(sb_TreeNode.ToString());
        }
Exemplo n.º 21
0
        /// <summary>
        /// 子功能项
        /// </summary>
        /// <param name="ParentId">上级菜单主键</param>
        /// <returns></returns>
        public string Submenu(string ParentId)
        {
            StringBuilder sb_Submenu = new StringBuilder();
            string        UserId     = RequestSession.GetSessionUser().UserId;

            IList shortcut = bpms_shortcutibll.GetList(UserId);

            IList list = bpms_permissionibll.GetModulePermission(UserId);
            List <BPMS_ModulePermission> itemNode = IListHelper.IListToList <BPMS_ModulePermission>(list).FindAll(t => t.ParentId == ParentId);

            foreach (BPMS_ModulePermission entity in itemNode)
            {
                List <BPMS_ModulePermission> Isshortcut = IListHelper.IListToList <BPMS_ModulePermission>(shortcut).FindAll(t => t.MenuId == entity.MenuId);
                if (Isshortcut.Count == 0)
                {
                    sb_Submenu.Append("<div onclick=\"AddMenu('" + entity.MenuId + "')\" " + entity.Description + " class=\"shortcuticons\">");
                    sb_Submenu.Append("<img src=\"/Themes/Images/32/" + entity.Img + "\" alt=\"\" /><br />");
                    sb_Submenu.Append("" + entity.FullName + "");
                    sb_Submenu.Append("</div>");
                }
            }
            return(sb_Submenu.ToString());;
        }
Exemplo n.º 22
0
        //加载部门
        public void loadBind()
        {
            IList ListNotMember = bpms_userroleibll.GetListNotMember(_RoleId);
            IList list          = bpms_organizationibll.GetList();
            List <BPMS_Organization> itemNode = IListHelper.IListToList <BPMS_Organization>(list).FindAll(t => t.ParentId == _OrganizationId);
            int    index    = 0;
            string strclass = "";

            foreach (BPMS_Organization item in itemNode)
            {
                if (index == 0)
                {
                    strclass = "collapsableselected";
                }
                else
                {
                    strclass = "";
                }
                sbBranch.Append("<li><div class='" + strclass + "' id='" + item.OrganizationId + "'><img src='/Themes/images/16/wand.png' style='vertical-align: middle;' alt=''/>" + item.FullName + "</div></li>");
                NodeMember(ListNotMember, item.OrganizationId);
                index++;
            }
        }
Exemplo n.º 23
0
        /// <summary>
        /// 组织机构
        /// </summary>
        public string GetOrgTree(string RoleId, string AuthorizationItemValue)
        {
            BPMS_DataPermission datapermission = bpms_datapermissionibll.GetEntity(RoleId, AuthorizationItemValue);

            string[] array = new string[0];
            if (!string.IsNullOrEmpty(datapermission.ObjectId))
            {
                array = datapermission.ObjectId.Replace("'", "").Split(',');
            }
            StringBuilder            strHtml  = new StringBuilder();
            IList                    list     = bpms_datapermissionibll.GetOrganizationList();
            List <BPMS_Organization> itemNode = IListHelper.IListToList <BPMS_Organization>(list).FindAll(t => t.ParentId == "0");

            foreach (BPMS_Organization entity in itemNode)
            {
                strHtml.Append("<li>");
                bool exists = ((IList)array).Contains(entity.OrganizationId);
                strHtml.Append("<input " + GetChecked(exists) + " style='vertical-align: middle;margin-bottom:2px;' type=\"checkbox\" value=\"" + entity.OrganizationId + "\" name=\"checkbox\" /><img src='/Themes/images/16/house.png' style='vertical-align: middle;' alt=''/>" + entity.FullName + "");
                //创建子节点
                strHtml.Append(GeOrgtTreeNode(entity.OrganizationId, list, array));
                strHtml.Append("</li>");
            }
            return(strHtml.ToString());
        }
Exemplo n.º 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string MenuId = Session["SystemId"].ToString();//模块菜单ID
                string UserId = RequestSession.GetSessionUser().UserId;
                IList  list   = (IList)StorePermission.Instance.GetButtonPermission(UserId);
                List <BPMS_ButtonPermission> itemNode = IListHelper.IListToList <BPMS_ButtonPermission>(list).FindAll(t => t.MenuId == MenuId);

                sb_ButtonPermission.Append("<div class=\"tools_bar\">");
                int index = 0;
                if (itemNode.Count > 0)
                {
                    foreach (BPMS_ButtonPermission entity in itemNode)
                    {
                        if (entity.Category == "工具栏")
                        {
                            if (Strconditio != null)
                            {
                                foreach (string item in Strconditio)
                                {
                                    if (item == entity.Control_ID)
                                    {
                                        sb_ButtonPermission.Append("<a title=\"" + entity.Description + "\" onclick=\"" + entity.Event + ";\" class=\"tools_btn\"><span><b style=\"background: url('/Themes/images/16/" + entity.Img + "') 50% 4px no-repeat;\">" + entity.FullName + "</b></span></a>");
                                    }
                                }
                            }
                            else
                            {
                                sb_ButtonPermission.Append("<a title=\"" + entity.Description + "\" onclick=\"" + entity.Event + ";\" class=\"tools_btn\"><span><b style=\"background: url('/Themes/images/16/" + entity.Img + "') 50% 4px no-repeat;\">" + entity.FullName + "</b></span></a>");
                                if (entity.Split == "1")
                                {
                                    sb_ButtonPermission.Append("<div class=\"tools_separator\"></div>");
                                }
                            }
                        }
                        else if (entity.Category == "右击菜单栏")
                        {
                            sb_contextmenuItem.Append("{");
                            sb_contextmenuItem.Append("text: '" + entity.FullName + "',");
                            sb_contextmenuItem.Append("icon: '/Themes/images/16/" + entity.Img + "',");
                            sb_contextmenuItem.Append("action: function (target) {");
                            sb_contextmenuItem.Append(entity.Event);
                            sb_contextmenuItem.Append("}");
                            sb_contextmenuItem.Append("},");
                            index++;
                        }
                    }
                    if (index > 0)
                    {
                        sb_contextmenu.Append("$('#grid_paging').contextmenu({ items: [");
                        sb_contextmenu.Append(sb_contextmenuItem.ToString());
                        sb_contextmenu = sb_contextmenu.Remove(sb_contextmenu.Length - 1, 1);
                        sb_contextmenu.Append("] });");
                    }
                }
                else
                {
                    sb_ButtonPermission.Append("<a title=\"刷新当前页面\" onclick=\"Replace();\" class=\"tools_btn\"><span><b style=\"background: url('/Themes/images/16/arrow_refresh.png') 50% 4px no-repeat;\">刷新</b></span></a>");
                }
                sb_ButtonPermission.Append("</div>");
            }
        }
Exemplo n.º 25
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType     = "text/plain";
            context.Response.Buffer          = true;
            context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
            context.Response.AddHeader("pragma", "no-cache");
            context.Response.AddHeader("cache-control", "");
            context.Response.CacheControl = "no-cache";
            string                active                = HttpContext.Current.Request["action"];
            string                Account               = context.Request["Account"]; //账户
            string                Pwd                   = context.Request["Pwd"];     //密码
            string                code                  = context.Request["code"];    //验证码
            BPMS_UserIBLL         bpms_useribll         = new BPMS_UserBLL();
            BPMS_User             bpms_user             = new BPMS_User();
            BPMS_OrganizationIBLL bpms_organizationibll = new BPMS_OrganizationBLL();
            BPMS_Organization     bpms_organization     = new BPMS_Organization();
            BPMS_SysLogIBLL       bpms_syslogibll       = new BPMS_SysLogBLL();
            BPMS_IPBlacklistIBLL  bpms_ipblacklistibll  = new BPMS_IPBlacklistBLL();
            IPScanerHelper        objScan               = new IPScanerHelper();
            string                Msg                   = "";
            string                UserId                = "";

            switch (active)
            {
            case "login":    //登录
                #region 登录
                try
                {
                    string IPAddress = RequestHelper.GetIPAddress();
                    objScan.IP       = IPAddress;
                    objScan.DataPath = context.Server.MapPath("/Themes/IPScaner/QQWry.Dat");
                    string IPAddressName = objScan.IPLocation();
                    if (code.ToLower() != context.Session["dt_session_code"].ToString().ToLower())
                    {
                        Msg = "1";    //验证码输入不正确
                    }
                    else
                    {
                        //系统管理
                        if (Account == ConfigHelper.GetValue("CurrentUserName") && Md5Helper.MD5(Pwd, 32) == ConfigHelper.GetValue("CurrentPassword"))
                        {
                            SessionUser user = new SessionUser();
                            user.UserId         = "System";
                            user.Account        = "System";
                            user.UserName       = "******";
                            user.Gender         = "男";
                            user.Password       = bpms_user.Password;
                            user.Code           = "System";
                            user.DepartmentId   = "超级管理员";
                            user.DepartmentName = "超级管理员";
                            RequestSession.AddSessionUser(user);
                            Msg = "3";    //验证成功
                            bpms_syslogibll.AddSysLoginLog(bpms_user.Account, "登录成功", IPAddress, IPAddressName);
                        }
                        else
                        {
                            #region 验证
                            bpms_ipblacklistibll.TheIpIsRange(IPAddress);
                            string outmsg;
                            bpms_user = bpms_useribll.UserLogin(Account.Trim(), Pwd.Trim(), out outmsg);
                            if (outmsg != "-1")
                            {
                                if (outmsg == "succeed")
                                {
                                    if (bpms_user.Enabled == 1)
                                    {
                                        if (Islogin(context, Account.Trim()))
                                        {
                                            string DepartmentName = "";
                                            bpms_organization = bpms_organizationibll.GetEntity(bpms_user.DepartmentId);
                                            if (bpms_organization != null)
                                            {
                                                DepartmentName = bpms_organization.FullName;
                                            }
                                            SessionUser user = new SessionUser();
                                            user.UserId         = bpms_user.UserId;
                                            user.Account        = bpms_user.Account;
                                            user.UserName       = bpms_user.RealName;
                                            user.Gender         = bpms_user.Gender;
                                            user.Password       = bpms_user.Password;
                                            user.Code           = bpms_user.Code;
                                            user.Secretkey      = bpms_user.Secretkey;
                                            user.DepartmentId   = bpms_user.DepartmentId;
                                            user.DepartmentName = DepartmentName;
                                            user.RoleId         = bpms_user.RoleId;
                                            RequestSession.AddSessionUser(user);
                                            Msg = "3";    //验证成功
                                            bpms_syslogibll.AddSysLoginLog(bpms_user.Account, "登录成功", IPAddress, IPAddressName);
                                        }
                                        else
                                        {
                                            context.Response.Write("6");    //该用户已经登录,不允许重复登录
                                            context.Response.End();
                                        }
                                    }
                                    else
                                    {
                                        Msg = "2";    //账户锁定
                                        bpms_syslogibll.AddSysLoginLog(bpms_user.Account, "账户锁定", IPAddress, IPAddressName);
                                    }
                                }
                                else
                                {
                                    Msg = "4";    //账户或者密码有错误
                                    bpms_syslogibll.AddSysLoginLog(bpms_user.Account, "登录失败", IPAddress, IPAddressName);
                                }
                            }
                            else
                            {
                                Msg = DbErrorMsg.ReturnMsg;    //服务连接不上
                            }
                            #endregion
                        }
                    }
                }
                catch (Exception ex)
                {
                    Msg = ex.Message;
                }
                context.Response.Write(Msg);
                context.Response.End();
                #endregion
                break;

            case "Outlogin":    //安全退出
                UserId = RequestSession.GetSessionUser().UserId;
                CacheHelper.RemoveAllCache("Module" + UserId);
                CacheHelper.RemoveAllCache("Button" + UserId);
                CacheHelper.RemoveAllCache("Data" + UserId);
                context.Session.Abandon();      //取消当前会话
                context.Session.Clear();        //清除当前浏览器所以Session
                context.Response.Write("1");
                context.Response.End();
                break;

            case "LoadFirstMenu":
                UserId = RequestSession.GetSessionUser().UserId;
                IList list = (IList)StorePermission.Instance.GetModulePermission(UserId);
                context.Response.Write(JsonHelper.DropToJson <BPMS_ModulePermission>(list, "JSON"));
                context.Response.End();
                break;

            case "SetSystemId":                                //模块ID、访问模块
                UserId = RequestSession.GetSessionUser().UserId;
                string SystemId = context.Request["SystemId"]; //模块ID
                List <BPMS_ModulePermission> Modulelist = IListHelper.IListToList <BPMS_ModulePermission>((IList)StorePermission.Instance.GetModulePermission(UserId)).FindAll(t => t.MenuId == SystemId);
                foreach (BPMS_ModulePermission entity in Modulelist)
                {
                    BPMS_SysLogDAL.Instance.AddVisitLog(UserId, RequestSession.GetSessionUser().UserName, entity.FullName, "URL:" + entity.NavigateUrl);
                    break;
                }
                //写入Session
                context.Session["SystemId"] = SystemId;
                context.Response.Write(SystemId);
                context.Response.End();
                break;

            case "LeaveModule":    //离开模块
                break;

            default:
                break;
            }
        }