コード例 #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="LoginController" /> class.
        /// </summary>
        public LoginController()
        {
            try
            {
                this.it2Business = new DailyClosingIt2Manager();
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }

            this.officeIt2Manager = new OfficeIt2Manager();
        }
コード例 #2
0
        public Stream GetReportContent(string officeId, int dayCloseId)
        {
            var dayClose = this.it2Business.GetReportContent(officeId, dayCloseId);

            dayClose.Details = dayClose.Details.OrderBy(x => x.PaymentTypeString).ToList();
            var report = ReportFactory.CreateReportWithManualDispose <DailyClosingReport>();

            // This will be disposed when the report has been streamed.
            report.SetDataSource(dayClose.Details);

            var office = this.it2Business.GetOfficeById(officeId);

            report.SetParameterValue("Store", office.ID + " " + office.Name);
            report.SetParameterValue("Phone", office.FormattedPhoneNumber);
            report.SetParameterValue("Date", dayClose.TransactionDate);
            report.SetParameterValue("Employee", this.it2Business.GetEmployeeFullName(dayClose.EmployeeId));
            report.SetParameterValue("ClosingTime", dayClose.CloseTime);

            var refunds = this.it2Business.GetTotalCashRefund(dayClose.ID);

            report.SetParameterValue("RefundQuantity", refunds[1]);
            report.SetParameterValue("RefundAmount", refunds[0]);

            var coupon = this.it2Business.GetTotalCoupon(dayClose.ID);

            report.SetParameterValue("CouponQuantity", coupon[1]);
            report.SetParameterValue("CouponAmount", coupon[0]);

            var check = this.it2Business.GetTotalChecks(dayClose.ID);

            report.SetParameterValue("CheckQuantity", check[1]);
            report.SetParameterValue("CheckAmount", check[0]);

            var insurancePayments = new DailyClosingIt2Manager().GetDailyCarrierPayments(office.Company.ID, dayClose.TransactionDate);
            var payments          = insurancePayments.ToList();

            report.SetParameterValue("InsuranceChecks", payments[0].Actual);
            report.SetParameterValue("InsuranceEFT", payments[1].Actual);

            var ms = report.ExportToStream(ExportFormatType.PortableDocFormat);

            // report has been streamed, it is safe to dispose it
            ReportFactory.CloseAndDispose(report);

            return(ms);
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DailyClosingController"/> class.
 /// </summary>
 public DailyClosingController()
 {
     this.it2Business = new DailyClosingIt2Manager();
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DailyClosingController"/> class.
 /// </summary>
 /// <param name="it2Business">
 /// The it 2 business.
 /// </param>
 public DailyClosingController(DailyClosingIt2Manager it2Business)
 {
     this.it2Business = it2Business;
 }