예제 #1
0
 static private FixedList <Account> RestrictLedger(string ledger, FixedList <Account> accounts)
 {
     if (ledger.Length == 0)
     {
         return(accounts);
     }
     return(accounts.FindAll(x => x.LedgerRules.Contains(y => y.Ledger.UID == ledger)));
 }
        static internal FixedList <SectorRule> GetAccountSectorRules(Account account)
        {
            var list = _sectorRules.FindAll(x => x.StandardAccountId == account.StandardAccountId);

            list.Sort((x, y) => x.Sector.Code.CompareTo(y.Sector.Code));

            return(list);
        }
예제 #3
0
        static internal FixedList <AreaRule> GetAccountAreasRules(Account account)
        {
            var list = _areasRules.FindAll(x => x.StandardAccountId == account.StandardAccountId);

            list.Sort((x, y) => x.StandardAccountId.CompareTo(y.StandardAccountId));

            return(list);
        }
        static internal FixedList <LedgerRule> GetAccountLedgerRules(Account account)
        {
            var list = _ledgersRules.FindAll(x => x.StandardAccountId == account.StandardAccountId);

            list.Sort((x, y) => x.Ledger.Number.CompareTo(y.Ledger.Number));

            return(list);
        }
예제 #5
0
 static private FixedList <Account> RestrictLevels(int level, FixedList <Account> accounts)
 {
     if (level > 0)
     {
         return(accounts.FindAll(x => x.Level <= level));
     }
     else
     {
         return(accounts);
     }
 }
예제 #6
0
        static private FixedList <Account> RestrictSectors(string[] sectors, FixedList <Account> accounts)
        {
            if (sectors.Length == 0)
            {
                return(accounts);
            }
            var restricted = accounts.FindAll(acct => acct.SectorRules.Contains(acctSector => acctSector.Sector.UID == sectors[0]));

            for (int i = 1; i < sectors.Length; i++)
            {
                var temp = restricted.FindAll(acct => acct.SectorRules.Contains(acctSector => acctSector.Sector.UID == sectors[i]));
                restricted = restricted.Intersect(temp);
            }
            return(restricted);
        }
예제 #7
0
        public CollectionModel GetAllProjectFiles()
        {
            try {
                FixedList <Posting> list = PostingList.GetPostings("ProjectItem.MediaFile");

                var projects = UserProjectSecurity.GetUserProjectFixedList();

                list = list.FindAll(x => projects.Exists(y => y.Id == x.GetNodeObjectItem <ProjectItem>().Project.Id));

                return(new CollectionModel(this.Request, list.ToProjectItemFileResponse(),
                                           typeof(FormerMediaFile).FullName));
            } catch (Exception e) {
                throw base.CreateHttpException(e);
            }
        }
예제 #8
0
        static private FixedList <Account> RestrictCurrencies(string[] currencies, FixedList <Account> accounts)
        {
            if (currencies.Length == 0)
            {
                return(accounts);
            }

            var restricted = accounts.FindAll(acct => acct.CurrencyRules.Contains(acctCurcy => acctCurcy.Currency.UID == currencies[0]));

            for (int i = 1; i < currencies.Length; i++)
            {
                var temp = restricted.FindAll(acct => acct.CurrencyRules.Contains(acctCurcy => acctCurcy.Currency.UID == currencies[i]));
                restricted = restricted.Intersect(temp);
            }

            return(restricted);
        }