private ProvidentFundAccountDoc CreateAccount(String userId, Mimshak item, HeshbonOPolisa policy) { ProvidentFundAccountDoc account; try { account = new ProvidentFundAccountDoc { UserId = userId, ProviderName = item.YeshutYatzran?.ShemYatzran, PolicyId = policy.MisparPolisaOheshbon, PolicyStatus = policy.StatusPolisaOcheshbon == 1 ? PolicyStatus.Active : PolicyStatus.Inactive, PolicyOpeningDate = Reader.ConvertStringToDate(policy.TaarichHitztarfutMutzar), ValidationDate = Reader.ConvertStringToDate(policy.TaarichNechonut) }; } catch (Exception e) { Console.WriteLine(e); throw; } return(account); }
private SeInsurAccountDoc CreateAccount(String userId, Mimshak item, Mutzar product, HeshbonOPolisa policy) { SeInsurAccountDoc account; try { Double totalSchumKitzvatZikna = 0; policy.YitraLefiGilPrisha.Kupot.Kupa.ForEach(k => { totalSchumKitzvatZikna += k.SchumKitzvatZikna.GetValueOrDefault(); }); double?totalSavings = 0; double?deathInsuranceAmount = 0; policy.Kisuim.ForEach(kisui => { kisui.ZihuiKisui.ForEach(zihui => { totalSavings = zihui.SchumeiBituahYesodi?.SchumBituahLemavet.GetValueOrDefault(); deathInsuranceAmount = zihui.SchumeiBituahYesodi?.TikratGagHatamLemikreMavet.GetValueOrDefault(); }); }); var employeerId = policy.PirteiTaktziv.PirteiOved.MprMaasikBeYatzran; var employerIdentity = product.NetuneiMutzar.YeshutMaasik.Where(ym => ym.MprMaasikBeYatzran.Equals(employeerId)).FirstOrDefault(); account = new SeInsurAccountDoc { UserId = userId, ProviderName = item.YeshutYatzran?.ShemYatzran, EmployerName = employerIdentity?.ShemMaasik, PlanName = policy.ShemTohnit, PolicyId = policy.MisparPolisaOheshbon, PolicyStatus = policy.StatusPolisaOcheshbon == 1 ? PolicyStatus.Active : PolicyStatus.Inactive, TotalSavings = totalSavings, EoyBalance = policy.PirteiTaktziv.PerutYitrotLesofShanaKodemet.YitratSofShana.GetValueOrDefault(), ExpectedRetirementSavingsNoPremium = policy.YitraLefiGilPrisha.TzviratChisachonChazuyaLeloPremiyot.GetValueOrDefault(), MonthlyRetirementPensionNoPremium = policy.YitraLefiGilPrisha.Kupot.Kupa.LastOrDefault()?.SchumKitzvatZikna.GetValueOrDefault(), ExpectedRetirementSavings = policy.YitraLefiGilPrisha.TzviratChisachonChazuyaLeloPremiyot.GetValueOrDefault(), MonthlyRetirementPension = totalSchumKitzvatZikna, DepositFee = policy.PirteiTaktziv.PerutMasluleiHashkaa.FirstOrDefault()?.SheurDmeiNihulHafkada.GetValueOrDefault(), SavingFee = policy.PirteiTaktziv.PerutHotzaot.MivneDmeiNihul.PerutMivneDmeiNihul.FirstOrDefault()?.SheurDmeiNihul.GetValueOrDefault(), YearRevenue = policy.Tsua.SheurTsuaNeto.GetValueOrDefault(), DeathInsuranceMonthlyAmount = 0, DeathInsuranceAmount = deathInsuranceAmount, PolicyOpeningDate = Reader.ConvertStringToDate(policy.TaarichHitztarfutMutzar), ValidationDate = Reader.ConvertStringToDate(policy.TaarichNechonut) }; } catch (Exception e) { Console.WriteLine(e); throw; } return(account); }
private MortgageInsurAccountDoc CreateAccount(String userId, Mimshak item, Mutzar product, HeshbonOPolisa policy) { MortgageInsurAccountDoc account; try { var coverages = new List <Coverage>(); foreach (var cover in policy.Kisuim) { foreach (var z in cover.ZihuiKisui) { coverages.Add(new Coverage { CoverageName = z.ShemKisuiYatzran, Amount = z.PirteiKisuiBeMutzar.SchumBituach.GetValueOrDefault(), DueDate = Reader.ConvertStringToDate(z.PirteiKisuiBeMutzar.TaarichTomKisuy), ActualFee = z.PirteiKisuiBeMutzar.DmeiBituahLetashlumBapoal.GetValueOrDefault() }); } } account = new MortgageInsurAccountDoc { UserId = userId, ProviderName = item.YeshutYatzran?.ShemYatzran, PlanName = policy.ShemTohnit, PolicyId = policy.MisparPolisaOheshbon, PolicyStatus = policy.StatusPolisaOcheshbon == 1 ? PolicyStatus.Active : PolicyStatus.Inactive, DepositFee = policy.PirteiTaktziv.PerutHotzaot.HotzaotBafoalLehodeshDivoach.TotalDmeiNihulHafkada.GetValueOrDefault(), SavingFee = policy.PirteiTaktziv.PerutHotzaot.MivneDmeiNihul.PerutMivneDmeiNihul.FirstOrDefault()?.SheurDmeiNihul.GetValueOrDefault(), Coverage = coverages, WorkDisabilityMonthly = 0, WorkDisabilityOneTime = 0, PolicyOpeningDate = Reader.ConvertStringToDate(policy.TaarichHitztarfutMutzar), ValidationDate = Reader.ConvertStringToDate(policy.TaarichNechonut), }; } catch (Exception e) { Console.WriteLine(e); throw; } return(account); }
private List <MortgageInsurAccountDoc> CreateAccounts(String userId, Mimshak item, Mutzar product) { List <MortgageInsurAccountDoc> accounts = new List <MortgageInsurAccountDoc>(); if (product.NetuneiMutzar?.SugMutzar == 7 && product?.HeshbonotOPolisot != null) { foreach (var policy in product.HeshbonotOPolisot.HeshbonOPolisa) { var account = CreateAccount(userId, item, product, policy); if (account != null) { accounts.Add(account); } } } return(accounts); }
private StudyFundAccount CreateAccount(String userId, Mimshak item, Mutzar product, HeshbonOPolisa policy) { StudyFundAccount account; try { var employeerId = policy.PirteiTaktziv.PirteiOved.MprMaasikBeYatzran; var employerIdentity = product.NetuneiMutzar.YeshutMaasik.Where(ym => ym.MprMaasikBeYatzran.Equals(employeerId)).FirstOrDefault(); account = new StudyFundAccount { UserId = userId, ProviderName = item.YeshutYatzran?.ShemYatzran, EmployerName = employerIdentity.ShemMaasik, PlanName = policy.ShemTohnit, PolicyId = policy.MisparPolisaOheshbon, PolicyStatus = policy.StatusPolisaOcheshbon == 1 ? PolicyStatus.Active : PolicyStatus.Inactive, TotalSavings = policy.PirteiTaktziv.BlockItrot.Yitrot.YitrotShonot.YitratKaspeyTagmulim.GetValueOrDefault(), WithdrawalDate = Reader.ConvertStringToDate(policy.PirteiTaktziv.BlockItrot.Yitrot.YitrotShonot.MoedNezilutTagmulim), DepositFee = policy.PirteiTaktziv.PerutHotzaot.HotzaotBafoalLehodeshDivoach.TotalDmeiNihulHafkada .GetValueOrDefault(), SavingFee = policy.PirteiTaktziv.PerutHotzaot.MivneDmeiNihul.PerutMivneDmeiNihul.FirstOrDefault(dn => dn.SugHotzaa == 1)?.SheurDmeiNihul.GetValueOrDefault(), YearRevenue = policy.Tsua.SheurTsuaNeto.GetValueOrDefault(), SaverDeposit = policy.PirteiTaktziv.PerutHafrashotLePolisa.FirstOrDefault(phlp => phlp?.SugHafrasha.Value == 8)?.SchumHafrasha.GetValueOrDefault(), EmployerDeposit = policy.PirteiTaktziv.PerutHafrashotLePolisa.FirstOrDefault(phlp => phlp?.SugHafrasha.Value == 9)?.SchumHafrasha.GetValueOrDefault(), PolicyOpeningDate = Reader.ConvertStringToDate(policy.TaarichHitztarfutMutzar), ValidationDate = Reader.ConvertStringToDate(policy.TaarichNechonut) }; } catch (Exception e) { Console.WriteLine(e); throw; } return(account); }