Esempio n. 1
0
        public void PostLedger()
        {
            var unPostTransactions = this.ReadyForPost;

            string logTitle = string.Format("> Post {0} [{1}]", this.trString, unPostTransactions.Count());

            organization.EventLogs.NewEventLog(EventLogLevel.Information, "00", logTitle, null, "");

            erpNodeDBContext.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;

            using (var progress = new Helpers.ProgressBar())
            {
                var currentIndex = 0;

                unPostTransactions.ForEach(s =>
                {
                    progress.Report(currentIndex++, unPostTransactions.Count);
                    this.PostLedger(s, false);
                });
            }

            erpNodeDBContext.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.TrackAll;
            erpNodeDBContext.ChangeTracker.DetectChanges();
            erpNodeDBContext.SaveChanges();
        }
Esempio n. 2
0
        public void GenerateHistoryBalance()
        {
            Console.WriteLine("> {0} Generate History Balance", DateTime.Now.ToLongTimeString());
            this.ClearBalanceHistory();
            DateTime Today = DateTime.Today.Date;

            var accounts = erpNodeDBContext.Accounts.ToList();

            using (var progress = new Helpers.ProgressBar())
            {
                var currentIndex = 0;
                accounts.ForEach(account =>
                {
                    progress.Report(currentIndex++, accounts.Count);
                    this.GenerateHistoryBalance(account);
                });
            }
        }