コード例 #1
0
ファイル: txtPROCESS.cs プロジェクト: TuanCruise/VRB_Report
        private void CommitData(VisaExecute visa)
        {
            SetProcessState(ProcessState.Saving);
            //VSS-110
            try
            {
                sReportDate = visa.VisaReport.ListReport_110[1].ReportDate;
                for (int i = 0; i < visa.VisaReport.ListReport_110.Count; i++)
                {
                    for (int j = 0; j < visa.VisaReport.ListReport_110[i].ListDetail.Count; j++)
                    {
                        List <string> values = new List <string>();
                        values.Add(sLogID);
                        values.Add((i + 1).ToString());                                     //REPORT_NUMBER
                        values.Add(visa.VisaReport.ListReport_110[i].ReportID);             //REPORT_ID
                        values.Add(visa.VisaReport.ListReport_110[i].ReportingFor);         //REPORT_FOR
                        values.Add(visa.VisaReport.ListReport_110[i].RollUp);               //ROLL_UP
                        values.Add(visa.VisaReport.ListReport_110[i].ProcDate);             //PROC_DATE
                        values.Add(visa.VisaReport.ListReport_110[i].ReportDate);           //REPORT_DATE
                        values.Add(visa.VisaReport.ListReport_110[i].Funds);                //FUNDS
                        values.Add(visa.VisaReport.ListReport_110[i].SettlementCurrency);   //SETTLMENT_CURRENCY
                        values.Add(visa.VisaReport.ListReport_110[i].ClearingCurrency);     //CLEARING_CURRENCY
                        values.Add(visa.VisaReport.ListReport_110[i].ListDetail[j].Colum5); //TOTAL_AMOUNT
                        ctrlSA.ExecuteStoreProcedure("TXTREADER.IMP_VSS110_EXECUTE", values);
                        //values.ForEach(Console.WriteLine);
                    }
                }
                //VSS-120
                for (int i = 0; i < visa.VisaReport.ListReport_120.Count; i++)
                {
                    for (int j = 0; j < visa.VisaReport.ListReport_120[i].ListGroup.Count; j++)
                    {
                        for (int k = 0; k < visa.VisaReport.ListReport_120[i].ListGroup[j].ListDetail.Count; k++)
                        {
                            List <string> values = new List <string>();
                            values.Add(sLogID);
                            values.Add((i + 1).ToString());                                                  //REPORT_NUMBER
                            values.Add(visa.VisaReport.ListReport_120[i].ReportID);                          //REPORT_ID
                            values.Add(visa.VisaReport.ListReport_120[i].ReportingFor);                      //REPORT_FOR
                            values.Add(visa.VisaReport.ListReport_120[i].RollUp);                            //ROLL_UP
                            values.Add(visa.VisaReport.ListReport_120[i].ProcDate);                          //PROC_DATE
                            values.Add(visa.VisaReport.ListReport_120[i].ReportDate);                        //REPORT_DATE
                            values.Add(visa.VisaReport.ListReport_120[i].Funds);                             //FUNDS
                            values.Add(visa.VisaReport.ListReport_120[i].SettlementCurrency);                //SETTLMENT_CURRENCY
                            values.Add(visa.VisaReport.ListReport_120[i].ClearingCurrency);                  //CLEARING_CURRENCY
                            values.Add(visa.VisaReport.ListReport_120[i].ListGroup[j].GroupName);            //GROUP_NAME
                            values.Add(visa.VisaReport.ListReport_120[i].ListGroup[j].ListDetail[k].Colum1); //NAME
                            values.Add(visa.VisaReport.ListReport_120[i].ListGroup[j].ListDetail[k].Colum5); //VALUE_CREDIT
                            values.Add(visa.VisaReport.ListReport_120[i].ListGroup[j].ListDetail[k].Colum6); //VALUE_DEBIT
                            ctrlSA.ExecuteStoreProcedure("TXTREADER.IMP_VSS120_EXECUTE", values);
                            //values.ForEach(Console.WriteLine);
                        }
                    }
                }
                //VSS-130
                for (int i = 0; i < visa.VisaReport.ListReport_130.Count; i++)
                {
                    for (int j = 0; j < visa.VisaReport.ListReport_130[i].ListGroup.Count; j++)
                    {
                        for (int k = 0; k < visa.VisaReport.ListReport_130[i].ListGroup[j].ListDetail.Count; k++)
                        {
                            List <string> values = new List <string>();
                            values.Add(sLogID);
                            values.Add((i + 1).ToString());                                                  //REPORT_NUMBER
                            values.Add(visa.VisaReport.ListReport_130[i].ReportID);                          //REPORT_ID
                            values.Add(visa.VisaReport.ListReport_130[i].ReportingFor);                      //REPORT_FOR
                            values.Add(visa.VisaReport.ListReport_130[i].RollUp);                            //ROLL_UP
                            values.Add(visa.VisaReport.ListReport_130[i].ProcDate);                          //PROC_DATE
                            values.Add(visa.VisaReport.ListReport_130[i].ReportDate);                        //REPORT_DATE
                            values.Add(visa.VisaReport.ListReport_130[i].Funds);                             //FUNDS
                            values.Add(visa.VisaReport.ListReport_130[i].SettlementCurrency);                //SETTLMENT_CURRENCY
                            values.Add(visa.VisaReport.ListReport_130[i].ClearingCurrency);                  //CLEARING_CURRENCY
                            values.Add(visa.VisaReport.ListReport_130[i].ListGroup[j].GroupName);            //GROUP_NAME
                            values.Add(visa.VisaReport.ListReport_130[i].ListGroup[j].ListDetail[k].Colum1); //NAME
                            values.Add(visa.VisaReport.ListReport_130[i].ListGroup[j].ListDetail[k].Colum4); //FEE_CREDIT
                            values.Add(visa.VisaReport.ListReport_130[i].ListGroup[j].ListDetail[k].Colum5); //FEEE_DEBIT
                            ctrlSA.ExecuteStoreProcedure("TXTREADER.IMP_VSS130_EXECUTE", values);
                            //values.ForEach(Console.WriteLine);
                        }
                    }
                }
                //VSS-140
                for (int i = 0; i < visa.VisaReport.ListReport_140.Count; i++)
                {
                    for (int j = 0; j < visa.VisaReport.ListReport_140[i].ListGroup.Count; j++)
                    {
                        for (int k = 0; k < visa.VisaReport.ListReport_140[i].ListGroup[j].ListDetail.Count; k++)
                        {
                            List <string> values = new List <string>();
                            values.Add(sLogID);
                            values.Add((i + 1).ToString());                                                  //REPORT_NUMBER
                            values.Add(visa.VisaReport.ListReport_140[i].ReportID);                          //REPORT_ID
                            values.Add(visa.VisaReport.ListReport_140[i].ReportingFor);                      //REPORT_FOR
                            values.Add(visa.VisaReport.ListReport_140[i].RollUp);                            //ROLL_UP
                            values.Add(visa.VisaReport.ListReport_140[i].ProcDate);                          //PROC_DATE
                            values.Add(visa.VisaReport.ListReport_140[i].ReportDate);                        //REPORT_DATE
                            values.Add(visa.VisaReport.ListReport_140[i].Funds);                             //FUNDS
                            values.Add(visa.VisaReport.ListReport_140[i].SettlementCurrency);                //SETTLMENT_CURRENCY
                            values.Add(visa.VisaReport.ListReport_140[i].ClearingCurrency);                  //CLEARING_CURRENCY
                            values.Add(visa.VisaReport.ListReport_140[i].ListGroup[j].GroupName);            //GROUP_NAME
                            values.Add(visa.VisaReport.ListReport_140[i].ListGroup[j].ListDetail[k].Colum1); //NAME
                            values.Add(visa.VisaReport.ListReport_140[i].ListGroup[j].ListDetail[k].Colum4); //VISA_CHARGES_CREDITS
                            values.Add(visa.VisaReport.ListReport_140[i].ListGroup[j].ListDetail[k].Colum5); //VISA_CHARGES_DEBIT
                            ctrlSA.ExecuteStoreProcedure("TXTREADER.IMP_VSS140_EXECUTE", values);
                            //values.ForEach(Console.WriteLine);
                        }
                    }
                }
                //VSS-210
                for (int i = 0; i < visa.VisaReport.ListReport_210.Count; i++)
                {
                    for (int j = 0; j < visa.VisaReport.ListReport_210[i].ListGroup.Count; j++)
                    {
                        for (int k = 0; k < visa.VisaReport.ListReport_210[i].ListGroup[j].ListDetail.Count; k++)
                        {
                            List <string> values = new List <string>();
                            values.Add(sLogID);
                            values.Add((i + 1).ToString());                                                  //REPORT_NUMBER
                            values.Add(visa.VisaReport.ListReport_210[i].ReportID);                          //REPORT_ID
                            values.Add(visa.VisaReport.ListReport_210[i].ReportingFor);                      //REPORT_FOR
                            values.Add(visa.VisaReport.ListReport_210[i].RollUp);                            //ROLL_UP
                            values.Add(visa.VisaReport.ListReport_210[i].ProcDate);                          //PROC_DATE
                            values.Add(visa.VisaReport.ListReport_210[i].ReportDate);                        //REPORT_DATE
                            values.Add(visa.VisaReport.ListReport_210[i].Funds);                             //FUNDS
                            values.Add(visa.VisaReport.ListReport_210[i].SettlementCurrency);                //SETTLMENT_CURRENCY
                            values.Add(visa.VisaReport.ListReport_210[i].ClearingCurrency);                  //CLEARING_CURRENCY
                            values.Add(visa.VisaReport.ListReport_210[i].ListGroup[j].GroupName);            //GROUP_NAME
                            values.Add(visa.VisaReport.ListReport_210[i].ListGroup[j].ListDetail[k].Colum1); //NAME
                            values.Add(visa.VisaReport.ListReport_210[i].ListGroup[j].ListDetail[k].Colum5); //OPT_ISSUER_FEE
                            ctrlSA.ExecuteStoreProcedure("TXTREADER.IMP_VSS210_EXECUTE", 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;
                }
            }
        }