예제 #1
0
        public void Do2(HomeModel model)
        {
            IsBusy = true;

            var fileIds    = ReadFileIdsFromExcel(model.ExcelFilePath);
            var patients   = GetPatientInfo(model.DbFilePath, fileIds);
            var httpClient = new MelliBankHttpClient();

            var index = 0;

            foreach (var patient in patients)
            {
                index++;
                Console.WriteLine($"{index} of {patients.Count} ( {index * 100 / patients.Count}% )");

                if (string.IsNullOrWhiteSpace(patient.AccountNo))
                {
                    continue;
                }

                patient.RealAccountOwnerName = httpClient.GetAccountOwnerName(patient.AccountNo);
            }

            FillExcelAndSaveAs(model.ExcelFilePath, patients, ".\\result.xlsx");
            model.IsDone = true;

            IsBusy = false;
        }
예제 #2
0
        public void Do1(string inputExcel, string outputExcel)
        {
            IsBusy = true;

            var patients = ReadPatientsFromExcel(inputExcel);

            ProgressTotal = patients.Count;
            ProgressValue = 0;
            var httpClient = new MelliBankHttpClient();

            foreach (var patient in patients)
            {
                ProgressValue++;
                Console.WriteLine($"{ProgressValue} of {ProgressTotal} ( {ProgressValue * 100 / ProgressTotal}% )");

                if (string.IsNullOrWhiteSpace(patient.AccountNo))
                {
                    continue;
                }

                patient.RealAccountOwnerName = httpClient.GetAccountOwnerName(patient.AccountNo);
            }

            SavePatientsAsExcel(inputExcel, 3, outputExcel, patients);

            IsBusy = false;
        }