/// <summary> /// Method Name : PopulateValuatiosData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateValuatiosData(EstimateModel estimateModel) { txtCost.Text = UtilityPCL.RemoveCurrencyFormat(estimateModel.ExcessValuation); txtCoverageValue.Text = estimateModel.ValuationDeductible; txtDeclaredValue.Text = UtilityPCL.RemoveCurrencyFormat(estimateModel.ValuationCost); SetChangedUnChangedImage(imgValuation, estimateModel.IsValuationEdited); }
/// Method Name : SetEditModeViewSwitcherClick /// Author : Sanket Prajapati /// Creation Date : 2 Dec 2017 /// Purpose : Use for ViewSwitcher switch layout /// Revision : /// </summary> private void SetEditModeViewSwitcherClick() { tvUpdatedneedes.Click += delegate { if (viewSwitcher.CurrentView == linearLayoutDisplay) { viewSwitcher.ShowNext(); txtDeclaredvalue.Text = UtilityPCL.RemoveCurrencyFormat(tvDisplayDeclaredvalue.Text); var list = UtilityPCL.ValuationDeductibleList(); valuationDeductible = new ValuationDeductibleModel(); valuationDeductible = list.FirstOrDefault(rc => rc.DeductibleName == tvDisplayCoverage.Text); if (valuationDeductible != null) { spinnerCoverage.SetSelection(valuationDeductible.Index); } else { spinnerCoverage.SetSelection(1); } txtCost.Text = UtilityPCL.RemoveCurrencyFormat(tvDisplayCost.Text); tvBack.Text = StringResource.wizBtnCancel; tvNext.Text = StringResource.wizBtnNextStep; } }; tvSubmitChanges.Click += delegate { if (viewSwitcher.CurrentView == linearLayoutEdit && Validation()) { viewSwitcher.ShowPrevious(); tvDisplayDeclaredvalue.Text = UtilityPCL.CurrencyFormat(txtDeclaredvalue.Text); if (valuationDeductible != null) { tvDisplayCoverage.Text = valuationDeductible.DeductibleName; } else { var list = UtilityPCL.ValuationDeductibleList(); valuationDeductible = new ValuationDeductibleModel(); valuationDeductible = list.FirstOrDefault(rc => rc.DeductibleName == tvDisplayCoverage.Text); tvDisplayCoverage.Text = valuationDeductible.DeductibleName; } tvDisplayCost.Text = UtilityPCL.CurrencyFormat(txtCost.Text); EditData(); tvBack.Text = StringResource.wizBtnBack; tvNext.Text = StringResource.wizYesCapturedCorrectly; } }; }
/// <summary> /// Method Name : SetEstimateData /// Author : Ranjana Singh /// Creation Date : 08 Feb 2018 /// Purpose : Set Estimate Data. /// Revision : /// </summary> private void PopulateEstimateData() { textViewDateEditPack.Text = estimateModel.PackStartDate; textViewDateEditLoad.Text = estimateModel.LoadStartDate; textViewDateEditMove.Text = estimateModel.MoveStartDate; editTextAddressOrigin.Text = estimateModel.CustomOriginAddress; editTextAddressDestination.Text = estimateModel.CustomDestinationAddress; editTextWhatMattersMost.Text = estimateModel.WhatMattersMost; txtDeclaredvalue.Text = UtilityPCL.RemoveCurrencyFormat(estimateModel.ExcessValuation); txtCost.Text = UtilityPCL.RemoveCurrencyFormat(estimateModel.ValuationCost); txtCost.LongClickable = false; }
/// <summary> /// Method Name : EditData /// Author : Sanket Prajapati /// Creation Date : 2 Dec 2017 /// Purpose : Edit Estimate Data /// Revision : /// </summary> public void EditData() { if (estimateModel != null && string.IsNullOrEmpty(estimateModel.message)) { int index; estimateModel.ExcessValuation = UtilityPCL.RemoveCurrencyFormat(txtDeclaredvalue.Text); estimateModel.ValuationCost = txtCost.Text; if (valuationDeductible != null) { estimateModel.ValuationDeductible = valuationDeductible.DeductibleCode; } estimateModel.IsValuationEdited = true; index = DTOConsumer.dtoEstimateData.IndexOf(estimateModel); DTOConsumer.dtoEstimateData[index] = estimateModel; } }
/// <summary> /// Method Name : PopulateData /// Author : Sanket Prajapati /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { if (estimateModel != null && string.IsNullOrEmpty(estimateModel.message)) { tvDespositAmmount.Text = UtilityPCL.CurrencyFormat(estimateModel.Deposit); estimateModel.Deposit = UtilityPCL.RemoveCurrencyFormat(estimateModel.Deposit); estimateModel.EstimatedLineHaul = UtilityPCL.RemoveCurrencyFormat(estimateModel.EstimatedLineHaul); if (estimateModel.PaymentStatus) { linearLayoutTransaction.Visibility = ViewStates.Visible; tvDisplayTransactionId.Text = estimateModel.TransactionId; } else { linearLayoutTransaction.Visibility = ViewStates.Gone; tvDisplayTransactionId.Text = string.Empty; } } }
/// <summary> /// Method Name : ResetControlEditMode /// Author : Hiren Patel /// Creation Date : 31 Jan 2018 /// Purpose : Resets the control edit mode. /// Revision : /// </summary> private void ResetControlEditMode() { SetTapEventToCoverageLabel(); imgSubmitCheck.Hidden = false; txtCoverageValue.UserInteractionEnabled = true; UIHelper.SetSubmitButtonProperty(btnUpdatesNeed); btnUpdatesNeed.SetTitle(AppConstant.SUBMIT_CHANGES_BUTTON_LABEL, UIControlState.Normal); SetEditableTextControl(true); if (!string.IsNullOrEmpty(txtDeclaredValue.Text)) { txtDeclaredValue.Text = UtilityPCL.RemoveCurrencyFormat(txtDeclaredValue.Text); } if (!string.IsNullOrEmpty(txtCost.Text)) { txtCost.Text = UtilityPCL.RemoveCurrencyFormat(txtCost.Text); } }
/// <summary> /// Event Name : BtnMakePayment_TouchUpInsidet /// Author : Hiren Patel /// Creation Date : 23 Feb 2018 /// Purpose : To redirec to back screen as valuation. /// Revision : /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event Argument</param> private async void BtnMakePayment_TouchUpInside(object sender, EventArgs e) { PaymentGatewayModel paymentGatewayModel = new PaymentGatewayModel(); UIHelper.BindCardHolderNameToPaymentModel(paymentGatewayModel, txtNameOfCardHolder.Text); UIHelper.BindCardNumberToPaymentModel(paymentGatewayModel, txtCardNumber.Text); UIHelper.BindCVVToPaymentModel(paymentGatewayModel, txtCVV.Text); UIHelper.BindExpiryDateToPaymentModel(paymentGatewayModel, txtExpiredDate.Text); UIHelper.BindDepositToPaymentModel(paymentGatewayModel, txtAmount.Text); paymentGatewayModel.CustomerID = UtilityPCL.LoginCustomerData.CustomerId; paymentGatewayModel.EmailID = UtilityPCL.LoginCustomerData.EmailId; if (!string.IsNullOrEmpty(txtAmount.Text)) { paymentGatewayModel.TransactionAmout = Convert.ToDouble(txtAmount.Text); double totlDueAmount = Convert.ToDouble(UtilityPCL.RemoveCurrencyFormat(lblTotalDue.Text)); if (paymentGatewayModel.TransactionAmout > totlDueAmount) { UIHelper.ShowMessage(AppConstant.PAYMENT_TOTAL_DUE_AMOUNT_LESS_THAN_TOTAL_COST); return; } } else { UIHelper.ShowMessage(AppConstant.PAYMENT_TRANSACTION_AMOUNT_IS_REQUIRED); return; } string message = estimateValidateServices.ValidatePaymentModel(paymentGatewayModel); if (string.IsNullOrEmpty(message)) { await callPaymentService(paymentGatewayModel); } else { UIHelper.ShowMessage(message); } }
/// <summary> /// Method Name : UpdateMoveDataAsync /// Author : Hiren Patel /// Creation Date : 1 Feb 2018 /// Purpose : Removes the currency format. /// Revision : /// </summary> public void RemoveCurrencyFormat() { if (estimateModel != null) { if (!string.IsNullOrEmpty(estimateModel.ExcessValuation)) { estimateModel.ExcessValuation = UtilityPCL.RemoveCurrencyFormat(estimateModel.ExcessValuation); } if (!string.IsNullOrEmpty(estimateModel.ValuationCost)) { estimateModel.ValuationCost = UtilityPCL.RemoveCurrencyFormat(estimateModel.ValuationCost); } if (!string.IsNullOrEmpty(estimateModel.Deposit)) { estimateModel.Deposit = UtilityPCL.RemoveCurrencyFormat(estimateModel.Deposit); } if (!string.IsNullOrEmpty(estimateModel.EstimatedLineHaul)) { estimateModel.EstimatedLineHaul = UtilityPCL.RemoveCurrencyFormat(estimateModel.EstimatedLineHaul); } } }