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> /// 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 : 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 : 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 : 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> /// 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 : ValidateValuationDeductible /// 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 ValidateValuationData(string declaredValue, string valuationDeductible, string cost) { string errorMessage = string.Empty; decimal number; if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(declaredValue)) { return(Resource.msgvaluationDeclaredValueIsRequired); } else { if (!Decimal.TryParse(declaredValue, out number)) { return(Resource.msgvaluationDeclaredValueIsNumeric); } } if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(valuationDeductible)) { return(Resource.msgvaluationDeductibleIsRequired); } if (UtilityPCL.IsNullOrEmptyOrWhiteSpace(cost)) { return(Resource.msgvaluationCostValueIsRequired); } else { if (!Decimal.TryParse(cost, out number)) { return(Resource.msgvaluationCostValueIsNumeric); } } return(errorMessage); }