/// <summary> /// Method Name : SetStatusCode /// Author : Vivek Bhavsar /// Creation Date : 23 Jan 2018 /// Purpose : sub method to set status code /// Revision : /// </summary> /// <param name="dtoEstimate"></param> private void SetStatusCode(EstimateModel dtoEstimate) { if (!string.IsNullOrEmpty(dtoEstimate.StatusReason)) { dtoEstimate.StatusReason = UtilityPCL.GetMoveDataDisplayValue(dtoEstimate.StatusReason, MoveDataDisplayResource.msgMoveCode); } }
/// <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); }
/// <summary> /// Method Name : ValidateDepositModel /// Author : Hiren Patel /// Creation Date : 31 Jan 2018 /// Purpose : Validates the valuation data. /// Revision : /// </summary> /// <returns>The valuation data.</returns> /// <param name="declaredValue">Declared value.</param> /// <param name="valuationDeductible">Valuation deductible.</param> /// <param name="cost">Cost.</param> public string ValidateDepositData(string nameOfCardholder, string cardNumber, string expiryDate, string CVV) { string errorMessage = string.Empty; decimal number; if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(nameOfCardholder)) { return(Resource.msgCardHolderNameIsRequired); } else if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(cardNumber)) { return(Resource.msgCardNumberIsRequired); } else if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(expiryDate)) { return(Resource.msgCardExpiryDateIsRequired); } else if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(CVV)) { return(Resource.msgCardCCVIsRequired); } else { if (!Decimal.TryParse(CVV, out number)) { return(Resource.msgCCVValueIsNumeric); } } return(errorMessage); }
/// <summary> /// Method Name : MoveDataResponse /// Author : Sanket Prajapati /// Creation Date : 22 jan 2018 /// Purpose : Get move data response /// Revision : /// </summary> private static void MoveDataResponse(string retMessage, APIResponse <MoveDataModel> response) { if (response.STATUS) { if (response.DATA is null) { retMessage = Resource.msgDashboardNotLoad; } else { if (!UtilityPCL.IsMoveActive(response.DATA.IsActive)) { retMessage = response.Message; } else { dtoMoveData = response.DATA; dtoMoveData.response_status = true; } } } else { retMessage = response.Message; // Added by Hiren Patel dtoMoveData.response_status = false; } }
public string ValidatePaymentModel(PaymentGatewayModel paymentGatewayModel) { string errorMessage = string.Empty; if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(paymentGatewayModel.FirstName)) { return(Resource.msgCardFirstNameIsRequired); } else if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(paymentGatewayModel.LastName)) { return(Resource.msgCardLastNameIsRequired); } else if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(paymentGatewayModel.CreditCardNumber)) { return(Resource.msgCardNumberIsRequired); } else if (!ValidateCardNumber(paymentGatewayModel.CreditCardNumber.Replace(" ", "").Replace("-", ""))) { return(Resource.msgInvalidCardNumber); } else if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(paymentGatewayModel.CardExpiryDate)) { return(Resource.msgCardExpiryDateIsRequired); } else if (paymentGatewayModel.CVVNo == -1) { return(Resource.msgCardCCVIsRequired); } return(errorMessage); }
/// <summary> /// Methode Name : CalculateDueAmountToPaymentModel /// Author : Hiren Patel /// Creation Date : 23 Feb 2018 /// Purpose : Calculates the due amount to payment model. /// Revision : /// </summary> private void CalculateDueAmountToPaymentModel() { decimal totalCost = 0; decimal totalPaid = 0; decimal transactionAmount = 0; if (!string.IsNullOrEmpty(paymentModel.TransactionAmount)) { transactionAmount = Convert.ToDecimal(paymentModel.TransactionAmount); } if (!string.IsNullOrEmpty(paymentModel.TotalCost)) { totalCost = Convert.ToDecimal(paymentModel.TotalCost); } if (!string.IsNullOrEmpty(paymentModel.TotalPaid)) { totalPaid = Convert.ToDecimal(paymentModel.TotalPaid) + transactionAmount; paymentModel.TotalPaid = Convert.ToString(totalPaid); } else { totalPaid = transactionAmount; paymentModel.TotalPaid = Convert.ToString(totalPaid); } paymentModel.TotalDue = UtilityPCL.CurrencyFormat(Convert.ToString(totalCost - totalPaid)); }
/// <summary> /// Method Name : Validation /// Author : Sanket Prajapati /// Creation Date : 13 jan 2018 /// Purpose : Use for validation /// Revision : /// </summary> private string Validation() { MonthYearModel yearValue = yearList.FirstOrDefault(rc => rc.Year == spinnerExpYear.SelectedItem.ToString()); MonthYearModel monthValue = monthList.FirstOrDefault(rc => rc.Month == spinnerExpMonth.SelectedItem.ToString()); string errormessage = string.Empty; CardTypeInfoModel cardTypeInfoModel = UtilityPCL.GetCardTypes().FirstOrDefault(rc => rc.CardType == cardType); if (string.IsNullOrEmpty(txtNameofCardHolder.Text)) { errormessage = StringResource.msgNameofCardholderisRequired; } else if (!string.IsNullOrEmpty(txtNameofCardHolder.Text.Trim())) { errormessage = ValidFullName(); if (string.IsNullOrEmpty(errormessage)) { if (string.IsNullOrEmpty(txtCardNumber.Text)) { errormessage = StringResource.msgCardNumberIsRequired; } else { errormessage = validExpDateAndCardnumber(yearValue, monthValue, cardTypeInfoModel); } } } return(errormessage); }
/// <summary> /// Method Name : SetEstimateData /// Author : Hiren Patel /// Creation Date : 30 Dec 2017 /// Purpose : Set estimates data /// Revision : /// </summary> public void SetEstimateData(EstimateModel estimateModel, UITableView tableView, EstimateListViewController estimateListViewController) { this.estimateListViewController = estimateListViewController; this.estimateModel = estimateModel; lblEstimateTitle.Text = estimateModel.MoveNumber; if (string.IsNullOrEmpty(estimateModel.EstimatedLineHaul)) { lblExcessValuation.Text = UtilityPCL.CurrencyFormat("0"); } else { lblExcessValuation.Text = estimateModel.EstimatedLineHaul; } if (estimateModel.MoveNumber == UtilityPCL.selectedMoveNumber) { btnSelectEstimate.SetImage(UIImage.FromFile(AppConstant.ESTIMATE_SELECETD_IMAGE_URL), UIControlState.Normal); } else { btnSelectEstimate.SetImage(UIImage.FromFile(AppConstant.ESTIMATE_UNSELECETD_IMAGE_URL), UIControlState.Normal); } SetIimgViewEstimateTap(); btnSelectEstimate.TintColor = UIColor.White; btnSelectEstimate.Layer.BorderWidth = 0; this.tableView = tableView; }
/// Event Name : spinnerCoverage_ItemSelected /// Author : Sanket Prajapati /// Creation Date : 2 Dec 2017 /// Purpose : Use for selection /// Revision : /// </summary> private void spinnerCoverage_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e) { valuationDeductible = new ValuationDeductibleModel(); var spinner = (Spinner)sender; string strValue = string.Empty; strValue = string.Format("{0}", spinner.GetItemAtPosition(e.Position)); valuationDeductible = UtilityPCL.ValuationDeductibleList().FirstOrDefault(rc => rc.DeductibleName == strValue); }
/// <summary> /// Method Name : ValidateWhatMattersMost /// Author : Hiren Patel /// Creation Date : 31 Jan 2018 /// Purpose : Validates the what matters most. /// Revision : /// </summary> /// <param name="whatMattersMost">Text what matters most.</param> public string ValidateWhatMattersMost(string whatMattersMost) { string errorMessage = string.Empty; if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(whatMattersMost.Trim())) { errorMessage = Resource.msgWhatMattersMostIsRequired; } return(errorMessage); }
/// <summary> /// Method Name : BindMoveData /// Author : Hiren Patel /// Creation Date : 30 Dec 2017 /// Purpose : To bind Move data with UI element /// Revision : /// </summary> private async Task BindMoveData() { string errorMessage = string.Empty; try { if (this.ParentViewController != null) { parent = this.ParentViewController as JKTabController; loadingOverlay = UIHelper.ShowLoadingScreen(parent.View); } APIResponse <MoveDataModel> response = await moveService.GetMoveData(UtilityPCL.LoginCustomerData.CustomerId); loadingOverlay.Hide(); if (response.STATUS) { if (UtilityPCL.IsMoveActive(response.DATA.IsActive)) { MoveDataModel moveDataModel = response.DATA; SetMoveAddressAndValueDataToUILabel(moveDataModel); if (moveDataModel.MyServices != null) { UIHelper.BindMyServiceData(moveDataModel.MyServices, scrollviewMyServices, View); } CheckStatusReason(moveDataModel); scrollview.Hidden = false; } else { scrollview.Hidden = true; UIHelper.ShowMessage(response.Message); } } else { scrollview.Hidden = true; errorMessage = response.Message; } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { ResetDashBoardData(); UIHelper.ShowAlertMessage(this, errorMessage); } loadingOverlay.Hide(); } }
/// Method Name : BindSpiner /// Author : Sanket Prajapati /// Creation Date : 2 Dec 2017 /// Purpose : Use fort bind Spinner /// Revision : /// </summary> private void BindSpiner() { List <String> valutionList = UtilityPCL.ValuationDeductibleBindingList(); if (valutionList.Count > 0) { var categoryAdapter = new ArrayAdapter <string>(Activity, Android.Resource.Layout.SimpleSpinnerItem, valutionList); categoryAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinnerCoverage.ItemSelected += spinnerCoverage_ItemSelected; spinnerCoverage.Adapter = categoryAdapter; } }
public void BindCoverageValue() { // create our simple picker model coveragePickerDataModel = new CoveragePickerDataModel(); foreach (string item in UtilityPCL.ValuationDeductibleBindingList()) { coveragePickerDataModel.Items.Add(item); } // set it on our picker class uiPickerViewCoverage.Model = coveragePickerDataModel; }
/// <summary> /// Method Name : ValidateServiceDates /// Author : Hiren Patel /// Creation Date : 31 Jan 2018 /// Purpose : Validate service dates. /// Revision : /// </summary> /// <param name="packDate">Text pack date.</param> /// <param name="loadDate">Text load date.</param> /// <param name="moveDate">Text move date.</param> public string ValidateServiceDates(string packDate, string loadDate, string moveDate) { string errorMessage = string.Empty; if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(packDate)) { errorMessage = Resource.msgPackDateIsRequired; } else if (Convert.ToDateTime(packDate) <= DateTime.Today) { errorMessage = Resource.msgInvalidServiceDate; } else if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(loadDate)) { errorMessage = Resource.msgLoadDateIsRequired; } else if (Convert.ToDateTime(loadDate) <= DateTime.Today) { errorMessage = Resource.msgInvalidServiceDate; } else if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(moveDate)) { errorMessage = Resource.msgMoveDateIsRequired; } else if (Convert.ToDateTime(moveDate) <= DateTime.Today) { errorMessage = Resource.msgInvalidServiceDate; } else { DateTime dtpackDate = Convert.ToDateTime(packDate); DateTime dtloadDate = Convert.ToDateTime(loadDate); DateTime dtmoveDate = Convert.ToDateTime(moveDate); if (dtpackDate > dtloadDate) { errorMessage = Resource.msgPackdatemustbelessthanloaddate; } else if (dtpackDate > dtmoveDate) { errorMessage = Resource.msgPackdatemustbelessthanmovedate; } else if (dtloadDate > dtmoveDate) { errorMessage = Resource.msgPleaseSelectLoadDateGreaterThanorEqualMoveDate; } } return(errorMessage); }
/// <summary> /// Method Name : BindPaymentData /// Author : Hiren Patel /// Creation Date : 31 Jan 2017 /// Purpose : Binds the payment data. /// Revision : /// </summary> private void BindPaymentData() { if (paymentModel is null) { paymentModel = new PaymentModel() { TotalCost = "0", TotalPaid = "0", Deposit = "0" }; } decimal totalCost = 0; decimal totalPaid = 0; lblTotalCost.Text = UtilityPCL.CurrencyFormat(paymentModel.TotalCost); lblTotalPaid.Text = UtilityPCL.CurrencyFormat(paymentModel.TotalPaid); lblDepositCollected.Text = UtilityPCL.CurrencyFormat(paymentModel.Deposit); if (!string.IsNullOrEmpty(paymentModel.TotalCost)) { totalCost = Convert.ToDecimal(paymentModel.TotalCost); } if (!string.IsNullOrEmpty(paymentModel.TotalPaid)) { totalPaid = Convert.ToDecimal(paymentModel.TotalPaid); } lblTotalDue.Text = UtilityPCL.CurrencyFormat(Convert.ToString(totalCost - totalPaid)); txtAmount.Text = Convert.ToString(totalCost - totalPaid); if (totalCost <= totalPaid || string.IsNullOrEmpty(DTOConsumer.dtoMoveData.MoveNumber)) { EnableDisableButton(btnMakePayment, false); EnableDisableButton(btnClose, false); EnableDisableButton(btnAddAnotherCard, false); ResetControlState(false); txtAmount.Text = string.Empty; } else if (scrollViewSwipeCard.ContentOffset.X == 0 && Cardcounnter > 1) { EnableDisableButton(btnAddAnotherCard, false); EnableDisableButton(btnClose, true); ResetControlState(true); } else { EnableDisableButton(btnAddAnotherCard, true); EnableDisableButton(btnClose, false); ResetControlState(true); } }
/// <summary> /// Method Name : GoToDesboardAsync /// Author : Hiren Patel /// Creation Date : 1 Feb 2018 /// Purpose : Use for Update Estimed /// Revision : /// </summary> private async Task GoToDesboardAsync() { string retMessage = string.Empty; try { // Valuation RemoveCurrencyFormat(); ValuationDeductibleModel valuationDeductibleModel = UtilityPCL.ValuationDeductibleList().Where(a => a.DeductibleName == estimateModel.ValuationDeductible).SingleOrDefault(); if (valuationDeductibleModel != null) { estimateModel.ValuationDeductible = valuationDeductibleModel.DeductibleCode; } if (estimateModel.IsAddressEdited || estimateModel.IsServiceDate || estimateModel.IsWhatMatterMostEdited || estimateModel.IsValuationEdited) { loadingOverlay = UIHelper.ShowLoadingScreen(View); RemoveCurrencyFormat(); APIResponse <EstimateModel> aPIResponse = await estimate.PutEstimateData(estimateModel, estimateModel.MoveNumber); loadingOverlay.Hide(); if (aPIResponse.STATUS) { await UpdateMoveDataAsync(); } else { UIHelper.ShowMessage(aPIResponse.Message); } } else { await UpdateMoveDataAsync(); } } catch (Exception error) { retMessage = error.Message; } finally { if (!string.IsNullOrEmpty(retMessage)) { UIHelper.ShowMessage(retMessage); } } }
/// 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 : ValidateCustomerAddress /// Author : Hiren Patel /// Creation Date : 31 Jan 2018 /// Purpose : Validates the move address. /// Revision : /// </summary> /// <param name="originAddress">Text origin address.</param> /// <param name="destinationAddress">Text destination address.</param> public string ValidateCustomerAddress(string originAddress, string destinationAddress) { string errorMessage = string.Empty; if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(originAddress)) { errorMessage = Resource.msgCustomOriginAddressIsRequired; } else if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(destinationAddress)) { errorMessage = Resource.msgCustomDestinationAddressIsRequired; } return(errorMessage); }
/// <summary> /// Method Name : GetDateForDiplay /// Author : Vivek Bhavsar /// Creation Date : 23 Jan 2018 /// Purpose : sub method to set dates as per require format for estimate /// Revision : /// </summary> /// <param name="date"></param> /// <returns></returns> private string GetDateForDiplay(string date) { string dateValue = string.Empty; if (!string.IsNullOrEmpty(date)) { DateTime datetime = UtilityPCL.ConvertDateTimeInUSFormat(date); if (datetime != DateTime.MinValue) { dateValue = UtilityPCL.DisplayDateFormatForEstimate(datetime, Resource.MMddyyyyDateFormat); } } return(dateValue); }
/// <summary> /// Method Name : callPaymentService /// Author : Hiren Patel /// Creation Date : 15 Feb 2018 /// Purpose : Calls the payment service. /// Revision : /// </summary> /// <param name="paymentGatewayModel">Payment gateway model.</param> private async Task callPaymentService(PaymentGatewayModel paymentGatewayModel) { APIResponse <PaymentTransactonModel> serviceResponse = new APIResponse <PaymentTransactonModel>() { STATUS = false }; string errorMessage = string.Empty; LoadingOverlay loadingOverlay = UIHelper.ShowLoadingScreen(View); try { serviceResponse = await payment.ProcessPaymentTransaction(paymentGatewayModel); if (serviceResponse.STATUS) { if (serviceResponse.DATA != null) { lblTransactionId.Text = serviceResponse.DATA.TransactionID; lblPaymentStatusAmountPaid.Text = UtilityPCL.CurrencyFormat(Convert.ToString(paymentGatewayModel.TransactionAmout)); await CallPostPaymentTransaction(serviceResponse.DATA, paymentGatewayModel); } } else { errorMessage = serviceResponse.Message; if (serviceResponse.DATA != null) { lblTransactionId.Text = serviceResponse.DATA.TransactionID; } } } catch (Exception error) { errorMessage = error.Message; } finally { loadingOverlay.Hide(); if (!string.IsNullOrEmpty(errorMessage)) { await UIHelper.ShowMessageWithOKConfirm(string.Empty, errorMessage, AppConstant.ALERT_OK_BUTTON_TEXT); } } ShowPaymentStatus(serviceResponse.STATUS); }
/// <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> /// Event Name : BtnAlert_TouchUpInside /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : Populates the move details data. /// Revision : /// </summary> public void PopulateData() { if (DTOConsumer.dtoMoveData != null) { MoveDataModel dtoMoveData = DTOConsumer.dtoMoveData; lblPackDate.Text = dtoMoveData.MoveDetails_PackStartDate; lblLoadDate.Text = dtoMoveData.MoveDetails_LoadStartDate; if (!UtilityPCL.IsNullOrEmptyOrWhiteSpace(dtoMoveData.MoveDetails_DeliveryStartDate) && !UtilityPCL.IsNullOrEmptyOrWhiteSpace(dtoMoveData.MoveDetails_DeliveryEndDate)) { if (dtoMoveData.MoveDetails_DeliveryStartDate == dtoMoveData.MoveDetails_DeliveryEndDate) { lblDeliveryDate.Text = dtoMoveData.MoveDetails_DeliveryStartDate; } else { SetDeliverySpreadData(dtoMoveData.MoveDetails_DeliveryStartDate, dtoMoveData.MoveDetails_DeliveryEndDate); } } } }
/// <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); } }
/// Method Name : Validation /// Author : Sanket Prajapati /// Creation Date : 29 jan 2018 /// Purpose : Use for valuation Validation /// Revision : /// </summary> private bool Validation() { bool iValue = true; valuationDeductible = new ValuationDeductibleModel(); valuationDeductible = UtilityPCL.ValuationDeductibleList().FirstOrDefault(rc => rc.DeductibleName == spinnerCoverage.SelectedItem.ToString()); if (viewSwitcher.CurrentView == linearLayoutEdit) { if (string.IsNullOrEmpty(txtDeclaredvalue.Text.Trim())) { iValue = false; AlertMessage(StringResource.msgPleaseEnterDeclaredValue); } else if (string.IsNullOrEmpty(txtCost.Text.Trim())) { iValue = false; AlertMessage(StringResource.msgPleaseEnetrCostValue); } } return(iValue); }
/// <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)) { tvDisplayDeclaredvalue.Text = UtilityPCL.CurrencyFormat(estimateModel.ExcessValuation); tvDisplayCost.Text = UtilityPCL.CurrencyFormat(estimateModel.ValuationCost); if (!string.IsNullOrEmpty(estimateModel.ValuationDeductible)) { valuationDeductible = UtilityPCL.ValuationDeductibleList().Find(rc => rc.DeductibleName == estimateModel.ValuationDeductible || rc.DeductibleCode == estimateModel.ValuationDeductible); tvDisplayCoverage.Text = valuationDeductible.DeductibleName; } else { valuationDeductible = new ValuationDeductibleModel(); valuationDeductible = UtilityPCL.ValuationDeductibleList().FirstOrDefault(rc => rc.Index == 1); if (valuationDeductible != null) { tvDisplayCoverage.Text = valuationDeductible.DeductibleName; } } } }
/// <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); } } }
/// <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 : CallPostPaymentTransaction /// Author : Hiren Patel /// Creation Date : 15 Feb 2018 /// Purpose : Calls the post payment transaction. /// Revision : /// </summary> /// <returns>The post payment transaction.</returns> /// <param name="paymentTransactonModel">Payment transacton model.</param> /// <param name="estimateModel">Estimate model.</param> private async Task CallPostPaymentTransaction(APIResponse <PaymentTransactonModel> paymentTransactonModel, EstimateModel estimateModel) { paymentGateway = new Payment(); APIResponse <PaymentModel> serviceResponse = new APIResponse <PaymentModel>() { STATUS = false }; string errorMessage = string.Empty; try { List <PaymentModel> paymentModelList = new List <PaymentModel>(); PaymentModel paymentModel = new PaymentModel(); paymentModel.MoveID = estimateModel.MoveId; paymentModel.TransactionNumber = paymentTransactonModel.DATA.TransactionID; if (!IsNullOrEmptyOrWhiteSpace(estimateModel.Deposit)) { paymentModel.TransactionAmount = RemoveCurrencyFormat(estimateModel.Deposit); } paymentModel.TransactionDate = UtilityPCL.DisplayDateFormatForEstimate(DateTime.Now, string.Empty); paymentModel.CustomerID = LoginCustomerData.CustomerId; paymentModelList.Add(paymentModel); serviceResponse = await paymentGateway.PostPaymentTransaction(paymentModelList); } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { AlertMessage(errorMessage); } } }