private void ExecuteRefreshItemsCommand(PlanBeneficiaryGroup item) { try { if (lastExpanded == item) { item.IsExpanded = !item.IsExpanded; } else { if (lastExpanded != null) { // hide previous selected item lastExpanded.IsExpanded = false; } // show selected item item.IsExpanded = true; } lastExpanded = item; if (Beneficiaries.All(x => !x.IsExpanded)) { HeighBeneficiary = (Beneficiaries.Count * 50); HeightTest = 380; return; } HeighBeneficiary = (item.Count * 100) + (item.Count * 30); HeightTest = 500; } catch (Exception e) { ServiceLocator.Current.GetInstance <IExceptionService>().RegisterException(e); } }
public async Task ValidateOTP() { var cancellationToken = new CancellationTokenSource().Token; await coWINAuthService.ValidateMobileOTPAsync(OTP, cancellationToken); var beneficiaryDTOList = await coWINAppointmentService.FetchBeneficiaries(cancellationToken); if (beneficiaryDTOList != null) { foreach (var beneficiaryDTO in beneficiaryDTOList) { if (beneficiaryDTO != null) { var beneficiary = new Models.Beneficiary(); beneficiary.Name = beneficiaryDTO.Name; beneficiary.PhotoId = beneficiaryDTO.PhotoIdType; beneficiary.IdNumber = beneficiaryDTO.PhotoIdNumber; Beneficiaries.Add(beneficiary); } } } HideLoginDetails = true; HideLogoutDetails = false; HideSearchCriteria = false; StateHasChangedDelegate?.Invoke(); }
private void BuyProductBeneficiary() { string url = "https://shop.ucm.com.uy/ShopOnline/affiliate/"; string life = Beneficiaries.First().LifeRp; string doc = loginViewModel.User.Document; string docType = loginViewModel.User.DocumentType; string complement = $"{life}{docType}{doc}|{life.Length}1"; Launcher.OpenAsync($"{url}{Base64Encode(complement)}"); }
public BeneficiariesDto(Beneficiaries Beneficiary) { this.Id = Beneficiary.Id; this.AlianzaId = Beneficiary.AlianzaId; this.Name = Beneficiary.Name; this.Gender = Beneficiary.Gender; this.BirthDate = Beneficiary.BirthDate; this.Relationship = Beneficiary.Relationship; this.Percent = Beneficiary.Percent; this.CreatedAt = Beneficiary.CreatedAt; this.UpdatedAt = Beneficiary.UpdatedAt; this.DeletedAt = Beneficiary.DeletedAt; this.Ssn = Beneficiary.Ssn; this.MultiAssistId = Beneficiary.MultiAssistId; this.Alianza = Beneficiary.Alianza; this.MultiAssists = Beneficiary.MultiAssists; }
public object RegisterBeneficiary(Beneficiaries Reg) { try { Beneficiary mg = new Beneficiary(); CustomerDetail cr = new CustomerDetail(); if (mg.BeneficiaryId == 0) { mg.Firstname = Reg.Firstname; mg.Lastname = Reg.Lastname; mg.AccountNum = Reg.AccountNum; mg.Email = Reg.Email; mg.Amount = Reg.Amount; mg.Phone = Reg.Phone; mg.CustomerId = Reg.CustomerId; var bal = DB1.CustomerDetails.Where(x => x.CustomerId == Reg.CustomerId).ToList().FirstOrDefault(); if (bal.OpeningBal >= mg.Amount) { DB.Beneficiaries.Add(mg); DB.SaveChanges(); return(new Response { Status = "Success", Message = "Record SuccessFully Saved." }); } else { return(new Response { Status = "Error", Message = "Invalid Data." }); } } } catch (Exception) { throw; } return(new Response { Status = "Error", Message = "Invalid Data." }); }
private void UpdateBeneficiaries(AllianceDto payload) { payload.Beneficiaries.ForEach(x => { if (x.Id != null) { var beneficiary = _context.Beneficiaries.FirstOrDefault(b => b.Id == x.Id); beneficiary.Name = x.Name; beneficiary.Ssn = x.Ssn; beneficiary.BirthDate = x.BirthDate; beneficiary.Gender = x.Gender; beneficiary.Relationship = x.Relationship; beneficiary.Percent = x.Percent; beneficiary.UpdatedAt = DateTime.Now; _context.Beneficiaries.Update(beneficiary); } else { var beneficiary = new Beneficiaries(); beneficiary.AlianzaId = payload.Id; beneficiary.Name = x.Name; beneficiary.Ssn = x.Ssn; beneficiary.BirthDate = x.BirthDate; beneficiary.Gender = x.Gender; beneficiary.Relationship = x.Relationship; beneficiary.Percent = x.Percent; beneficiary.UpdatedAt = DateTime.Now; _context.Beneficiaries.Add(beneficiary); } }); var existing = _context.Beneficiaries.Where(b => b.AlianzaId == payload.Id).ToList(); existing.ForEach(ex => { var exist = payload.Beneficiaries.FirstOrDefault(b => b.Ssn == ex.Ssn); if (exist == null) { ex.DeletedAt = DateTime.Now; _context.Beneficiaries.Update(ex); } }); }
public DailyCitySummary(KinCityData data) { if (data == null) { return; } LogTime = DateTime.Now; Kin = data.ControlingKin.ToString(); City = data.City.ToString(); if (data.CityLeader != null) { Leader = new Player(data.CityLeader as PlayerMobile); } data.BeneficiaryDataList.ForEach(delegate(KinCityData.BeneficiaryData bd) { if (bd.Pm != null) { Beneficiaries.Add(new Player(bd.Pm)); } }); Treasury = data.Treasury; TaxRate = data.TaxRate; NPCFlags = data.NPCCurrentFlags; GuardOption = (int)data.GuardOption; GuardPostSlots = string.Format("{0} | {1}", KinSystem.GetCityGuardPostSlots(data.City), data.UnassignedGuardPostSlots); foreach (KinCityData.BeneficiaryData bd in data.BeneficiaryDataList) { foreach (Items.KinGuardPost gp in bd.GuardPosts) { if (gp != null && !gp.Deleted) { GuardPostData.Add(new GuardPost(gp)); } } } }
private void ExpandAllBeneficiaries() { ShowDetail = !ShowDetail; Beneficiaries.ForEach(ben => ben.IsExpanded = ShowDetail); }
public async Task LoadData() { try { dialogService.ShowProgress(); Clean(); if (loginViewModel.User.AffiliateType == Enumerations.AffiliateType.Beneficiary) { Beneficiaries.Add( new BeneficiaryCertificates { Document = loginViewModel.User.Document, CellPhone = loginViewModel.User.CellPhone, DocumentType = loginViewModel.User.DocumentType, FullNames = $"{loginViewModel.User.NameOne} {loginViewModel.User.NameTwo} {loginViewModel.User.LastNameOne} {loginViewModel.User.LastNameTwo}", DocumentTypeShort = loginViewModel.User.DocumentTypeName, Email = loginViewModel.User.UserName, }); } else { Request request = new Request { Document = loginViewModel.User.Document, DocumentType = loginViewModel.User.DocumentType, IdReference = loginViewModel.User.IdReference, Controller = "Affiliate", Action = "GetUsersCertificate" }; ResponseCertificateBeneficiaries response = new ResponseCertificateBeneficiaries(); response = await apiService.GetUsersCertificate(request); if (response.Success) { Beneficiaries = new ObservableCollection <BeneficiaryCertificates>(response.Beneficiaries); if (loginViewModel.User.AffiliateType == Enumerations.AffiliateType.ResponsiblePayment) { Beneficiaries.Add( new BeneficiaryCertificates { Document = loginViewModel.User.Document, DocumentType = loginViewModel.User.DocumentType, DocumentTypeShort = loginViewModel.User.DocumentTypeName, TypeCertificate = "AFILIACION", FullNames = "Grupo Familiar" }); } } else { await dialogService.ShowMessage(response.Title, response.Message); } } await navigationService.Navigate(AppPages.CertificatesPage); } catch (Exception e) { ServiceLocator.Current.GetInstance <IExceptionService>().RegisterException(e); } finally { dialogService.HideProgress(); } }
public async Task <Alianzas> Create(AllianceDto payload) { var afftype = 1; //setting aff type afftype = await defineAfftype(payload, afftype); //adding productclient to fill required field in aliance var clientProduct = new ClientProduct() { ClientId = payload.ClientId.GetValueOrDefault(), CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now, ProductId = 1, Status = 0 }; await _context.ClientProduct.AddAsync(clientProduct); await _context.SaveChangesAsync(); // creating actual aliance var alianza = new Alianzas() { ClientProductId = clientProduct.Id, QualifyingEventId = payload.QualifyingEventId == null ? 1 : payload.QualifyingEventId.Value, CoverId = payload.CoverId.GetValueOrDefault(), AffType = (byte?)afftype, AffStatus = 1, ElegibleDate = DateTime.Now, StartDate = DateTime.Now, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now, EndDate = DateTime.Now.AddYears(1), Joint = payload.Joint, Prima = payload.Prima }; //TODO: check if the status of the aliance is complete or pending //for the moment is complete await _context.Alianzas.AddAsync(alianza); await _context.SaveChangesAsync(); alianza = await this.UpdateCost(alianza.Id); foreach (var item in payload.Beneficiaries) { var beneficiary = new Beneficiaries() { Name = item.Name, BirthDate = item.BirthDate, Gender = item.Gender, Percent = item.Percent, Relationship = item.Relationship, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now, AlianzaId = alianza.Id, Ssn = item.Ssn }; await _context.Beneficiaries.AddAsync(beneficiary); } foreach (var item in payload.AddonList) { var addonId = item; await _context.AlianzaAddOns.AddAsync(new AlianzaAddOns() { AlianzaId = alianza.Id, InsuranceAddOnId = addonId }); } await _context.SaveChangesAsync(); if (alianza.ClientProduct != null) { alianza.ClientProduct.Client.ClientProduct = null; alianza.ClientProduct.Client.ClientUser = null; alianza.ClientProduct.Client.Dependents = null; alianza.ClientProduct.Client.Cover = null; alianza.ClientProduct.Alianzas = null; } alianza.Cover = null; RemoveCircularDependency(ref alianza); alianza.Beneficiaries = null; return(alianza); }