コード例 #1
0
ファイル: UcMenuNavigation.ascx.cs プロジェクト: eleooo/App
 private string GetLeftMenuItemIconImage(SysNavigation nav)
 {
     if (string.IsNullOrEmpty(nav.NavIcon))
         return string.Empty;
     else
         return string.Format(SEC_IMAGE, nav.NavIcon);
 }
コード例 #2
0
ファイル: ActionPage.cs プロジェクト: eleooo/App
        public virtual SysNavigation RenderNav(SysNavigation item, MenuRegion region)
        {
            if (region == MenuRegion.Main)
            {
                if (string.IsNullOrEmpty(item.OthName))
                    item.NavName = item.SecName;
                else
                    item.NavName = item.OthName;
                if (Utilities.Compare(item.NavUrl, "/Company/CompanyItemEdit.aspx") && AppContext.CurrentSysId == (int)SubSystem.Company)
                {
                    var t = CompanyBLL.GetCompanyTypeById(AppContext.Context.User.CompanyId.Value);
                    if (t == CompanyType.AdCompany)
                    {
                        item.NavUrl = "/Company/CompanyAdsClicked.aspx";
                    }
                    else if (t == CompanyType.SpecialCompany)
                    {
                        item.NavUrl = "/Company/CompanyItemUsed.aspx";
                    }
                }
            }

            return item;
        }
コード例 #3
0
ファイル: SysNavigationController.cs プロジェクト: eleooo/App
        public void Insert(string NavName,string SecName,string OthName,string NavUrl,string NavIcon,int? SubSysId,int? PId,bool IsMainNav,bool IsHeader,bool IsFooter,bool PermissionRequired,int Sort,bool Visible,string Depth,int? CreatedBy,DateTime? CreatedOn,int? ModifiedBy,DateTime? ModifiedOn)
        {
            SysNavigation item = new SysNavigation();

            item.NavName = NavName;

            item.SecName = SecName;

            item.OthName = OthName;

            item.NavUrl = NavUrl;

            item.NavIcon = NavIcon;

            item.SubSysId = SubSysId;

            item.PId = PId;

            item.IsMainNav = IsMainNav;

            item.IsHeader = IsHeader;

            item.IsFooter = IsFooter;

            item.PermissionRequired = PermissionRequired;

            item.Sort = Sort;

            item.Visible = Visible;

            item.Depth = Depth;

            item.CreatedBy = CreatedBy;

            item.CreatedOn = CreatedOn;

            item.ModifiedBy = ModifiedBy;

            item.ModifiedOn = ModifiedOn;

            item.Save(UserName);
        }
コード例 #4
0
ファイル: NavigationBLL.cs プロジェクト: eleooo/App
 private static void RefreshNavCore(ref List<NavigationDefineAttribute> navDefines,
                                    ref SysNavigationCollection navs,
                                    NavigationDefineAttribute navDefine,
                                    SysNavigation nav)
 {
     string navUrl = navDefine == null ? string.Empty : navDefine.NavUrl;
     List<NavigationDefineAttribute> partNavDefines = FindNavDefinesByUrl(ref navDefines, navUrl);
     if (partNavDefines.Count == 0 && navDefine == null && nav == null)
     {
         partNavDefines = navDefines;
     }
     foreach (NavigationDefineAttribute partNav in partNavDefines)
     {
         //not exist item and new item to navs
         SysNavigation cNav = FindNavByUrl(navs, partNav.NavUrl);
         if (cNav == null)
         {
             SysNavigation pNav = FindNavByUrl(navs, partNav.P_NavUrl);
             cNav = AddNewNavigation(partNav, pNav == null ? nav : pNav);
             AutoRoleAssignement(cNav);
             //?
             navs.Add(cNav);
         }
         RefreshNavCore(ref navDefines, ref navs, partNav, cNav);
     }
 }
コード例 #5
0
ファイル: NavigationBLL.cs プロジェクト: eleooo/App
 private static void AutoRoleAssignement(SysNavigation nav)
 {
     int roleDefine = UserBLL.GetDefaultUseRole(nav.SubSysId.Value);
     SysRoleAssignment ass = DB.Select( ).From<SysRoleAssignment>( )
                   .Where(SysRoleAssignment.NavIDColumn).IsEqualTo(nav.Id)
                   .And(SysRoleAssignment.RoleIDColumn).IsEqualTo(roleDefine)
                   .ExecuteSingle<SysRoleAssignment>( );
     if (ass == null)
     {
         new SysRoleAssignment
         {
             NavID = nav.Id,
             RoleID = roleDefine,
             Allow = true
         }.Save( );
     }
 }
コード例 #6
0
ファイル: NavigationBLL.cs プロジェクト: eleooo/App
 private static SysNavigation AddNewNavigation(NavigationDefineAttribute navDefine, SysNavigation pNav)
 {
     int nPID = 0;
     string sDepth = "/";
     if (pNav != null)
     {
         nPID = Utilities.ToInt(pNav.Id);
         sDepth = pNav.Depth;
     }
     SysNavigation cNav = new SysNavigation( )
     {
         IsFooter = navDefine.IsFooter,
         IsHeader = navDefine.IsHeader,
         IsMainNav = navDefine.IsMainNav,
         NavName = navDefine.NavName,
         NavUrl = navDefine.NavUrl,
         PId = nPID,
         PermissionRequired = navDefine.PermissionRequired,
         SecName = navDefine.SecName,
         OthName = navDefine.OthName,
         SubSysId = Convert.ToInt32(navDefine.SubSys),
         Visible = true,
         Sort = 0,
         Depth = "/",
         NavIcon = navDefine.NavIcon
     };
     cNav.Save(AppContextBase.CurrentUserID);
     cNav.Sort = cNav.Id;
     cNav.Depth = string.Concat(sDepth, cNav.Id, "/");
     cNav.Save( );
     return cNav;
 }