public RevenueCreateViewModel(Revenue revenue) { Date = revenue.Date; Value = revenue.Value; RevenueType = revenue.RevenueType; OccasionId = revenue.OccasionId; }
public static ITry <RevenueInfo, Error> Create(TaxType taxType, RevenueType revenueType, VatExemptionType?vatExemptionType = null) { if (taxType == TaxType.Vat0 && !vatExemptionType.HasValue) { return(Try.Error <RevenueInfo, Error>(new Error($"{nameof(VatExemption)} must be specified when TaxType is {taxType}"))); } return(Try.Success <RevenueInfo, Error>(new RevenueInfo(taxType, revenueType, vatExemptionType))); }
public NegativeRevenue( NegativeAmount netValue, NonPositiveAmount vatValue, TaxType taxType, RevenueType revenueType, VatExemptionType?vatExemption = null) : base(netValue, vatValue, taxType, revenueType, vatExemption) { }
public ActionResult Details(int id = 0) { RevenueType revenuetype = objSourceMastersModel.GetRevenueTypeById(id); if (revenuetype == null) { return(HttpNotFound()); } return(View(revenuetype)); }
private static (Dto.Xsd.IncomeClassificationCategory Category, Dto.Xsd.IncomeClassificationType Type) MapRevenueClassification( Invoice invoice, RevenueType revenueType) { return(revenueType.Match( RevenueType.Products, _ => (Dto.Xsd.IncomeClassificationCategory.ProductSaleIncome, GetGoodsAndServicesClassificationType(invoice)), RevenueType.Services, _ => (Dto.Xsd.IncomeClassificationCategory.ProvisionOfServicesIncome, GetGoodsAndServicesClassificationType(invoice)), RevenueType.Other, _ => (Dto.Xsd.IncomeClassificationCategory.OtherIncomeAndProfits, Dto.Xsd.IncomeClassificationType.OtherOrdinaryIncome) )); }
public ActionResult Edit(RevenueType revenuetype) { if (ModelState.IsValid) { objSourceMastersModel.SaveRevenueTypeById(revenuetype); TempData["SuccessMSG"] = "You have successfully updated Revenue Type."; return(RedirectToAction("Index")); } return(View(revenuetype)); }
public ActionResult Edit(int id = 0) { ViewBag.accounthead = entity.AcHeads.ToList(); RevenueType revenuetype = objSourceMastersModel.GetRevenueTypeById(id); if (revenuetype == null) { return(HttpNotFound()); } return(View(revenuetype)); }
private static (Dto.Xsd.IncomeClassificationCategory Category, Dto.Xsd.IncomeClassificationType Type) MapRevenueClassification( Invoice invoice, RevenueType revenueType) { if (revenueType == RevenueType.Products) { return(Dto.Xsd.IncomeClassificationCategory.ProductSaleIncome, GetGoodsAndServicesClassificationType()); } else if (revenueType == RevenueType.Services) { return(Dto.Xsd.IncomeClassificationCategory.ProvisionOfServicesIncome, GetGoodsAndServicesClassificationType()); } else if (revenueType == RevenueType.Other) { if (invoice is SalesInvoice) { return(Dto.Xsd.IncomeClassificationCategory.OtherIncomeAndProfits, Dto.Xsd.IncomeClassificationType.OtherOrdinaryIncome); } else if (invoice is CreditInvoice) { if (invoice.CorrelatedInvoice.IsNotNull()) { return(Dto.Xsd.IncomeClassificationCategory.OtherIncomeAndProfits, Dto.Xsd.IncomeClassificationType.OtherOrdinaryIncome); } } return(Dto.Xsd.IncomeClassificationCategory.OtherIncomeAndProfits, Dto.Xsd.IncomeClassificationType.OtherSalesOfGoodsAndServices); } throw new ArgumentException($"Cannot map revenue type to a pair of {nameof(Dto.Xsd.IncomeClassificationCategory)} and {nameof(Dto.Xsd.IncomeClassificationType)}."); Dto.Xsd.IncomeClassificationType GetGoodsAndServicesClassificationType() { if (invoice is SalesInvoice) { Country country = invoice.Counterpart.Country; if (country.Code.Value == GreeceCountryCode) { return(Dto.Xsd.IncomeClassificationType.OtherSalesOfGoodsAndServices); } else if (country.IsWithinEU) { return(Dto.Xsd.IncomeClassificationType.IntraCommunityForeignSalesOfGoodsAndServices); } return(Dto.Xsd.IncomeClassificationType.ThirdCountryForeignSalesOfGoodsAndServices); } else if (invoice is CreditInvoice) { return(Dto.Xsd.IncomeClassificationType.OtherSalesOfGoodsAndServices); } return(Dto.Xsd.IncomeClassificationType.RetailSalesOfGoodsAndServicesPrivateClientele); } }
public Revenue( Amount netValue, Amount vatValue, TaxType taxType, RevenueType revenueType, VatExemptionType?vatExemption = null) { NetValue = netValue ?? throw new ArgumentNullException(nameof(netValue)); VatValue = vatValue ?? throw new ArgumentNullException(nameof(vatValue)); TaxType = taxType; RevenueType = revenueType; VatExemption = vatExemption; if (taxType == TaxType.Vat0 && !vatExemption.HasValue) { throw new ArgumentException($"{nameof(VatExemption)} must be specified when TaxType is {taxType}"); } }
private void UpdateType(string type) { type = type.ToLowerInvariant(); if (type.Contains("revenue")) { Type = RevenueType.Revenue; return; } if (type.Contains("payout")) { Type = RevenueType.Payout; return; } Type = RevenueType.Unknown; }
public ActionResult Create(RevenueType revenuetype) { if (ModelState.IsValid) { var query = (from t in entity.RevenueTypes where t.RevenueType1 == revenuetype.RevenueType1 select t).ToList(); if (query.Count > 0) { ViewBag.accounthead = entity.AcHeads.ToList(); ViewBag.SuccessMsg = "Revenue Type is already exist"; return(View()); } objSourceMastersModel.SaveRevenueType(revenuetype); TempData["SuccessMSG"] = "You have successfully added Revenue Type."; return(RedirectToAction("Index")); } return(View(revenuetype)); }
public RevenueInfo(TaxType taxType, RevenueType revenueType, VatExemptionType?vatExemption = null) { TaxType = taxType; RevenueType = revenueType; VatExemption = vatExemption.ToOption(); }
//Security Defect -START - Added the below code to validate the fields in the lineitem public CCResponse ValidateFields() { //Security Defect - Added the below code to trim all the fields ProductCode = ProductCode.Trim(); ProductName = ProductName.Trim(); ClubCode = ClubCode.Trim(); SubProduct = SubProduct.Trim(); AccountNumber = AccountNumber.Trim(); LastName = LastName.Trim(); FirstName = FirstName.Trim(); SKU = SKU.Trim(); RevenueCode = RevenueCode.Trim(); RevenueType = RevenueType.Trim(); //Security Defect - Added the below code to trim all the fields CCResponse c = new CCResponse(); if ((ProductCode.Length > 10) || junkValidation(ProductCode)) { c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "ProductCode"; c.ActualMessage = c.Message; c.Flag = Config.Setting("ERRCDE_PRODUCTCODE"); Logger.Log(c.Message + c.Flag); return(c); } if ((ProductName.Length > 50) || junkValidation(ProductName)) { c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "ProductName"; c.ActualMessage = c.Message; c.Flag = Config.Setting("ERRCDE_PRODUCTNAME"); Logger.Log(c.Message + c.Flag); return(c); } if ((ClubCode.Length > 50) || junkValidation(ClubCode)) { c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "ClubCode"; c.ActualMessage = c.Message; c.Flag = Config.Setting("ERRCDE_CLUBCODE"); Logger.Log(c.Message + c.Flag); return(c); } if ((SubProduct.Length > 25) || junkValidation(SubProduct)) { c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "SubProduct"; c.ActualMessage = c.Message; c.Flag = Config.Setting("ERRCDE_SUBPRODUCT"); Logger.Log(c.Message + c.Flag); return(c); } if (IsMissing(AccountNumber) || (AccountNumber.Length > 25) || junkValidation(AccountNumber)) { c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "AccountNumber"; c.ActualMessage = c.Message; c.Flag = Config.Setting("ERRCDE_ACCOUNTNUMBER"); Logger.Log(c.Message + c.Flag); return(c); } //if (IsMissing(LastName)) //{ // c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "LastName"; // c.ActualMessage = c.Message; // c.Flag = Config.Setting("ERRCDE_LASTNAME"); // Logger.Log(c.Message + c.Flag); // return c; //} //if (IsMissing(FirstName)) //{ // c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "FirstName"; // c.ActualMessage = c.Message; // c.Flag = Config.Setting("ERRCDE_FIRSTNAME"); // Logger.Log(c.Message + c.Flag); // return c; //} if ((SKU.Length > 3) || junkValidation(SKU)) { c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "SKU"; c.ActualMessage = c.Message; c.Flag = Config.Setting("ERRCDE_SKU"); Logger.Log(c.Message + c.Flag); return(c); } if ((RevenueCode.Length > 10) || junkValidation(RevenueCode)) { c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "RevenueCode"; c.ActualMessage = c.Message; c.Flag = Config.Setting("ERRCDE_REVENUECODE"); Logger.Log(c.Message + c.Flag); return(c); } if (IsMissing(RevenueType) || (RevenueType.Length > 20) || junkValidation(RevenueType)) { c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "RevenueType"; c.ActualMessage = c.Message; c.Flag = Config.Setting("ERRCDE_REVENUETYPE"); Logger.Log(c.Message + c.Flag); return(c); } if ((Amount < 0) || (Amount > 25000) || junkValidation(Amount.ToString())) { c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "Amount"; c.ActualMessage = c.Message; c.Flag = Config.Setting("ERRCDE_AMOUNT"); Logger.Log(c.Message + c.Flag); return(c); } if ((Tax_Amount < 0) || (Tax_Amount > 25000) || junkValidation(Tax_Amount.ToString())) { c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "Tax_Amount"; c.ActualMessage = c.Message; c.Flag = Config.Setting("ERRCDE_TAXAMOUNT"); Logger.Log(c.Message + c.Flag); return(c); } //if ((LineItemNo > 10) || !CSAAWeb.Validate.IsAllNumeric(LineItemNo.ToString())) //{ // c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "LineItemNo"; // c.ActualMessage = c.Message; // c.Flag = Config.Setting("ERRCDE_LINEITEMNO"); // Logger.Log(c.Message + c.Flag); // return c; //} if ((Quantity > 10) || !CSAAWeb.Validate.IsAllNumeric(Quantity.ToString())) { c.Message = CSAAWeb.Constants.ERR_AUTHVALIDATION + "Quantity"; c.ActualMessage = c.Message; c.Flag = Config.Setting("ERRCDE_QUANTITY"); Logger.Log(c.Message + c.Flag); return(c); } else { return(null); } //Security Defect -END - Added the below code to validate the fields in the lineitem }
internal static RevenueInfo CreateRevenueInfo(TaxType taxType, RevenueType revenueType, VatExemptionType?vatExemptionType = null) { return(RevenueInfo.Create(taxType, revenueType, vatExemptionType).Success.Get()); }
// 67811A0 - PCI Remediation for Payment systems.CH4:END ///<summary>Validates the policy number check digit</summary> protected void ValidPolicy(ValidatorAttribute Source, ValidatingSerializerEventArgs e) { //CSAA.com - added the condition toupper to prevent the policy validation failure for the Leacy and exigen polices by cognizant on 12/23/2011 Policy = Policy.ToUpper(); bool IsValid = true; bool IsExigenValid = true; bool IsPupValid = true; //Security Defect- CH2 -START -Added the below code to validate the fields in insurance line item if (FirstName.Trim() == "") { AddError(new ErrorInfo("50008", "Valdiation failed in FirstName", "FirstName")); } if (LastName.Trim() == "") { AddError(new ErrorInfo("50009", "Valdiation failed in LastName", "LastName")); } if (Description.Trim().Length > 100) { AddError(new ErrorInfo("50004", "Valdiation failed in Description", "Description")); } if (Price.ToString() == "" || Price <= 0 || Price > 25000 || !CSAAWeb.Validate.IsDecimal(Price.ToString())) { AddError(new ErrorInfo("50016", "Valdiation failed in Price", "Price")); } if (Amount.ToString() == "" || Amount <= 0 || Amount > 25000 || !CSAAWeb.Validate.IsDecimal(Amount.ToString())) { AddError(new ErrorInfo("50016", "Valdiation failed in Amount", "Amount")); } //if (Tax_Amount.ToString() == "" || Tax_Amount <= 0 || Tax_Amount > 25000 || !CSAAWeb.Validate.IsDecimal(Tax_Amount.ToString())) //{ // AddError(new ErrorInfo("50016", "Valdiation failed in Tax_Amount", "Tax_Amount")); //} if (Quantity.ToString() == "" || Quantity <= 0 || Quantity > 10 || !CSAAWeb.Validate.IsDecimal(Quantity.ToString())) { AddError(new ErrorInfo("50017", "Valdiation failed in Quantity", "Quantity")); } if (RevenueType == "" || RevenueType.Length > 40 || junkValidation(RevenueType.ToString())) { AddError(new ErrorInfo("50018", "Valdiation failed in RevenueType", "RevenueType")); } //MAIG - CH1 - BEGIN - Modified the logic to Support Common Product Types and to check if it is an valid policy number, Also commenented the unwanted logic //Security Defect- CH2 -END -Added the below code to validate the fields in insurance line item //AZ PAS Conversion and PC integration - START - Added the below code to assign the policy number alone to the Policy variable in case of non PCP transactions from UI Policy = Policy.Trim(); if (ProductType.Equals("PA") || ProductType.Equals("HO")) { if (!(CSAAWeb.Validate.IsAlphaNumeric(Policy.Trim())) || (Policy.Length < 4 || Policy.Length > 13)) { IsValid = false; } } else if (ProductType.Equals("PU")) { //MAIG - CH3 - BEGIN - Added condition to skip validation if the policy length is 13, for an PAS Home Policy if (!(Policy.Trim().Length == 13 && CSAAWeb.Validate.IsAlphaNumeric(Policy.Trim()))) { if (!CSAAWeb.Validate.IsAllNumeric(Policy.Trim())) { IsValid = false; e.Error = new ErrorInfo("INVALID_CHARACTERS", CSAAWeb.Constants.PUP_NUMERIC_VALID, "Policy"); return; } else if (Policy.Length != 7) { IsValid = false; e.Error = new ErrorInfo("INVALID_LENGTH", CSAAWeb.Constants.POLICY_LENGTH_HOME_MESSAGE, "Policy"); return; } } //MAIG - CH3 - END - Added condition to skip validation if the policy length is 13, for an PAS Home Policy } else if (ProductType.Equals("DF") || ProductType.Equals("MC") || ProductType.Equals("WC")) { //MAIG - CH4 - BEGIN - Added condition to skip validation if the policy length is 13, for an PAS Home Policy if (!(ProductType.Equals("DF") && Policy.Trim().Length == 13 && CSAAWeb.Validate.IsAlphaNumeric(Policy.Trim()))) { if (Policy.Length < 4 || Policy.Length > 9) { IsValid = false; } else if (!CSAAWeb.Validate.IsAllNumeric(Policy)) { IsValid = false; e.Error = new ErrorInfo("INVALID_CHARACTERS", "Field must be Numeric.", "Policy"); return; } } //MAIG - CH4 - END - Added condition to skip validation if the policy length is 13, for an PAS Home Policy } /* * * if ((ConfigurationSettings.AppSettings["PCP.Products"]).IndexOf(Convert.ToString(ProductType)) <= -1) * { * string[] StrSplitPolicy; * StrSplitPolicy = Policy.Split('-'); * if (StrSplitPolicy[0] != null) * { * Policy = StrSplitPolicy[0].Trim(); * } * } * //AZ PAS Conversion and PC integration -END - Added the below code to assign the policy number alone to the Policy variable in case of non PCP transactions from UI * //if (Policy.Length >16) * //{ * // AddError(new ErrorInfo("50052", "Valdiation failed in Policy", "Policy")); * //} * // 67811A0 - PCI Remediation for Payment systems.CH3:START- Validate Partner Club Products of lengh between 4 to 10 and numeric * if ((ConfigurationSettings.AppSettings["PCP.Products"]).IndexOf(Convert.ToString(ProductType)) > -1 ) * { * if (Splitpolicynumber(Policy).Length >= 4 && Splitpolicynumber(Policy).Length <= 9) * { * //* 67811A0 - PCI Remediation for Payment systems.CH6 : To validate the HO6 policy sequence for CEA product code * if (((ConfigurationSettings.AppSettings["PCP.StatePrefixCEA"]).IndexOf(Convert.ToString(StrPrefix)) > -1) && ((ConfigurationSettings.AppSettings["PCP.ProductTypeCEA"]).IndexOf(Convert.ToString(ProductType)) > -1)) * //if ((StrPrefix == "HO6") && (ProductType.Trim() == "CEA")) * { * InsuranceClasses.Service.Insurance I = new InsuranceClasses.Service.Insurance(); * * * if ((bool)I.ValidateCheckDigit(Splitpolicynumber(Policy))) * { * IsValid = true; * } * else * { * IsValid = false; * e.Error = new ErrorInfo("INVALID_Policy", "Policy Number Sequence is Invalid for Home policy", "Policy"); * * return; * } * * } * else if (CSAAWeb.Validate.IsAllNumeric(Splitpolicynumber(Policy))) * { * IsValid = true; * } * else * { * IsValid = false; * e.Error = new ErrorInfo("INVALID_Policy", "Policy Number must be Numeric for Western United Products.", "Policy"); * return; * } * * * } * else * { * IsValid = false; * e.Error = new ErrorInfo("INVALID_LENGTH", "Policy Number Length must be between 4 to 9 for Western United Products.", "Policy"); * return; * //* 67811A0 - PCI Remediation for Payment systems.CH6 : To validate the HO6 policy sequence for CEA product code * } * } * // 67811A0 - PCI Remediation for Payment systems.CH3:END * //Start Added by Cognizant on 11/8/2004 * else if (Policy != "" && validateRequired) * { * //Q4-Retrofit.Ch2-START: Added to check IsHUONAuto property to identify if it is HUON Auto * if (IsHUONAuto) * { * //For HUON Auto products, the policy number is checked to see if it is purely numeric * IsValid = CSAAWeb.Validate.IsAllNumeric(Policy); * if (!IsValid) * { * e.Error = new ErrorInfo("INVALID_CHARACTERS", "Field must be Numeric.", "Policy"); * return; * } * } * //PUP CH1:Start added new validator for validating pup policy by cognizant on 1/10/2011 * //PUP CH4:Modified the condition for converting the first 3 chararcters Toupper case - by cognizant on 03/18/2011 * else if (Policy.Length == 10 && Policy.Substring(0, 3).ToUpper() == "PUP") * { * string puPolicyno = Policy.Substring(3, 7); * if (!CSAAWeb.Validate.IsAllNumeric(puPolicyno)) * { * IsPupValid = false; * e.Error = new ErrorInfo("INVALID_CHARACTERS", CSAAWeb.Constants.PUP_NUMERIC_VALID, "Policy"); * return; * } * IsPupValid = true; * } * //PUP CH1:END added new validator for validating pup policy by cognizant on 1/10/2011 * else if (GetIsExigenAuto() == true) * { * // MP2.0.Ch2 - Start of Code - New Validation has been added for exigen on 1/6/2010 by Cognizant * if (Policy.Length == 13) * { * * string stateCode = Policy.Substring(0, 2); * string prodCode = Policy.Substring(2, 2); * string exPolicyNo = Policy.Substring(4, 9); * * string stateCodeValues = string.Empty; * string prodCodeValues = string.Empty; * * // MP 2.0 defect # 904 - new code added to fix the bug - by Cognizant on 07/30/2010 * string allowedExigenPolicyValues = string.Empty; * string stateProductCode = string.Empty; * stateProductCode = Policy.Substring(0, 4); * * * if (ConfigurationSettings.AppSettings["AllowedExigenPolicies"] != null && ConfigurationSettings.AppSettings["AllowedExigenPolicies"].ToString() != string.Empty) * { * allowedExigenPolicyValues = ConfigurationSettings.AppSettings["AllowedExigenPolicies"].ToString(); * } * * //CHG0104053 - PAS HO CH1 - START : Added the below code to allow all states,no validation, since it is available in RBPS 6/26/2014 * if (!ProductType.Equals("AAASSH")) * { * if (allowedExigenPolicyValues.IndexOf(stateProductCode) < 0) * { * IsExigenValid = false; * e.Error = new ErrorInfo("INVALID_POLICY", "Invalid Policy. Please enter a valid policy and try again", "Policy"); * return; * } * } * //CHG0104053 - PAS HO CH1 - END : Added the below code to allow all states,no validation, since it is available in RBPS 6/26/2014 * //End Issue 904 * * if (!CSAAWeb.Validate.IsAllNumeric(exPolicyNo)) * { * IsExigenValid = false; * e.Error = new ErrorInfo("INVALID_CHARACTERS", "The last 9 characters of the Policy No must be Numeric.", "Policy"); * return; * } * * } * else * { * IsExigenValid = false; * e.Error = new ErrorInfo("INVALID_LENGTH", "Policy Number must be of length 13", "Policy"); * return; * } * // MP2.0.Ch2 - End of Code - New Validation has been added for exigen on 1/6/2010 by Cognizant * } * else * { * //AlphaNumeric validation with Dashes * IsValid = Regex.IsMatch(Policy.ToUpper(), @"^[A-Z0-9\-]+$"); * if (!IsValid) * { * e.Error = new ErrorInfo("INVALID_CHARACTERS", "Field must be AlphaNumeric.", "Policy"); * return; * } * //Q4-Retrofit.Ch2-END * * //Format Validation with dashes(ex:"12-34-56-7") * * if ((Policy.Replace("-", "").Length == 7) && (Policy.IndexOf("-") >= 0)) * { * //Match the format "12-34-56-7" * IsValid = (Regex.IsMatch(Policy.ToUpper(), @"^[0123456789ABCDEJKLNRPTVWXYFFHMU]{2,2}-[0-9]{2,2}-[0-9]{2,2}-[0-9]{1,1}$")); * * if (IsValid) * Policy = Policy.Replace("-", ""); * else * { * e.Error = new ErrorInfo("INVALID_POLICY", "The policy format is not valid.", "Policy"); * return; * } * } * } * * * } * //END * if (Policy != "") * { * InsuranceClasses.Service.Insurance I = new InsuranceClasses.Service.Insurance(); * //Start Added by Cognizant on 24-06-2004 for stopping validation for WU products * //Q4-Retrofit.Ch2-START: Added a check for IsHUONAuto to call HUON Check digit validation if it is HUON Auto product * if (validateRequired) * { * * if (IsHUONAuto) * IsValid = (bool)I.ValidateHUONCheckDigit(Policy); * else if (GetIsExigenAuto() == true) // MP2.0.Ch1 - new method added for Exigen policy validation - added by Cognizant on 27/05/2020 * IsValid = IsExigenValid; * //PUP CH2:Added the condition to check policy number for valid PUP policy by cognizant on 01/12/2011. * //PUP CH3:Modified the condition for converting the first 3 chararcters Toupper case - by cognizant on 03/18/2011 * else if (Policy.Length == 10 && Policy.Substring(0, 3).ToUpper() == "PUP") * { * IsValid = IsPupValid; * } * //AZ PAS conversion and PC integration - CH2 - Added the below code to validate Highlimit policy * else if (Policy.Length == 10 && ProductType == Config.Setting("ProductCode.HighLimit") && CSAAWeb.Validate.IsAllNumeric((Policy))) * { * IsValid = true; * } * //AZ PAS conversion and PC integration - CH2 - Added the below code to validate Highlimit policy * // * 67811A0 - PCI Remediation for Payment systems.CH5 START Check if it is not a PCP product type. * else if ((ConfigurationSettings.AppSettings["PCP.Products"]).IndexOf(Convert.ToString(ProductType)) < 0) * // * 67811A0 - PCI Remediation for Payment systems.CH5 End Check if it is not a PCP product type. * { * IsValid = (bool)I.ValidateCheckDigit(Policy); * } * } * //Q4-Retrofit.Ch2-END * //else if(Policy.Length==12) * // * 67811A0 - PCI Remediation for Payment systems.CH5 :START Check if it is not a PCP product type. * else if ((Policy.Length == 12) && (!validateRequired) && (ConfigurationSettings.AppSettings["PCP.Products"]).IndexOf(Convert.ToString(ProductType)) < 0) * IsValid = true; * // * 67811A0 - PCI Remediation for Payment systems.CH5 :END * // 67811A0 - PCI Remediation for Payment systems.CH3:START- Validate Partner Club Products of lengh between 4 to 10 and numeric * else if ((ConfigurationSettings.AppSettings["PCP.Products"]).IndexOf(Convert.ToString(ProductType)) > -1) * { * //* 67811A0 - PCI Remediation for Payment systems.CH7 Start : To validate the HO6 policy sequence for CEA product code * if (((ConfigurationSettings.AppSettings["PCP.StatePrefixCEA"]).IndexOf(Convert.ToString(StrPrefix.ToUpper())) > -1) && ((ConfigurationSettings.AppSettings["PCP.ProductTypeCEA"]).IndexOf(Convert.ToString(ProductType.ToUpper())) > -1)) * //if ((StrPrefix == "HO6") && (ProductType == "CEA")) * { * // InsuranceClasses.Service.Insurance I = new InsuranceClasses.Service.Insurance(); * * * if ((bool)I.ValidateCheckDigit(Splitpolicynumber(Policy))) * { * IsValid = true; * } * else * { * IsValid = false; * e.Error = new ErrorInfo("INVALID_Policy", "Policy Number Sequence is Invalid for Home policy", "Policy"); * return; * } * * } * else if (CSAAWeb.Validate.IsAllNumeric(Splitpolicynumber(Policy))) * { * IsValid = true; * } * else * { * IsValid = false; * e.Error = new ErrorInfo("INVALID_Policy", "Policy Number must be Numeric for Western United Products.", "Policy"); * return; * } * * * //* 67811A0 - PCI Remediation for Payment systems.CH7 END : To validate the HO6 policy sequence for CEA product code * } * // 67811A0 - PCI Remediation for Payment systems.CH3:END * * else * { * IsValid = false; * //throw new CSAAWeb.BusinessRuleException("Policy (" + Policy + ") not valid."); * } * * * //END * I.Close(); * } */ //MAIG - CH1 - END - Modified the logic to Support Common Product Types and to check if it is an valid policy number, Also commenented the unwanted logic if (IsValid == false) { e.Error = new ErrorInfo(Source, e.Field); } }