protected override object CalcExpression(string expression, Variant Value)
 {
     if (expression == "ToBoolean([OPU.卵巢左])")
     {
         return(ToBoolean(((String)Report.GetColumnValue("OPU.卵巢左"))));
     }
     if (expression == "ToBoolean([OPU.卵巢右])")
     {
         return(ToBoolean(((String)Report.GetColumnValue("OPU.卵巢右"))));
     }
     return(null);
 }
예제 #2
0
 protected override object CalcExpression(string expression, Variant Value)
 {
     if (expression == "Orders.Customers.CompanyName")
     {
         return((String)Report.GetColumnValue("Orders.Customers.CompanyName"));
     }
     if (expression == "Order Details.Products.ProductName")
     {
         return((String)Report.GetColumnValue("Order Details.Products.ProductName"));
     }
     if (expression == "[Order Details.UnitPrice] * [Order Details.Quantity]")
     {
         return(((Decimal)Report.GetColumnValue("Order Details.UnitPrice")) * ((Int16)Report.GetColumnValue("Order Details.Quantity")));
     }
     return(null);
 }
예제 #3
0
 protected override object CalcExpression(string expression, Variant Value)
 {
     if (expression == "[Products.ProductName].Substring(0,1)")
     {
         return(((String)Report.GetColumnValue("Products.ProductName")).Substring(0, 1));
     }
     if (expression == "[Row#] % 2 == 0")
     {
         return(((Int32)Report.GetParameterValue("Row#")) % 2 == 0);
     }
     return(null);
 }
예제 #4
0
 /// <inheritdoc/>
 public override void GetData()
 {
     base.GetData();
     if (!String.IsNullOrEmpty(DataColumn))
     {
         object  value    = Report.GetColumnValue(DataColumn);
         Variant varValue = value == null ? new Variant(0) : new Variant(value);
         Checked = varValue == true || (varValue.IsNumeric && varValue != 0);
     }
     else if (!String.IsNullOrEmpty(Expression))
     {
         object value = Report.Calc(Expression);
         Checked = value is bool && (bool)value == true;
     }
     if (!Checked && HideIfUnchecked)
     {
         Visible = false;
     }
 }
        private void Data5_AfterData(object sender, EventArgs e)
        {
            string name = ((String)Report.GetColumnValue("Selections.Property.Name"));

            if (name == "Transaction Date")
            {
                ComparisonOperator op = ((ComparisonOperator)Report.GetColumnValue("Selections.ComparisonOperator"));
                if (op == ComparisonOperator.GreaterThanOrEqual || op == ComparisonOperator.GreaterThan)
                {
                    Report.SetParameterValue("StartDate", new SmartDate(((string)Report.GetColumnValue("Selections.ValueAsString"))).Date);
                }
                if (op == ComparisonOperator.LessThanOrEqual || op == ComparisonOperator.LessThan)
                {
                    Report.SetParameterValue("EndDate", new SmartDate(((string)Report.GetColumnValue("Selections.ValueAsString"))).Date);
                }
            }

            if (name == "Company Code")
            {
                Report.SetParameterValue("CompanyCode", ((Object)Report.GetColumnValue("Selections.Value")));
            }
        }
        private bool CanShow()
        {
            SetReportVariables();
            if (collectionType != UserSelection_Collections && collectionType != UserSelection_NonCollection)
            {
                return(true);
            }

            string payerGroupCode = ((String)Report.GetColumnValue("ARTransactions.CurrentPayerGroupCodeWhenEntered"));

            //User Chose Collections - Only Show if current payer is Collections
            if (payerGroupCode == CollectionsPayerGroup && collectionType == UserSelection_Collections)
            {
                return(true);
            }
            //User Chose Non-Collections - Only show if the current payer is Non-Collections
            else if (payerGroupCode != CollectionsPayerGroup && collectionType == UserSelection_NonCollection)
            {
                return(true);
            }

            return(false);
        }
        private void Data1_AfterData(object sender, EventArgs e)
        {
            string name = ((String)Report.GetColumnValue("Selections.Property.Name"));

            if (name == "Transaction Date")
            {
                ComparisonOperator op = ((ComparisonOperator)Report.GetColumnValue("Selections.ComparisonOperator"));
                if (op == ComparisonOperator.GreaterThanOrEqual)
                {
                    Report.SetParameterValue("StartDate", new SmartDate(((string)Report.GetColumnValue("Selections.ValueAsString"))).Date);
                    startDate = ((DateTime)Report.GetParameterValue("StartDate"));
                }
                if (op == ComparisonOperator.LessThanOrEqual)
                {
                    Report.SetParameterValue("EndDate", new SmartDate(((string)Report.GetColumnValue("Selections.ValueAsString"))).Date);
                }
            }

            if (name == "Company Code")
            {
                companyCode = (string)Report.GetColumnValue("Selections.Value");
            }
            //MessageBox.Show(startDate.ToString() + "  " + companyCode);

            if (!System.String.IsNullOrEmpty(companyCode) && (startDate != System.DateTime.MinValue))
            {
                //MessageBox.Show(startDate.ToString() + "  " + companyCode + " in if statement");
                varChargesPreviousPeriod            = getPreviousChargesfromDB(companyCode, startDate);
                varPaymentsPreviousPeriod           = getPreviousPaymentsfromDB(companyCode, startDate);
                varWriteOffsPreviousPeriod          = getPreviousWriteOffsfromDB(companyCode, startDate);
                varBadDebtPreviousPeriod            = getPreviousBadDebtfromDB(companyCode, startDate);
                varRefundsPreviousPeriod            = getPreviousRefundsfromDB(companyCode, startDate);
                varRevenueAdjustmentsPreviousPeriod = getPreviousRevenueAdjustmentsfromDB(companyCode, startDate);
                varChargeAdjustmentsPreviousPeriod  = getPreviousChargeAdjustmentsfromDB(companyCode, startDate);
                varTotalPreviousPeriod = getPreviousTotalfromDB(companyCode, startDate);
            }
        }
        private void Data1_AfterData(object sender, EventArgs e)
        {
            string name = ((String)Report.GetColumnValue("Selections.Property.Name"));

            if (name == "Transaction Date")
            {
                ComparisonOperator op = ((ComparisonOperator)Report.GetColumnValue("Selections.ComparisonOperator"));
                if (op == ComparisonOperator.GreaterThanOrEqual)
                {
                    Report.SetParameterValue("StartDate", new SmartDate(((string)Report.GetColumnValue("Selections.ValueAsString"))).Date);
                }
                if (op == ComparisonOperator.LessThanOrEqual)
                {
                    Report.SetParameterValue("EndDate", new SmartDate(((string)Report.GetColumnValue("Selections.ValueAsString"))).Date);
                }
                startDate = ((DateTime)Report.GetParameterValue("StartDate"));
            }

            if (name == "Company Code")
            {
                companyCode = (string)Report.GetColumnValue("Selections.Value");
            }
            //MessageBox.Show(startDate.ToString() + "  " + companyCode);
        }
        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));
            }
        }
 public double getAverageBE()
 {
     if ((InitialBilledDate((string)Report.GetColumnValue("TripTickets.RunNumber")).ToString("MM-dd-yyyy") == "01-01-0001" || ((SmartDate)Report.GetColumnValue("TripTickets.EnteredDate")) == "0001-01-01"))
     {
         return(0);
     }
     else
     {
         DateTime billedDate  = (InitialBilledDate((string)Report.GetColumnValue("TripTickets.RunNumber")));
         DateTime enteredDate = ((SmartDate)Report.GetColumnValue("TripTickets.EnteredDate"));
         enteredDate.ToString("yyyy-MM-dd");
         TimeSpan diff = billedDate.Date - enteredDate.Date;
         if (diff.Days < 0)
         {
             return(0);
         }
         else
         {
             totalEntDays = 0;
             DaysBetweenBilledAndPaid(billedDate, paidDate);
             Report.SetParameterValue("TotalEntDays", totalEntDays);
             avgDays = (totalEntDays / (double)Report.GetTotalValue("TotalTickets"));
             return(avgDays);
         }
     }
 }