diff --git a/ServiceHost/Pages/Index.cshtml.cs b/ServiceHost/Pages/Index.cshtml.cs index 1e2a8f17..b75e8d2b 100644 --- a/ServiceHost/Pages/Index.cshtml.cs +++ b/ServiceHost/Pages/Index.cshtml.cs @@ -85,132 +85,137 @@ namespace ServiceHost.Pages //اصلاحات محاصبه پایه سنوات در فیش حقوقی //_yearlySalaryRepository.TestDayliFeeCompute(); bool ex = false; - while (!ex) - { - Console.WriteLine("enter National code ... "); - var nationalCode = Console.ReadLine(); - Console.WriteLine("enter DateOfBirth ... "); - var dateOfBirth = Console.ReadLine(); - Console.WriteLine("enter phoneNumber ... "); - var phone = Console.ReadLine(); - var res = await _clientRegistrationApplication.CreateContractingPartyTemp(nationalCode, dateOfBirth, - phone); - if (res.IsSuccedded) - { - var updateAddress =await - _clientRegistrationApplication.UpdateAddress(res.Data.Id, "gilan", "rasht", "hajiabad"); - if (updateAddress.IsSuccedded) - { - var workshopSelected = _clientRegistrationApplication.GetWorkshopTemp(res.Data.Id).GetAwaiter().GetResult(); - if (workshopSelected.Count > 0) - { - var result = await - _clientRegistrationApplication.GetTotalPaymentAndWorkshopList(res.Data.Id, "12", - "OneTime"); - Console.WriteLine("sumOfWorkshopPayment : " + result.SumOfWorkshopsPaymentDouble); - Console.WriteLine("TotalPaymentDouble : " + result.TotalPaymentDouble); - var createInstitutionContract = await - _clientRegistrationApplication.CreateOrUpdateInstitutionContractTemp(res.Data.Id, null, - null, result.TotalPaymentDouble, 0); - if (createInstitutionContract.IsSuccedded) - { - var sendVerfyCode =await _clientRegistrationApplication.ReceivedCodeFromServer(res.Data.Id); - if (sendVerfyCode.IsSuccedded) - { - Console.WriteLine("enter the code ... "); - var codeReceived = Console.ReadLine(); + //while (!ex) + //{ + // Console.WriteLine("enter National code ... "); + // var nationalCode = Console.ReadLine(); + // Console.WriteLine("enter DateOfBirth ... "); + // var dateOfBirth = Console.ReadLine(); + // Console.WriteLine("enter phoneNumber ... "); + // var phone = Console.ReadLine(); + // var res = await _clientRegistrationApplication.CreateContractingPartyTemp(nationalCode, dateOfBirth, + // phone); + // if (res.IsSuccedded) + // { + // var updateAddress =await + // _clientRegistrationApplication.UpdateAddress(res.Data.Id, "gilan", "rasht", "hajiabad"); + // if (updateAddress.IsSuccedded) + // { + // var workshopSelected = _clientRegistrationApplication.GetWorkshopTemp(res.Data.Id).GetAwaiter().GetResult(); + // if (workshopSelected.Count > 0) + // { + // var result = await + // _clientRegistrationApplication.GetTotalPaymentAndWorkshopList(res.Data.Id, "12", + // "OneTime"); + // Console.WriteLine("sumOfWorkshopPayment : " + result.SumOfWorkshopsPaymentDouble); + // Console.WriteLine("TotalPaymentDouble : " + result.TotalPaymentDouble); + // var createInstitutionContract = await + // _clientRegistrationApplication.CreateOrUpdateInstitutionContractTemp(res.Data.Id, null, + // null, result.TotalPaymentDouble, 0); + // if (createInstitutionContract.IsSuccedded) + // { + // var sendVerfyCode =await _clientRegistrationApplication.ReceivedCodeFromServer(res.Data.Id); + // if (sendVerfyCode.IsSuccedded) + // { + // Console.WriteLine("enter the code ... "); + // var codeReceived = Console.ReadLine(); - var completeSms = await - _clientRegistrationApplication.CheckVerifyCodeIsTrue(res.Data.Id, codeReceived); - if (completeSms.IsSuccedded) - { - var payOffCompleted = - await _clientRegistrationApplication.PayOffCompleted(res.Data.Id); - if (payOffCompleted.IsSuccedded) - { - Console.WriteLine("finaly completed"); - } - else - { - Console.WriteLine(payOffCompleted.Message); - } - } - } - } + // var completeSms = await + // _clientRegistrationApplication.CheckVerifyCodeIsTrue(res.Data.Id, codeReceived); + // if (completeSms.IsSuccedded) + // { + // var payOffCompleted = + // await _clientRegistrationApplication.PayOffCompleted(res.Data.Id); + // if (payOffCompleted.IsSuccedded) + // { + // Console.WriteLine("finaly completed"); + // } + // else + // { + // Console.WriteLine(payOffCompleted.Message); + // } + // } + // } + // } - } - else - { - var workshops = new List(); - workshops.Add(new WorkshopTempViewModel - { - ContractAndCheckout = true, - ContractingPartyTempId = res.Data.Id, - CountPerson = 10, - CustomizeCheckout = true, - Insurance = true, - RollCall = true, - WorkshopName = "dadmehr", + // } + // else + // { + // var workshops = new List(); + // workshops.Add(new WorkshopTempViewModel + // { + // ContractAndCheckout = true, + // ContractingPartyTempId = res.Data.Id, + // CountPerson = 10, + // CustomizeCheckout = true, + // Insurance = true, + // RollCall = true, + // WorkshopName = "dadmehr", - }); - workshops.Add(new WorkshopTempViewModel - { - ContractAndCheckout = true, - ContractingPartyTempId = res.Data.Id, - CountPerson = 20, - CustomizeCheckout = true, - Insurance = true, - RollCall = true, - WorkshopName = "kababMahdi", + // }); + // workshops.Add(new WorkshopTempViewModel + // { + // ContractAndCheckout = true, + // ContractingPartyTempId = res.Data.Id, + // CountPerson = 20, + // CustomizeCheckout = true, + // Insurance = true, + // RollCall = true, + // WorkshopName = "kababMahdi", + + // }); + // var creteWorkshops = _clientRegistrationApplication.CreateOrUpdateWorkshopTemp(workshops) + // .GetAwaiter().GetResult(); + + // if (creteWorkshops.IsSuccedded) + // { + // var result = _clientRegistrationApplication.GetTotalPaymentAndWorkshopList(res.Data.Id).GetAwaiter().GetResult(); + // Console.WriteLine("sumOfWorkshopPayment : " + result.SumOfWorkshopsPaymentDouble); + // Console.WriteLine("TotalPaymentDouble : " + result.TotalPaymentDouble); + + // var createInstitutionContract = await + // _clientRegistrationApplication.CreateOrUpdateInstitutionContractTemp(res.Data.Id, null, + // null, result.TotalPaymentDouble, 0); + // if (createInstitutionContract.IsSuccedded) + // { + // var sendVerfyCode = await _clientRegistrationApplication.ReceivedCodeFromServer(res.Data.Id); + // if (sendVerfyCode.IsSuccedded) + // { + // Console.WriteLine("enter the code ... "); + // var codeReceived = Console.ReadLine(); + + // var completeSms = await + // _clientRegistrationApplication.CheckVerifyCodeIsTrue(res.Data.Id, codeReceived); + // if (completeSms.IsSuccedded) + // { + // var payOffCompleted = + // await _clientRegistrationApplication.PayOffCompleted(res.Data.Id); + // if (payOffCompleted.IsSuccedded) + // { + // Console.WriteLine("finaly completed"); + // } + // else + // { + // Console.WriteLine(payOffCompleted.Message); + // } + // } + // } + // } + // } + // } + + // } + // } + // Console.WriteLine("do you want to exit ... "); + // var exitCheck = Console.ReadLine(); + // if (exitCheck == "y") + // ex = true; + //} - }); - var creteWorkshops = _clientRegistrationApplication.CreateOrUpdateWorkshopTemp(workshops) - .GetAwaiter().GetResult(); - if (creteWorkshops.IsSuccedded) - { - var result = _clientRegistrationApplication.GetTotalPaymentAndWorkshopList(res.Data.Id).GetAwaiter().GetResult(); - Console.WriteLine("sumOfWorkshopPayment : " + result.SumOfWorkshopsPaymentDouble); - Console.WriteLine("TotalPaymentDouble : " + result.TotalPaymentDouble); - var createInstitutionContract = await - _clientRegistrationApplication.CreateOrUpdateInstitutionContractTemp(res.Data.Id, null, - null, result.TotalPaymentDouble, 0); - if (createInstitutionContract.IsSuccedded) - { - var sendVerfyCode = await _clientRegistrationApplication.ReceivedCodeFromServer(res.Data.Id); - if (sendVerfyCode.IsSuccedded) - { - Console.WriteLine("enter the code ... "); - var codeReceived = Console.ReadLine(); - var completeSms = await - _clientRegistrationApplication.CheckVerifyCodeIsTrue(res.Data.Id, codeReceived); - if (completeSms.IsSuccedded) - { - var payOffCompleted = - await _clientRegistrationApplication.PayOffCompleted(res.Data.Id); - if (payOffCompleted.IsSuccedded) - { - Console.WriteLine("finaly completed"); - } - else - { - Console.WriteLine(payOffCompleted.Message); - } - } - } - } - } - } - } - } - Console.WriteLine("do you want to exit ... "); - var exitCheck = Console.ReadLine(); - if (exitCheck == "y") - ex = true; - } // while (!ex) // {