private void EditAccountOptions_SelectedIndexChanged(object sender, EventArgs e) { if (EditAccountOptions.SelectedItem == "Change Password") { ChangePassword changePasswordPage = new ChangePassword(); changePasswordPage.userAccount = this.userAccount; changePasswordPage.Show(); } if (EditAccountOptions.SelectedItem == "Check Member Status") { CheckMemberStatus memStatusPage = new CheckMemberStatus(); memStatusPage.userAccount = this.userAccount; memStatusPage.Show(); } if (EditAccountOptions.SelectedItem == "Edit Account Info") { EditAccountInfo editInfoPage = new EditAccountInfo(); editInfoPage.userAccount = this.userAccount; editInfoPage.Show(); } if (EditAccountOptions.SelectedItem == "Manage Payment Methods") { ManagePaymentMethods changePaymentPage = new ManagePaymentMethods(); changePaymentPage.userAccount = this.userAccount; changePaymentPage.Show(); } if (EditAccountOptions.SelectedItem == "Update Address") { UpdateAddress updateAddressPage = new UpdateAddress(); updateAddressPage.userAccount = this.userAccount; updateAddressPage.Show(); } }
public Task Handle(object Command) { return(Command switch { AddAddress cmd => HandleCreate(cmd), UpdateAddress cmd => HandleUpdate(cmd.Id, c => c.AddressUpdate(cmd.CustomerId, cmd.Street, cmd.Zip, cmd.City, cmd.Country)), DeleteAddress cmd => HandleDelete(cmd.Id), _ => Task.CompletedTask });
public async Task <IActionResult> UpdateAddressAsync([FromBody] UpdateAddress updateAddress) { var instituteId = await GetUserCurrentSelectedInstituteIdAsync(); if (await iMSDbContext.LocationAddressModels.AnyAsync(x => x.Id == updateAddress.Id && x.InstituteId == instituteId)) { return(Ok(await addressManagementRepository.UpdateComponentAsync(updateAddress, instituteId))); } else { return(Ok(new SharedLookUpResponse() { HasError = true, ErrorType = SharedLookUpResponseType.Code, Message = "Location not found" })); } }
public async Task <SharedLookUpResponse> UpdateComponentAsync(UpdateAddress updateComponentAc, int instituteId) { var componentGroup = await iMSDbContext.LocationAddressModels.FirstAsync(x => x.Id == updateComponentAc.Id); componentGroup.CountryId = updateComponentAc.CountryId; componentGroup.StateId = updateComponentAc.StateId; componentGroup.CityId = updateComponentAc.CityId; componentGroup.Address1 = updateComponentAc.Address1; componentGroup.Address2 = updateComponentAc.Address2; componentGroup.ZipCode = updateComponentAc.ZipCode; componentGroup.Description = updateComponentAc.Description; iMSDbContext.LocationAddressModels.Update(componentGroup); await iMSDbContext.SaveChangesAsync(); return(new SharedLookUpResponse() { HasError = false, Message = "Address updated successfully" }); }
protected void Item_Command(object sender, CommandEventArgs e) { int index; switch (e.CommandName) { case "edit": EditItemIndex = Convert.ToInt32(e.CommandArgument); EditAddress?.Invoke(this, new EditAddressEventArgs() { ItemIndex = EditItemIndex, AddressID = GetAddressID(EditItemIndex) }); break; case "cancel": EditItemIndex = -1; EditAddress?.Invoke(this, new EditAddressEventArgs() { ItemIndex = EditItemIndex, AddressID = 0 }); break; case "update": var item = GetUpdateItem(); index = EditItemIndex; EditItemIndex = -1; UpdateAddress?.Invoke(this, new UpdateAddressEventArgs() { ItemIndex = index, Item = item }); break; case "delete": index = Convert.ToInt32(e.CommandArgument); EditItemIndex = -1; DeleteAddress?.Invoke(this, new EditAddressEventArgs() { ItemIndex = index, AddressID = GetAddressID(index) }); break; } }
public async Task <User> UpdateAddress(int userId, UpdateAddress updateAddressVM) { var user = await _repository.Get(userId); if (user == null) { throw new NotFoundException(); } user.Address = updateAddressVM.Address; user.Address2 = updateAddressVM.Address2; user.City = updateAddressVM.City; user.State = updateAddressVM.State; user.Country = updateAddressVM.Country; user.ZipCode = updateAddressVM.ZipCode; await _repository.Update(user); return(user); }
/// <summary> /// NavBox OnAction Handler for Update Address /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void updateAddressFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Update Address form navigation action handler received invalid data"); } NavBox addrNavBox = (NavBox)sender; UpdateAddress addrForm = (UpdateAddress)data; NavBox.NavAction lookupAction = addrNavBox.Action; switch (lookupAction) { case NavBox.NavAction.BACK: this.nextState = PoliceHoldReleaseFlowState.ManageCustomer; break; case NavBox.NavAction.BACKANDSUBMIT: GlobalDataAccessor.Instance.DesktopSession.HistorySession.Desktop(); this.nextState = PoliceHoldReleaseFlowState.PoliceHoldReleaseInfo; break; case NavBox.NavAction.HIDEANDSHOW: addrForm.Hide(); this.nextState = PoliceHoldReleaseFlowState.UpdatePhysicalDescription; break; case NavBox.NavAction.CANCEL: this.nextState = PoliceHoldReleaseFlowState.Cancel; break; default: throw new ApplicationException("" + lookupAction.ToString() + " is not a valid state for Update Address"); } this.executeNextState(); }
public async Task <IActionResult> UpdateAddress(UpdateAddress command) { await _busPublisher.SendAsync(command, null); return(Accepted()); }
/// <summary> /// Main execution function for PoliceHoldReleaseFlowExecutor /// </summary> /// <param name="inputData"></param> /// <returns></returns> private object executorFxn(object inputData) { if (inputData == null) { return(false); } PoliceHoldReleaseFlowState inputState = (PoliceHoldReleaseFlowState)inputData; switch (inputState) { case PoliceHoldReleaseFlowState.LookupCustomer: ShowForm lookupCustBlk = CommonAppBlocks.Instance.CreateLookupCustomerShowBlock(this.parentForm, this.lookupCustFormNavAction); if (!lookupCustBlk.execute()) { throw new ApplicationException("Cannot execute LookupCustomer block"); } break; case PoliceHoldReleaseFlowState.LookupCustomerResults: ShowForm lookupCustResBlk = CommonAppBlocks.Instance.CreateLookupCustomerResultsBlock(this.parentForm, this.lookupCustResultsFormNavAction); if (!lookupCustResBlk.execute()) { throw new ApplicationException("Cannot execute LookupCustomerResults block"); } break; case PoliceHoldReleaseFlowState.PoliceHoldReleaseList: ShowForm custHoldRelListBlk = CommonAppBlocks.Instance.CreatePoliceHoldReleaseListShowBlock(this.parentForm, this.policeHoldReleaseListFormNavAction); if (!custHoldRelListBlk.execute()) { throw new ApplicationException("Cannot execute Police Hold Release List block"); } break; case PoliceHoldReleaseFlowState.PoliceHoldReleaseInfo: ShowForm custHoldRelInfoBlk = CommonAppBlocks.Instance.CreatePoliceHoldReleaseInfoShowBlock(this.parentForm, this.policeHoldReleaseInfoFormNavAction); if (!custHoldRelInfoBlk.execute()) { throw new ApplicationException("Cannot execute Police Hold Release Info block"); } break; case PoliceHoldReleaseFlowState.PoliceHoldReleaseToClaimant: //Clear Previous Customer Srch Data DF 0028 GlobalDataAccessor.Instance.DesktopSession.ActiveLookupCriteria = new LookupCustomerSearchData(); ShowForm policeHoldRelToClaimantBlk = CommonAppBlocks.Instance.CreatePoliceHoldReleaseInfoShowBlock(this.parentForm, this.policeHoldReleaseInfoFormNavAction); if (!policeHoldRelToClaimantBlk.execute()) { throw new ApplicationException("Cannot execute Police Hold Release Info block"); } //Set the release to claimant property to true ((PoliceHoldRelease)policeHoldRelToClaimantBlk.ClassForm).ReleaseToClaimant = true; break; case PoliceHoldReleaseFlowState.ManageCustomer: CreateCustomer createCustFrm = new CreateCustomer(); Form currForm = GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup(createCustFrm); if (currForm.GetType() == typeof(CreateCustomer)) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); } else { ShowForm createCustBlk = CommonAppBlocks.Instance.CreateCreateCustomerBlock(this.parentForm, this.createCustFormNavAction); if (!createCustBlk.execute()) { throw new ApplicationException("Cannot execute Create Customer block"); } } break; case PoliceHoldReleaseFlowState.UpdateAddress: UpdateAddress addrFrm = new UpdateAddress(); Form currentaddForm = GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup(addrFrm); if (currentaddForm.GetType() == typeof(UpdateAddress)) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); } else { ShowForm updateAddrBlk = CommonAppBlocks.Instance.UpdateAddressShowFormBlock(this.parentForm, this.updateAddressFormNavAction); if (!updateAddrBlk.execute()) { throw new ApplicationException("Cannot execute Update Addess Form block"); } } break; case PoliceHoldReleaseFlowState.UpdatePhysicalDescription: ShowForm updatePhysDescBlk = CommonAppBlocks.Instance.UpdatePhysDescShowFormBlock(this.parentForm, this.updatePhysicalDescFormNavAction); if (!updatePhysDescBlk.execute()) { throw new ApplicationException("Cannot execute Update Physical Description block"); } break; case PoliceHoldReleaseFlowState.Cancel: //Clear the customer from session GlobalDataAccessor.Instance.DesktopSession.ClearCustomerList(); if (this.endStateNotifier != null) { this.endStateNotifier.execute(); } break; default: throw new ApplicationException("Invalid Police Hold release flow state"); } return(true); }
/// <summary> /// Main execution function for LookupCustomerFlowExecutor /// </summary> /// <param name="inputData"></param> /// <returns></returns> private object executorFxn(object inputData) { if (inputData == null) { inputData = LookupCustomerFlowState.LookupCustomer; } LookupCustomerFlowState inputState = (LookupCustomerFlowState)inputData; if (GlobalDataAccessor.Instance.DesktopSession.StartNewPawnLoan) { inputState = LookupCustomerFlowState.NewPawnLoanFlow; } switch (inputState) { case LookupCustomerFlowState.LookupCustomer: ShowForm lookupCustBlk = CommonAppBlocks.Instance.CreateLookupCustomerShowBlock(this.parentForm, this.lookupCustFormNavAction); if (!lookupCustBlk.execute()) { throw new ApplicationException("Cannot execute LookupCustomer block"); } break; case LookupCustomerFlowState.LookupCustomerResults: ShowForm lookupCustResBlk = CommonAppBlocks.Instance.CreateLookupCustomerResultsBlock(this.parentForm, this.lookupCustResultsFormNavAction); if (!lookupCustResBlk.execute()) { throw new ApplicationException("Cannot execute LookupCustomerResults block"); } break; case LookupCustomerFlowState.AddCustomer: //not sure how this trigger will be set if (GlobalDataAccessor.Instance.DesktopSession.HistorySession.Trigger.Equals(Commons.TriggerTypes.MANAGEITEMRELEASE, StringComparison.OrdinalIgnoreCase)) { CreateCustomer createCustFrm = new CreateCustomer(); Form currForm = GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup(createCustFrm); if (currForm.GetType() == typeof(CreateCustomer)) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); } else { ShowForm createCustBlk = CommonAppBlocks.Instance.CreateCreateCustomerBlock(this.parentForm, this.createCustFormNavAction); if (!createCustBlk.execute()) { throw new ApplicationException("Cannot execute Create Customer block"); } } } else //if (CashlinxDesktopSession.Instance.HistorySession.Trigger.Equals("newpawnloan", StringComparison.OrdinalIgnoreCase)) { ShowForm manageCustBlk = CommonAppBlocks.Instance.CreateManagePawnApplicationBlock(this.parentForm, this.managePawnAppFormNavAction); if (!manageCustBlk.execute()) { throw new ApplicationException("Cannot execute Manage Pawn Application block"); } } break; case LookupCustomerFlowState.ManagePawnApplication: ShowForm manageCustAppBlk = CommonAppBlocks.Instance.CreateManagePawnApplicationBlock(this.parentForm, this.managePawnAppFormNavAction); if (!manageCustAppBlk.execute()) { throw new ApplicationException("Cannot execute Manage Pawn Application block"); } break; case LookupCustomerFlowState.ExistingCustomer: ShowForm existCustBlk = CommonAppBlocks.Instance.CreateExistingCustomerBlock(this.parentForm, this.existCustomerFormNavAction); if (!existCustBlk.execute()) { throw new ApplicationException("Cannot execute ExistingCustomer block"); } break; case LookupCustomerFlowState.ViewPawnCustomerInfoReadOnly: ShowForm viewCustInfoReadOnlyBlk = CommonAppBlocks.Instance.ViewCustomerInfoShowBlock(this.parentForm, this.viewCustFormNavAction); if (!viewCustInfoReadOnlyBlk.execute()) { throw new ApplicationException("Cannot execute View customer information block"); } CommonAppBlocks.Instance.ShowFlowTabController(this.parentForm, viewCustInfoReadOnlyBlk.ClassForm, FlowTabController.State.Customer); CommonAppBlocks.Instance.HideTabInFlowTab(FlowTabController.State.ItemHistory); CommonAppBlocks.Instance.HideTabInFlowTab(FlowTabController.State.ProductsAndServices); CommonAppBlocks.Instance.HideTabInFlowTab(FlowTabController.State.ProductHistory); CommonAppBlocks.Instance.HideTabInFlowTab(FlowTabController.State.Stats); ((ViewCustomerInformation)viewCustInfoReadOnlyBlk.ClassForm).ShowReadOnly = true; break; case LookupCustomerFlowState.UpdateAddress: UpdateAddress addrFrm = new UpdateAddress(); Form currentaddForm = GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup(addrFrm); if (currentaddForm.GetType() == typeof(UpdateAddress)) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); } else { ShowForm updateAddrBlk = CommonAppBlocks.Instance.UpdateAddressShowFormBlock(this.parentForm, this.updateAddressFormNavAction); if (!updateAddrBlk.execute()) { throw new ApplicationException("Cannot execute Update Addess Form block"); } } break; case LookupCustomerFlowState.UpdatePhysicalDescription: ShowForm updatePhysDescBlk = CommonAppBlocks.Instance.UpdatePhysDescShowFormBlock(this.parentForm, this.updatePhysicalDescFormNavAction); if (!updatePhysDescBlk.execute()) { throw new ApplicationException("Cannot execute Update Physical Description block"); } break; case LookupCustomerFlowState.PawnCustInformation: //Initiate the child workflow GlobalDataAccessor.Instance.DesktopSession.TabStateClicked = FlowTabController.State.None; GlobalDataAccessor.Instance.DesktopSession.AppController.invokeWorkflow(PAWNCUSTINFOFLOW, this.parentForm, this.endStateNotifier, this); break; case LookupCustomerFlowState.NewPawnLoanFlow: //Initiate the child workflow for new pawn loan GlobalDataAccessor.Instance.DesktopSession.TabStateClicked = FlowTabController.State.None; GlobalDataAccessor.Instance.DesktopSession.AppController.invokeWorkflow(NEWPAWNLOANFLOW, this.parentForm, this.endStateNotifier, this); break; case LookupCustomerFlowState.Cancel: CommonAppBlocks.Instance.HideFlowTabController(); if (this.endStateNotifier != null) { this.endStateNotifier.execute(); } break; } return(true); }