コード例 #1
0
ファイル: TabsPermission.aspx.cs プロジェクト: ben889/myb2b
        protected void rpTabslistbind()
        {
            DataTable dt      = BLL.TabsBLL.GetDataTable();// TabsController.GetListTabs("", where);
            ArrayList arrlist = new BLL.TabsBLL().MakeTree2(dt, "ParentID", "0", "TabID", "TabName", -1);

            rpTabslist.DataSource = arrlist;
            rpTabslist.DataBind();
            ViewState["moveid"] = null;
        }
コード例 #2
0
ファイル: DataInit.cs プロジェクト: ben889/myb2b
        public DataInit()
        {
            TabsBLL.updateSystem_updatetabs();
            RolesBLL.init();
            UsersBLL.InitUsers(null);

            TabsBLL.updateSystem_updatetabs();
            //初始化广告位
            AdPositionBLL.init();
            //商品分类初始化
            //ProductTypeBLL.init();
            memberBLL.init();
        }
コード例 #3
0
ファイル: RolesBLL.cs プロジェクト: ben889/myb2b
        public static void init()
        {
            int        roleid_company = (int)Common.enumUserType.company;
            int        roleid_person  = (int)Common.enumUserType.person;
            List <int> listid         = new List <int>();

            listid.Add(roleid_company);
            listid.Add(roleid_person);
            //BLL.UserRolesBLL.Delete("");
            //Delete("");
            for (int i = 0; i < listid.Count; i++)
            {
                int    roleid     = listid[i];
                string RoleName   = Common.EnumHelper.GetEnumDescription(typeof(Common.enumUserType), roleid);
                string tabs_where = "";
                if (roleid == (int)Common.enumUserType.company)
                {
                    tabs_where = "TabKey not in('withdraw_cash')";
                }
                else if (roleid == (int)Common.enumUserType.person)
                {
                    tabs_where = "TabKey not in('withdraw_cash')";
                }
                Model.RoleInfo roleinfo = BLL.RolesBLL.GetModel(roleid);
                if (roleinfo == null || roleinfo.RoleID != roleid)
                {
                    roleinfo             = new Model.RoleInfo();
                    roleinfo.RoleID      = roleid;
                    roleinfo.RoleName    = RoleName;
                    roleinfo.Description = "";
                    roleinfo.IconFile    = "";
                    int addroleresult = BLL.RolesBLL.Add(roleinfo);
                }
                if (roleinfo.RoleID == roleid)
                {
                    //重新删除后再添加对应的权限
                    TabPermissionBLL.Delete("roleid=" + roleid);// .DeleteTabPermissionByRoleID(roleid);
                    List <TabsInfo> tabslist = TabsBLL.GetList(-1, tabs_where, "");
                    if (tabslist != null)
                    {
                        foreach (TabsInfo tabsInfo in tabslist)
                        {
                            if (tabsInfo == null || tabsInfo.TabID <= 0)
                            {
                                continue;
                            }
                            List <PermissionInfo> list = PermissionBLL.GetList(-1, "PermissionCode='SYSTEM_TAB' AND (TabID=0 OR TabID is NULL or TabID=" + tabsInfo.TabID + ")", "");
                            if (list == null || list.Count == 0)
                            {
                                continue;
                            }
                            foreach (PermissionInfo info in list)
                            {
                                //PermissionBLL.UpdateTabPermissionByRoleID(tabsInfo.TabID, info.PermissionID, roleid, 0, 0, 0);
                                TabPermissionInfo tabpinfo = new TabPermissionInfo();
                                tabpinfo.TabID        = tabsInfo.TabID;
                                tabpinfo.RoleID       = roleid;
                                tabpinfo.PermissionID = info.PermissionID;
                                TabPermissionBLL.Save(tabpinfo);
                            }
                        }
                    }
                }
            }
        }