private void Data4_AfterData(object sender, EventArgs e)
        {
            string    runNumber     = (string)Report.GetColumnValue("ARTransactions.RunNumber");
            SmartDate tranDate      = (SmartDate)Report.GetColumnValue("ARTransactions.TransactionDate");
            string    tranMonthYear = tranDate.ToString("yyyyMM");

            //MessageBox.Show(tranMonthYear + "  " + runNumber);

            if (!runs.ContainsKey(runNumber))
            {
                runs.Add(runNumber, tranMonthYear);
            }
        }
        private void SetMyValue(string text, bool updateBaseValue)
        {
            var tempdate = new SmartDate(true);

            if (SmartDate.TryParse(text, SmartDate.EmptyValue.MinDate, ref tempdate))
            {
                if (tempdate.CompareTo(_mySmartDate) != 0)
                {
                    _mySmartDate.Text = tempdate.ToString(_customFormat);
                }
            }
            UpdateMyTextBox();
            if (updateBaseValue)
            {
                SetBaseValue();
            }
        }
        private void Data3_AfterData(object sender, EventArgs e)
        {
            string run  = (string)Report.GetColumnValue("ARTransactions.RunNumber");
            int    arID = (int)Report.GetColumnValue("ARTransactions.ARTransactionId");

            czCode = (string)Report.GetColumnValue("ARTransactions.ChargeZoneCode");
            string    cbCode        = (string)Report.GetColumnValue("ARTransactions.CompanyBranchCode");
            SmartDate smartTranDate = (SmartDate)Report.GetColumnValue("ARTransactions.TransactionDate");
            string    tranDate      = smartTranDate.ToString("yyyyMM");

            //tranDateCounts
            if (!tranDateCounts.ContainsKey(czCode))
            {
                tranDateCounts.Add(czCode, new System.Collections.Generic.Dictionary <string, System.Collections.Generic.Dictionary <int, string> >());
                tranDateCounts[czCode].Add(cbCode, new System.Collections.Generic.Dictionary <int, string>());
                tranDateCounts[czCode][cbCode].Add(arID, tranDate);
            }
            else
            {
                if (!tranDateCounts[czCode].ContainsKey(cbCode) /* && !distinctRuns.Contains(run)*/)
                {
                    tranDateCounts[czCode].Add(cbCode, new System.Collections.Generic.Dictionary <int, string>());
                    tranDateCounts[czCode][cbCode].Add(arID, tranDate);
                }
                else
                {
                    if (!tranDateCounts[czCode][cbCode].ContainsKey(arID) && !distinctRuns.Contains(run))
                    {
                        tranDateCounts[czCode][cbCode].Add(arID, tranDate);
                    }
                }
            }
            //czCounts
            if (!czCounts.ContainsKey(czCode))
            {
                czCounts.Add(czCode, 1);
            }
            else
            {
                if (!distinctRuns.Contains(run))
                {
                    czCounts[czCode]++;
                }
            }
            //cbCounts
            if (!cbCounts.ContainsKey(czCode))
            {
                cbCounts.Add(czCode, new System.Collections.Generic.Dictionary <string, int>());
                cbCounts[czCode].Add(cbCode, 1);
            }
            else
            {
                if (!cbCounts[czCode].ContainsKey(cbCode) && !distinctRuns.Contains(run))
                {
                    cbCounts[czCode].Add(cbCode, 1);
                }
                else
                {
                    if (!distinctRuns.Contains(run))
                    {
                        cbCounts[czCode][cbCode]++;
                    }
                }
            }
            //cpCounts
            if (!companyCounts.ContainsKey(companyCode))
            {
                companyCounts.Add(companyCode, 1);
            }
            else
            {
                if (!distinctRuns.Contains(run))
                {
                    companyCounts[companyCode]++;
                }
            }
            //update distinctRuns
            if (!distinctRuns.Contains(run))
            {
                distinctRuns.Add(run);
            }
            //Money
            if (!chargesPreviousPeriod.ContainsKey(czCode))
            {
                chargesPreviousPeriod.Add(czCode, getPreviousChargesfromDB(czCode, startDate, companyCode));
            }
            if (!paymentsPreviousPeriod.ContainsKey(czCode))
            {
                paymentsPreviousPeriod.Add(czCode, getPreviousPaymentsfromDB(czCode, startDate, companyCode));
            }
            if (!writeOffsPreviousPeriod.ContainsKey(czCode))
            {
                writeOffsPreviousPeriod.Add(czCode, getPreviousWriteOffsfromDB(czCode, startDate, companyCode));
            }
            if (!badDebtPreviousPeriod.ContainsKey(czCode))
            {
                badDebtPreviousPeriod.Add(czCode, getPreviousBadDebtfromDB(czCode, startDate, companyCode));
            }
            if (!refundsPreviousPeriod.ContainsKey(czCode))
            {
                refundsPreviousPeriod.Add(czCode, getPreviousRefundsfromDB(czCode, startDate, companyCode));
            }
            if (!revenueAdjustmentsPreviousPeriod.ContainsKey(czCode))
            {
                revenueAdjustmentsPreviousPeriod.Add(czCode, getPreviousRevenueAdjustmentsfromDB(czCode, startDate, companyCode));
            }
            if (!chargeAdjustmentsPreviousPeriod.ContainsKey(czCode))
            {
                chargeAdjustmentsPreviousPeriod.Add(czCode, getPreviousChargeAdjustmentsfromDB(czCode, startDate, companyCode));
            }
            if (!czTotalPreviousPeriod.ContainsKey(czCode))
            {
                czTotalPreviousPeriod.Add(czCode, getPreviousCZTotalfromDB(czCode, startDate, companyCode));
            }
            if (!monthTotalPreviousPeriod.ContainsKey(czCode + "-" + tranDate))
            {
                monthTotalPreviousPeriod.Add(czCode + "-" + tranDate, getPreviousMonthTotalfromDB(czCode, DateTime.ParseExact(tranDate + "01", "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture), companyCode));
            }
        }