コード例 #1
0
        public static JournalList LoadEntries(List<FinanceAccessParams> accessParams, List<short> typeIDs,
            DateTime startDate, DateTime endDate, string nameProfile)
        {
            JournalList retVal = new JournalList();

            EMMADataSet.JournalDataTable table = LoadEntriesData(accessParams, typeIDs, startDate, endDate, nameProfile);

            Diagnostics.StartTimer("Journal.LoadEntries.BuildList");
            foreach (EMMADataSet.JournalRow row in table)
            {
                // We need to build the journal rows differently depending on who the owner is...
                long sOwner = 0, rOwner = 0;
                foreach (FinanceAccessParams access in accessParams)
                {
                    if ((access.OwnerID == row.SenderID && sOwner == 0) || access.OwnerID == row.SCorpID)
                    {
                        sOwner = access.OwnerID;
                    }
                    if ((access.OwnerID == row.RecieverID && rOwner == 0) || access.OwnerID == row.RCorpID)
                    {
                        rOwner = access.OwnerID;
                    }
                }

                if (rOwner != 0) { retVal.Add(new JournalEntry(row, rOwner)); }
                if (sOwner != 0) { retVal.Add(new JournalEntry(row, sOwner)); }
            }
            Diagnostics.StopTimer("Journal.LoadEntries.BuildList");
            return retVal;
        }