Пример #1
0
        private void PrintClosedTrialBalance(ReportViewer rptViewer)
        {
            String lsDealerNum = comboBoxDealer.Text.TrimEnd().TrimStart() + "%", lsState;

            lsState = (comboBoxState.SelectedValue != null) ? comboBoxState.SelectedValue.ToString().TrimStart().TrimEnd() + "%" : "%";

            IACDataSetTableAdapters.CUSTOMERTableAdapter CUSTOMERTableAdapter = new IACDataSetTableAdapters.CUSTOMERTableAdapter();
            IACDataSetTableAdapters.DEALERTableAdapter   DEALERTableAdapter = new IACDataSetTableAdapters.DEALERTableAdapter();
            IACDataSetTableAdapters.WS_DEALER_TRIAL_BALANCETableAdapter WS_DEALER_TRIAL_BALANCETableAdapter = new IACDataSetTableAdapters.WS_DEALER_TRIAL_BALANCETableAdapter();
            IACDataSetTableAdapters.MastHistTotalsTableAdapter          MastHistTotalsTableAdapter = new IACDataSetTableAdapters.MastHistTotalsTableAdapter();
            // Moses Newman 05/3/2014 Get rid of SQL Pass Through!
            CUSTOMERTableAdapter.FillByStateDealer(iACDataSet.CUSTOMER, lsState, lsDealerNum);
            DEALERTableAdapter.FillByCustomerStateDealer(iACDataSet.DEALER, lsState, lsDealerNum);
            WS_DEALER_TRIAL_BALANCETableAdapter.FillByStateDealer(iACDataSet.WS_DEALER_TRIAL_BALANCE, lsState, lsDealerNum);
            MastHistTotalsTableAdapter.Fill(iACDataSet.MastHistTotals, "C");

            ClosedLoanTrialBalance myReportObject = new ClosedLoanTrialBalance();

            myReportObject.SetDataSource(iACDataSet);
            myReportObject.SetParameterValue("gsUserID", Program.gsUserID);
            myReportObject.SetParameterValue("gsUserName", Program.gsUserName);
            rptViewer.crystalReportViewer.ReportSource = myReportObject;
            rptViewer.crystalReportViewer.Refresh();
            rptViewer.Show();
        }
Пример #2
0
        private void buttonExcel_Click(object sender, EventArgs e)
        {
            SQLBackupandRestore SQLBR = new SQLBackupandRestore();
            TrialBalancePretty  TBP   = new TrialBalancePretty();

            String lsDealerNum = comboBoxDealer.Text.TrimEnd().TrimStart() + "%", lsState;

            lsState = (comboBoxState.SelectedValue != null) ? comboBoxState.SelectedValue.ToString().TrimStart().TrimEnd() + "%" : "%";

            IACDataSetTableAdapters.CUSTOMERTableAdapter                CUSTOMERTableAdapter                = new IACDataSetTableAdapters.CUSTOMERTableAdapter();
            IACDataSetTableAdapters.ClosedDealerSummaryTableAdapter     ClosedDealerSummaryTableAdapter     = new IACDataSetTableAdapters.ClosedDealerSummaryTableAdapter();
            IACDataSetTableAdapters.WS_DEALER_TRIAL_BALANCETableAdapter WS_DEALER_TRIAL_BALANCETableAdapter = new IACDataSetTableAdapters.WS_DEALER_TRIAL_BALANCETableAdapter();
            // Moses Newman 05/3/2014 Get rid of SQL Pass Through!
            CUSTOMERTableAdapter.FillByStateDealer(iACDataSet.CUSTOMER, lsState, lsDealerNum);
            ClosedDealerSummaryTableAdapter.Fill(iACDataSet.ClosedDealerSummary, DateTime.Now.Month, DateTime.Now.Year);
            WS_DEALER_TRIAL_BALANCETableAdapter.FillByStateDealer(iACDataSet.WS_DEALER_TRIAL_BALANCE, lsState, lsDealerNum);
            Int32 elapsed = 0;

            if (SQLBR.RunJob("TrialBalance", "Export Trial Balance To EXCEL", false))
            {
                TBP.IACType            = "C";
                TBP.CustDealerCount    = iACDataSet.CUSTOMER.Rows.Count;
                TBP.DealerCount        = iACDataSet.WS_DEALER_TRIAL_BALANCE.Rows.Count;
                TBP.DealerSummaryCount = iACDataSet.ClosedDealerSummary.Rows.Count;
                TBP.FullSourcePath     = @"\\Dc-iac\public\AccStuff\mfdata\comp1000\ClosedTrialBalance.xlsx";
                Thread.Sleep(5000);
                var fi1 = new FileInfo(TBP.FullSourcePath);

                while (TBP.IsFileLocked(fi1) && elapsed < 500000)
                {
                    Thread.Sleep(1000);
                    elapsed += 1000;
                }
                TBP.TBPRetty();
            }
        }