/// <summary> /// Method Name : UpdateMoveDataAsync /// Author : Hiren Patel /// Creation Date : 1 Feb 2018 /// Purpose : Use for Update move data /// Revision : /// </summary> public async Task UpdateMoveDataAsync() { Move move; move = new Move(); if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); MoveDataModel dtoMoveData = DTOConsumer.dtoMoveData; dtoMoveData.StatusReason = GetMoveStatusReason(estimateModel); loadingOverlay = UIHelper.ShowLoadingScreen(View); APIResponse <MoveDataModel> aPIResponse = await move.PutMoveData(dtoMoveData, estimateModel.MoveNumber); if (aPIResponse.STATUS) { await DTOConsumer.BindMoveDataAsync(); PerformSegue("MoveConfirmedToDashBoard", this); } else { UIHelper.ShowMessage(aPIResponse.Message); } loadingOverlay.Hide(); } }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { viewDepositCollected.Hidden = true; viewTransactionDetails.Hidden = true; estimateModel = DTOConsumer.GetSelectedEstimate(); int stepLenth = 10; if (estimateModel != null) { lblDepositCollected.Text = estimateModel.Deposit; lblTransactionId.Text = estimateModel.TransactionId; SetDataBaseOnPaymentMode(estimateModel); if (estimateModel.IsDepositPaid) { stepLenth = 9; } } if (stepLenth == 10) { imgBigStepNumber.Image = UIImage.FromFile("10.png"); } else { imgBigStepNumber.Image = UIImage.FromFile("09.png"); } UIHelper.CreateWizardHeader(stepLenth, viewHeader, estimateModel); }
/// <summary> /// Method Name : refreshDataForActivePage /// Author : Vivek Bhavsar /// Creation Date : 15 Jan 2018 /// Purpose : for refreshing data based on current active page on pull to refresh(Swipe) /// Revision : /// </summary> private async Task refreshDataForActivePage() { switch (currentPage) { case "Payment": case "Terms": SwipeRefreshLayoutEnable(); break; case "DashBoard": await SetRedirectActivityAsync(); break; case "MyDocument": replaceFragment(new FragmentMyDocuments(), StringResource.msgMyDocuments, StringResource.msgMyDocuments, 0); break; case "MyAccount": replaceFragment(new FragmentMyAccount(), StringResource.msgMyAccount, StringResource.msgMyAccount, 0); break; case "MyMoveDetails": await DTOConsumer.BindMoveDataAsync(); replaceFragment(new FragmentMyMoveDetails(), StringResource.msgMyMoveDetails, StringResource.msgMyMoveDetails, 0); break; default: break; } swipeRefreshLayout.Refreshing = false; }
/// <summary> /// Method Name : SetRedirectActivity /// Author : Sanket Prajapati /// Creation Date : 23 jan 2018 /// Purpose : To Redirect Activity /// Revision : By Vivek Bhavsar on 07 Feb 2018 : Change condition check for estimate wizard /// </summary> private async Task SetRedirectActivityAsync() { await DTOConsumer.BindMoveDataAsync(); if (DTOConsumer.dtoMoveData is null) { replaceFragment(new FragmentDashboard(), StringResource.msgDashboard, StringResource.msgDashboard, 0); } else { if (DTOConsumer.dtoEstimateData != null && DTOConsumer.dtoEstimateData.Count != 0) { if (DTOConsumer.dtoEstimateData.Count == 1) { UIHelper.SelectedMoveNumber = DTOConsumer.dtoEstimateData.FirstOrDefault().MoveNumber; Intent intent = new Intent(this, typeof(ActivityEstimateViewPager)); StartActivity(intent); } else { UIHelper.SelectedMoveNumber = string.Empty; Intent intent = new Intent(this, typeof(MultipleEstimatedActivity)); StartActivity(intent); } } else { SetInActiveImageAndColor(); ImgViewDashboard.SetImageResource(Resource.Drawable.icon_dashboard_active); viewDeshbord.SetBackgroundColor(Color.ParseColor("#ce0a45")); replaceFragment(new FragmentDashboard(), StringResource.msgDashboard, StringResource.msgDashboard, 0); } } }
public async Task <bool> UpdateConsumer(DTOConsumer consumer) { Consumer mapConsumer = _mapper.Map <Consumer>(consumer); _consumerRepository.Update(mapConsumer); bool success = true; try { await _consumerRepository.SaveChanges(); } catch { if (!_consumerRepository.ConsumerExists(consumer.ConsumerID)) { success = false; } else { throw; } } return(success); }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { txtWhatMattersMost.Text = estimateModel.WhatMattersMost; } UIHelper.CreateWizardHeader(5, viewHeader, estimateModel); }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { txtOriginAddress.Text = estimateModel.CustomOriginAddress; txtDestinationAddress.Text = estimateModel.CustomDestinationAddress; } UIHelper.CreateWizardHeader(4, viewHeader, estimateModel); }
public async Task <ActionResult <DTOConsumer> > GetConsumer(int id) { DTOConsumer consumer = await _service.GetConsumer(id); if (consumer == null) { return(NotFound()); } return(consumer); }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null && estimateModel.MyServices != null && string.IsNullOrEmpty(estimateModel.message)) { UIHelper.BindMyServiceData(estimateModel.MyServices, scrollviewServices, View, true); UIHelper.SetDefaultWizardScrollViewBorderProperty(scrollviewServices); } UIHelper.CreateWizardHeader(2, viewHeader, estimateModel); }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { uiWebViewPDF.LoadRequest(new NSUrlRequest(new NSUrl(AppConstant.VIEW_ESTIMATE_URL, true))); uiWebViewPDF.ScalesPageToFit = true; estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { lblEstimateName.Text = estimateModel.MoveNumber; } }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { txtCost.Text = estimateModel.ValuationCost; txtCoverageValue.Text = estimateModel.ValuationDeductible; txtDeclaredValue.Text = estimateModel.ExcessValuation; } UIHelper.CreateWizardHeader(6, viewHeader, estimateModel); }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { webViewPDF.LoadRequest(new NSUrlRequest(new NSUrl(AppConstant.VITAL_INFORMATION_DOCUMENT_URL, true))); webViewPDF.ScalesPageToFit = true; if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); } UIHelper.CreateWizardHeader(7, viewHeader, estimateModel); }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { txtEstimatedCost.Text = estimateModel.EstimatedLineHaul; } } UIHelper.CreateWizardHeader(1, viewHeader, estimateModel); }
/// <summary> /// Method Name : SaveDatesToDTO /// Author : Hiren Patel /// Creation Date : 31 Jan 2017 /// Purpose : Save date to DTO /// Revision : /// </summary> private void SaveDataToDTO() { if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { estimateModel.WhatMattersMost = txtWhatMattersMost.Text; estimateModel.IsWhatMatterMostEdited = true; } } }
/// <summary> /// Method Name : SaveDatesToDTO /// Author : Hiren Patel /// Creation Date : 31 Jan 2017 /// Purpose : Save date to DTO /// Revision : /// </summary> private void SaveDataToDTO() { if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { estimateModel.CustomOriginAddress = txtOriginAddress.Text; estimateModel.CustomDestinationAddress = txtDestinationAddress.Text; estimateModel.IsAddressEdited = true; } } }
public async Task <IActionResult> AddConsumer(DTOConsumer consumer) { bool success = await _service.AddConsumer(consumer); if (success) { return(Ok()); } else { return(BadRequest()); } }
public async Task <IActionResult> UpdateConsumer(DTOConsumer consumer) { bool success = await _service.UpdateConsumer(consumer); if (success) { return(Ok()); } else { return(NotFound()); } }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { if (!estimateModel.IsDepositPaid) { estimateModel.Deposit = CurrencyFormat(estimateModel.DepositValue); } lblDepositAmountValue.Text = estimateModel.Deposit; } UIHelper.CreateWizardHeader(9, viewStepsProgressBar, estimateModel); }
/// <summary> /// Method Name : SaveDatesToDTO /// Author : Hiren Patel /// Creation Date : 31 Jan 2017 /// Purpose : Save date to DTO /// Revision : /// </summary> private void SaveDataToDTO() { if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { estimateModel.PackStartDate = txtPackDate.Text; estimateModel.LoadStartDate = txtLoadDate.Text; estimateModel.MoveStartDate = txtMoveDate.Text; estimateModel.IsServiceDate = true; } } }
/// <summary> /// Method Name : SaveDatesToDTO /// Author : Hiren Patel /// Creation Date : 31 Jan 2017 /// Purpose : Save date to DTO /// Revision : /// </summary> private void SaveDataToDTO() { if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { estimateModel.ExcessValuation = txtDeclaredValue.Text; estimateModel.ValuationDeductible = txtCoverageValue.Text; estimateModel.ValuationCost = txtCost.Text; estimateModel.IsValuationEdited = true; } } }
/// <summary> /// Method Name : SetRedirectActivity /// Author : Sanket Prajapati /// Creation Date : 2 Dec 2017 /// Purpose :To Redirect Activity /// Revision : /// </summary> private async Task SetRedirectActivityAsync(ServiceResponse serviceResponse) { if (serviceResponse.Status) { SetSharedPreference(); await DTOConsumer.BindMoveDataAsync(); SetMoveActivity(); } else { StartActivity(new Intent(this, typeof(PrivacyPolicyActivity))); } }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { txtPackDate.Text = estimateModel.PackStartDate; txtLoadDate.Text = estimateModel.LoadStartDate; txtMoveDate.Text = estimateModel.MoveStartDate; } } UIHelper.CreateWizardHeader(3, viewHeader, estimateModel); }
/// <summary> /// Event Name : BtnContinue_TouchUpInside /// Author : Hiren Patel /// Creation Date : 29 Dec 2017 /// Purpose : confirmed edited data and redirect to move confimned screen. /// Revision : /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event Argument</param> private async void BtnContinue_TouchUpInside(object sender, EventArgs e) { if ((isServiceDateEdited && scrollViewDate.Hidden == false) || (isAddressesEdited && scrollviewAddresses.Hidden == false) || (isValuationEdited && scrollviewValuation.Hidden == false) || (isWhatMatterMostEdited && scrollviewWhatMattersMost.Hidden == false)) { int buttonIndex = await UIHelper.ShowMessageWithOKConfirm(string.Empty, AppConstant.ACKNOWLEDGEMENT_SAVE_DATA_CONFIRM_MESSAGE, AppConstant.CONIRM_YES_BUTTON_TEXT, AppConstant.CONIRM_NO_BUTTON_TEXT); if (buttonIndex == 0) { string message = IsValidAllData(); if (!string.IsNullOrEmpty(message)) { UIHelper.ShowMessage(message); return; } else { SaveServiceDatesToDTO(); SaveAddressesToDTO(); SaveValuationDataToDTO(); SaveWhatMattersMostDataToDTO(); } } } if (btnIagree.Tag == 0) { UIHelper.ShowMessage(AppConstant.WIZARD_DISAGREE_MESSAGE); } else { if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { if (estimateModel.IsDepositPaid) { PerformSegue("acknowledgementToMoveConfirm", this); } else { PerformSegue("acknowledgementToDeposit", this); } } } } }
public async Task <bool> AddConsumer(DTOConsumer consumer) { Consumer mapConsumer = _mapper.Map <Consumer>(consumer); _consumerRepository.Add(mapConsumer); bool success = true; try { await _consumerRepository.SaveChanges(); } catch { success = false; } return(success); }
///// <summary> ///// Event Name : BindingDataAsync ///// Author : Sanket Prajapati ///// Creation Date : 23 jan 2018 ///// Purpose : Open next activity after splash screen ///// Revision : ///// </summary> private async Task BindingDataAsync() { if (customerID == null) { StartActivity(new Intent(this, typeof(LoginActivity))); } else { UtilityPCL.LoginCustomerData.CustomerId = customerID; UtilityPCL.LoginCustomerData.LastLoginDate = DateTime.Now; await DTOConsumer.GetCustomerProfileData(); await DTOConsumer.BindMoveDataAsync(); SetMoveActivity(); } // StartActivity(new Intent(this, typeof(ActivityMoveConfirmed))); }
/// <summary> /// Method Name : SetRedirectActivity /// Author : Sanket Prajapati /// Creation Date : 2 Dec 2017 /// Purpose :To Redirect Activity /// Revision : /// </summary> private async Task SetRedirectActivityAsync(ServiceResponse serviceResponse, bool IsAgree) { if (serviceResponse.Status) { SetSharedPreference(); if (IsAgree) { await DTOConsumer.BindMoveDataAsync(); SetMoveActivity(); } } else { Intent intent = new Intent(this, typeof(ContactusActivity)); intent.PutExtra(StringResource.msgFromActvity, StringResource.msgPrivacyPolicyActivity); StartActivity(intent); } }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { scrollViewDate.Hidden = true; scrollviewAddresses.Hidden = true; scrollviewValuation.Hidden = true; scrollviewWhatMattersMost.Hidden = true; estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { PopulateServicesDates(estimateModel); PopulateAddressesData(estimateModel); PopulateValuatiosData(estimateModel); PopulateWhatMattersMost(estimateModel); } UIHelper.CreateWizardHeader(8, viewHeader, estimateModel); }
/// Method Name : UpdateMoveDataAsync /// Author : Sanket Prajapati /// Creation Date : 12 Dec 2017 /// Purpose : Use for Update move data /// Revision : /// </summary> public async Task UpdateMoveDataAsync() { Move move; move = new Move(); dtoMoveData.StatusReason = GetMoveStatusReason(estimateModel); APIResponse <MoveDataModel> aPIResponse = await move.PutMoveData(dtoMoveData, estimateModel.MoveNumber); if (aPIResponse.STATUS) { AlertMessage(StringResource.msgEstimateUpdate); await DTOConsumer.BindMoveDataAsync(); StartActivity(new Intent(Activity, typeof(MainActivity))); } else { AlertMessage(aPIResponse.Message); } }
/// <summary> /// Event Name : CallMyAccountService /// Author : Hiren Patel /// Creation Date : 13 Dec 2017 /// Purpose : Calls my account service to update account data /// Revision : /// </summary> /// <param name="privacyPolicyModel">Privacy policy model.</param> private async Task CallMyAccountService(PrivacyPolicyModel privacyPolicyModel) { string errorMessage = string.Empty; LoadingOverlay objectLoadingScreen = UIHelper.ShowLoadingScreen(View); try { APIResponse <PrivacyPolicyModel> serviceResponse = await myAccountService.PutMyAccountDetails(privacyPolicyModel); if (serviceResponse.STATUS) { await UIHelper.ShowMessageWithOKConfirm(string.Empty, serviceResponse.Message, AppConstant.ALERT_OK_BUTTON_TEXT); btnOkay.Tag = 0; btnOkay.SetTitle(AppConstant.MYACCOUNT_OK_BUTTON_TEXT, UIControlState.Normal); this.TabBarController.SelectedIndex = 0; this.TabBarController.TabBar.Hidden = false; await DTOConsumer.GetCustomerProfileData(); } else { errorMessage = serviceResponse.Message; } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { UIHelper.ShowAlertMessage(this, errorMessage); } objectLoadingScreen.Hide(); } }
private void CreateHeader() { estimateModel = DTOConsumer.GetSelectedEstimate(); UIHelper.CreateWizardHeader(8, viewHeader, estimateModel); }