Ejemplo n.º 1
0
        private void PrintFinanceReport(ReportViewer rptViewer)
        {
            IACDataSet ReportData = new IACDataSet();

            IACDataSetTableAdapters.OPNCUSTTableAdapter  OPNCUSTTableAdapter  = new IACDataSetTableAdapters.OPNCUSTTableAdapter();
            IACDataSetTableAdapters.OPNDEALRTableAdapter OPNDEALRTableAdapter = new IACDataSetTableAdapters.OPNDEALRTableAdapter();
            IACDataSetTableAdapters.StatementCustomerHeaderTableAdapter StatementCustomerHeaderTableAdapter = new IACDataSetTableAdapters.StatementCustomerHeaderTableAdapter();
            IACDataSetTableAdapters.StatementDealerSummaryTableAdapter  StatementDealerSummaryTableAdapter  = new IACDataSetTableAdapters.StatementDealerSummaryTableAdapter();

            OPNCUSTTableAdapter.CustomizeFill("SELECT * FROM OPNCUST WHERE CUSTOMER_ACT_STAT <> \'I\' AND CUSTOMER_DAY_DUE = " + ((DateTime)StatementDatenullableDateTimePicker.Value).Day.ToString().TrimStart().TrimEnd() + " ORDER BY CUSTOMER_DEALER,CUSTOMER_NO");
            OPNCUSTTableAdapter.CustomFillBy(ReportData.OPNCUST);
            StatementCustomerHeaderTableAdapter.FillByDueDate(ReportData.StatementCustomerHeader, ((DateTime)StatementDatenullableDateTimePicker.Value).Date, false, false);
            StatementDealerSummaryTableAdapter.FillByDueDate(ReportData.StatementDealerSummary, ((DateTime)StatementDatenullableDateTimePicker.Value).Date);
            if (ReportData.StatementCustomerHeader.Rows.Count == 0 || ReportData.OPNCUST.Rows.Count == 0)
            {
                MessageBox.Show("*** Sorry there are no statements for the DUE DATE you entered!!! ***");
            }
            else
            {
                OPNDEALRTableAdapter.CustomizeFill("SELECT * FROM OPNDEALR");
                OPNDEALRTableAdapter.CustomFillBy(ReportData.OPNDEALR);

                FinanceReport myReportObject = new FinanceReport();
                myReportObject.SetDataSource(ReportData);
                myReportObject.SetParameterValue("gsUserID", Program.gsUserID);
                myReportObject.SetParameterValue("gsUserName", Program.gsUserName);
                myReportObject.SetParameterValue("gsFormTitle", "Open Customer Finance Charge Report");
                rptViewer.crystalReportViewer.ReportSource = myReportObject;
                rptViewer.crystalReportViewer.Refresh();
                rptViewer.Show();
            }
        }
Ejemplo n.º 2
0
        private void ActDealerPost()
        {
            Int32 lnProgress = 0, lnTotalWork = 0;

            IACDataSetTableAdapters.OPNDEALRTableAdapter OPNDEALRTableAdapter = new IACDataSetTableAdapters.OPNDEALRTableAdapter();
            BindingSource OPNDEALRBindingSource = new BindingSource();

            OPNDEALRBindingSource.DataSource = AddOniacDataSet.OPNDEALR;

            lnTotalWork = AddOniacDataSet.ADD_ON_WS_DEALER.Rows.Count;
            for (Int32 i = 0; i < AddOniacDataSet.ADD_ON_WS_DEALER.Count; i++)
            {
                OPNDEALRTableAdapter.Fill(AddOniacDataSet.OPNDEALR, AddOniacDataSet.ADD_ON_WS_DEALER[i].Field <String>("KEY"));
                if (AddOniacDataSet.OPNDEALR.Rows.Count != 0)
                {
                    AddOniacDataSet.OPNDEALR.Rows[0].SetField <Decimal>("OPNDEALR_CUR_RSV", 0);
                    AddOniacDataSet.OPNDEALR.Rows[0].SetField <Decimal>("OPNDEALR_CUR_CONT", 0);
                    AddOniacDataSet.OPNDEALR.Rows[0].SetField <Decimal>("OPNDEALR_CUR_OLOAN", 0);
                    AddOniacDataSet.OPNDEALR.Rows[0].SetField <Decimal>("OPNDEALR_CUR_ADJ", 0);
                    AddOniacDataSet.OPNDEALR.Rows[0].SetField <Decimal>("OPNDEALR_CUR_BAD", 0);
                    AddOniacDataSet.OPNDEALR.Rows[0].SetField <Decimal>("OPNDEALR_CUR_LOSS", 0);

                    AddOniacDataSet.OPNDEALR.Rows[0].SetField <Decimal>("OPNDEALR_CUR_OLOAN", AddOniacDataSet.ADD_ON_WS_DEALER.Rows[i].Field <Decimal>("OS_L"));
                    AddOniacDataSet.OPNDEALR.Rows[0].SetField <Decimal>("OPNDEALR_YTD_OLOAN", AddOniacDataSet.OPNDEALR.Rows[0].Field <Decimal>("OPNDEALR_YTD_OLOAN") + AddOniacDataSet.ADD_ON_WS_DEALER.Rows[i].Field <Decimal>("OS_L"));
                    AddOniacDataSet.OPNDEALR.Rows[0].SetField <DateTime>("OPNDEALR_POST_DATE", DateTime.Now.Date);

                    OPNDEALRBindingSource.EndEdit();
                    OPNDEALRTableAdapter.Update(AddOniacDataSet.OPNDEALR.Rows[0]);
                    AddOniacDataSet.OPNDEALR.AcceptChanges();
                    DealHistPost();
                    lnProgress = (Int32)Math.Round(((Double)i / (Double)lnTotalWork) * (Double)100, 2);
                    worker.ReportProgress(lnProgress);
                }
            }
        }