コード例 #1
0
ファイル: txtPROCESS.cs プロジェクト: TuanCruise/VRB_Report
        private void CommitData(LoanExcute fee4)
        {
            SetProcessState(ProcessState.Saving);
            try
            {
                //sReportDate = fee4.LoanReport.ReportDate;
                //for (int i = 0; i < fee4.LoanReport.ListLoanType.Count; i++)
                //{
                //    List<string> values = new List<string>();
                //    values.Add(sLogID);
                //    values.Add(fee4.LoanReport.ReportDateTableName);
                //    values.Add(fee4.LoanReport.ListLoanType[i].AcctNo);
                //    values.Add(fee4.LoanReport.ListLoanType[i].Branch);
                //    values.Add(fee4.LoanReport.ListLoanType[i].Name);
                //    values.Add(fee4.LoanReport.ListLoanType[i].PassportNo);
                //    values.Add(fee4.LoanReport.ListLoanType[i].OpeningBalance);
                //    //ctrlSA.ExecuteStoreProcedure("TXTREADER.IMP_DEBTBALANCE", values);
                //    values.ForEach(Console.WriteLine);
                //}

                sReportDate        = fee4.LoanReport.ReportDate;
                sReportCreatedDate = fee4.LoanReport.ReportCreationDate;
                for (int i = 0; i < fee4.LoanReport.ListGroupLoan.Count; i++)
                {
                    for (int j = 0; j < fee4.LoanReport.ListGroupLoan[i].ListLoanType.Count; j++)
                    {
                        List <string> values = new List <string>();
                        values.Add(sLogID);

                        values.Add(fee4.LoanReport.ListGroupLoan[i].ReportDateTableName);
                        values.Add(fee4.LoanReport.ListGroupLoan[i].ListLoanType[j].AcctNo);
                        values.Add(fee4.LoanReport.ListGroupLoan[i].ListLoanType[j].Branch);
                        values.Add(fee4.LoanReport.ListGroupLoan[i].ListLoanType[j].Name);
                        values.Add(fee4.LoanReport.ListGroupLoan[i].ListLoanType[j].PassportNo);
                        values.Add(fee4.LoanReport.ListGroupLoan[i].ListLoanType[j].OpeningBalance);
                        ctrlSA.ExecuteStoreProcedure("TXTREADER.IMP_DEBTBALANCE", values);
                        //values.ForEach(Console.WriteLine);
                    }
                }
            }
            catch (Exception ex)
            {
                sError       = ex.Message.ToString();
                ErrorReading = true;
            }
        }
コード例 #2
0
ファイル: txtPROCESS.cs プロジェクト: TuanCruise/VRB_Report
        public override void Read()
        {
            //SetProcessState(ProcessState.Running);
            //Console.WriteLine(FilePath);
            WriteInfo("Bắt đầu đọc file: " + sFileName);

            if (sFileName.Contains("FEE"))
            {
                FeeOverduePaymentExcute fee = new FeeOverduePaymentExcute();
                fee.GetReport(s_FilePath);
                CommitData(fee);
                FinishReading();
            }

            if (sFileName.Contains("OVERDUE"))
            {
                ContractOverduePaymentExcute fee1 = new ContractOverduePaymentExcute();
                fee1.GetReport(s_FilePath);
                CommitData(fee1);
                FinishReading();
            }
            if (sFileName.Contains("TRICHNOTUDONG"))
            {
                DebtAutomationExcute fee2 = new DebtAutomationExcute();
                fee2.GetReport(s_FilePath);
                CommitData(fee2);
                FinishReading();
            }
            if (sFileName.Contains("INTEREST"))
            {
                AccruedCreditInterestExcute fee3 = new AccruedCreditInterestExcute();
                fee3.GetReport(s_FilePath);
                CommitData(fee3);
                FinishReading();
            }
            if (sFileName.Contains("BALANCE"))
            {
                try
                {
                    LoanExcute fee4 = new LoanExcute();
                    fee4.GetReport(s_FilePath);
                    CommitData(fee4);
                    FinishReading();
                }
                catch (Exception ex)
                {
                    sError       = ex.Message.ToString();
                    ErrorReading = true;
                }
            }
            if (sFileName.Contains("EP747"))
            {
                try
                {
                    VisaExecute fee5 = new VisaExecute();
                    fee5.GetReport(s_FilePath);
                    CommitData(fee5);
                    FinishReading();
                }
                catch (Exception ex)
                {
                    sError       = ex.Message.ToString();
                    ErrorReading = true;
                }
            }
            if (sFileName.Contains("TRIAL"))
            {
                try
                {
                    TrialExecute trial = new TrialExecute();
                    trial.GetReport(s_FilePath);
                    CommitData(trial);
                    FinishReading();
                }
                catch (Exception ex)
                {
                    sError       = ex.Message.ToString();
                    ErrorReading = true;
                }
            }
        }