示例#1
0
        public virtual ProductType UpdateProductType(ProductType entity)
        {
            if (entity.IsTransient())
            {
                return(entity);
            }
            ProductType other = GetProductType(entity.ProductTypeId);

            if (entity.Equals(other))
            {
                return(entity);
            }
            string sql = @"Update ProductType set  [ProductTypeGUID]=@ProductTypeGUID
							, [Name]=@Name
							, [DisplayOrder]=@DisplayOrder
							, [TaxClassID]=@TaxClassID
							, [CreatedOn]=@CreatedOn 
							 where ProductTypeID=@ProductTypeID"                            ;

            SqlParameter[] parameterArray = new SqlParameter[] {
                new SqlParameter("@ProductTypeID", entity.ProductTypeId)
                , new SqlParameter("@ProductTypeGUID", entity.ProductTypeGuid)
                , new SqlParameter("@Name", entity.Name)
                , new SqlParameter("@DisplayOrder", entity.DisplayOrder)
                , new SqlParameter("@TaxClassID", entity.TaxClassId)
                , new SqlParameter("@CreatedOn", entity.CreatedOn)
            };
            SqlHelper.ExecuteNonQuery(this.ConnectionString, CommandType.Text, sql, parameterArray);
            return(GetProductType(entity.ProductTypeId));
        }
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is CatalogItem other &&
                   ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) &&
                   ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) &&
                   ((Abbreviation == null && other.Abbreviation == null) || (Abbreviation?.Equals(other.Abbreviation) == true)) &&
                   ((LabelColor == null && other.LabelColor == null) || (LabelColor?.Equals(other.LabelColor) == true)) &&
                   ((AvailableOnline == null && other.AvailableOnline == null) || (AvailableOnline?.Equals(other.AvailableOnline) == true)) &&
                   ((AvailableForPickup == null && other.AvailableForPickup == null) || (AvailableForPickup?.Equals(other.AvailableForPickup) == true)) &&
                   ((AvailableElectronically == null && other.AvailableElectronically == null) || (AvailableElectronically?.Equals(other.AvailableElectronically) == true)) &&
                   ((CategoryId == null && other.CategoryId == null) || (CategoryId?.Equals(other.CategoryId) == true)) &&
                   ((TaxIds == null && other.TaxIds == null) || (TaxIds?.Equals(other.TaxIds) == true)) &&
                   ((ModifierListInfo == null && other.ModifierListInfo == null) || (ModifierListInfo?.Equals(other.ModifierListInfo) == true)) &&
                   ((Variations == null && other.Variations == null) || (Variations?.Equals(other.Variations) == true)) &&
                   ((ProductType == null && other.ProductType == null) || (ProductType?.Equals(other.ProductType) == true)) &&
                   ((SkipModifierScreen == null && other.SkipModifierScreen == null) || (SkipModifierScreen?.Equals(other.SkipModifierScreen) == true)) &&
                   ((ItemOptions == null && other.ItemOptions == null) || (ItemOptions?.Equals(other.ItemOptions) == true)));
        }
示例#3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is DeviceCode other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) &&
                   ((Code == null && other.Code == null) || (Code?.Equals(other.Code) == true)) &&
                   ((DeviceId == null && other.DeviceId == null) || (DeviceId?.Equals(other.DeviceId) == true)) &&
                   ((ProductType == null && other.ProductType == null) || (ProductType?.Equals(other.ProductType) == true)) &&
                   ((LocationId == null && other.LocationId == null) || (LocationId?.Equals(other.LocationId) == true)) &&
                   ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) &&
                   ((PairBy == null && other.PairBy == null) || (PairBy?.Equals(other.PairBy) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((StatusChangedAt == null && other.StatusChangedAt == null) || (StatusChangedAt?.Equals(other.StatusChangedAt) == true)) &&
                   ((PairedAt == null && other.PairedAt == null) || (PairedAt?.Equals(other.PairedAt) == true)));
        }
示例#4
0
        public override bool Equals(object obj)
        {
            var other = obj as ProductResult;

            if (other != null)
            {
                return(ProductType.Equals(other.ProductType) && ModelNode.Equals(other.ModelNode) &&
                       Productid == other.Productid && Start == other.Start);
            }
            return(false);
        }
示例#5
0
        /// <summary>
        /// Returns true if LineItemLevel3InterchangeInformation instances are equal
        /// </summary>
        /// <param name="other">Instance of LineItemLevel3InterchangeInformation to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(LineItemLevel3InterchangeInformation other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     DiscountAmount == other.DiscountAmount ||
                     DiscountAmount != null &&
                     DiscountAmount.Equals(other.DiscountAmount)
                     ) &&
                 (
                     LineAmountTotal == other.LineAmountTotal ||
                     LineAmountTotal != null &&
                     LineAmountTotal.Equals(other.LineAmountTotal)
                 ) &&
                 (
                     ProductCode == other.ProductCode ||
                     ProductCode != null &&
                     ProductCode.Equals(other.ProductCode)
                 ) &&
                 (
                     ProductPrice == other.ProductPrice ||
                     ProductPrice != null &&
                     ProductPrice.Equals(other.ProductPrice)
                 ) &&
                 (
                     ProductType == other.ProductType ||
                     ProductType != null &&
                     ProductType.Equals(other.ProductType)
                 ) &&
                 (
                     Quantity == other.Quantity ||
                     Quantity != null &&
                     Quantity.Equals(other.Quantity)
                 ) &&
                 (
                     TaxAmount == other.TaxAmount ||
                     TaxAmount != null &&
                     TaxAmount.Equals(other.TaxAmount)
                 ) &&
                 (
                     Unit == other.Unit ||
                     Unit != null &&
                     Unit.Equals(other.Unit)
                 ));
        }
示例#6
0
        private void GetAntiVirusStatus()
        {
            // This is a combination of information from the following sources

            // http://neophob.com/2010/03/wmi-query-windows-securitycenter2/
            // https://mspscripts.com/get-installed-antivirus-information-2/
            // https://gallery.technet.microsoft.com/scriptcenter/Get-the-status-of-4b748f25
            // https://stackoverflow.com/questions/4700897/wmi-security-center-productstate-clarification/4711211
            // https://blogs.msdn.microsoft.com/alejacma/2008/05/12/how-to-get-antivirus-information-with-wmi-vbscript/#comment-442

            // Only works if not a server
            if (!string.IsNullOrEmpty(ProductType) && ProductType.Equals(Workstation))
            {
                ManagementObjectSearcher   searcher = new ManagementObjectSearcher(@"root\SecurityCenter2", QueryAntiVirusProduct);
                ManagementObjectCollection objCol   = searcher.Get();

                try
                {
                    List <string> products = new List <string>();
                    foreach (var o in objCol)
                    {
                        var mgtObject = (ManagementObject)o;
                        var product   = mgtObject["DisplayName"].ToString();

                        var status = int.Parse(mgtObject["ProductState"].ToString());

                        var hex      = Hex(status);
                        var bin      = Binary(status);
                        var reversed = Reverse(bin);

                        // https://blogs.msdn.microsoft.com/alejacma/2008/05/12/how-to-get-antivirus-information-with-wmi-vbscript/#comment-442
                        // 19th bit = Not so sure but, AV is turned on (I wouldn't be sure it's enabled)
                        // 13th bit = On Access Scanning (Memory Resident Scanning) is on, this tells you that the product is scanning every file that you open as opposed to just scanning at regular intervals.
                        //  5th Bit = If this is true (==1) the virus scanner is out of date

                        bool enabled  = GetBit(reversed, 18);
                        bool scanning = GetBit(reversed, 12);
                        bool outdated = GetBit(reversed, 4);

                        products.Add($"{product} Status: {status} [0x{hex}] --> Enabled: {enabled} Scanning: {scanning} Outdated: {outdated}");
                    }

                    // Return distinct list of products and states
                    _antiVirusStatus = string.Join(";", products.Distinct());
                }
                catch (Exception exception)
                {
                    _antiVirusStatus = $"{exception.Message}";
                }
            }
        }
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is ListDeviceCodesRequest other &&
                   ((Cursor == null && other.Cursor == null) || (Cursor?.Equals(other.Cursor) == true)) &&
                   ((LocationId == null && other.LocationId == null) || (LocationId?.Equals(other.LocationId) == true)) &&
                   ((ProductType == null && other.ProductType == null) || (ProductType?.Equals(other.ProductType) == true)) &&
                   ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)));
        }
示例#8
0
        public int CompareTo(ProductResult other)
        {
            if (ProductType.Equals(other.ProductType) && ModelNode.Equals(other.ModelNode) && Productid == other.Productid && Start == other.Start)
            {
                return(0);
            }
            var i = System.String.Compare(ProductType, other.ProductType, System.StringComparison.Ordinal);

            if (i != 0)
            {
                return(i);
            }
            i = System.String.Compare(ModelNode, other.ModelNode, System.StringComparison.Ordinal);
            if (i != 0)
            {
                return(i);
            }
            i = (int)(Productid - other.Productid);
            if (i != 0)
            {
                return(i);
            }
            return((int)(Start - other.Start));
        }
        /// <summary>
        /// Returns true if OrderLineDetails instances are equal
        /// </summary>
        /// <param name="other">Instance of OrderLineDetails to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrderLineDetails other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     DiscountAmount == other.DiscountAmount ||
                     DiscountAmount != null &&
                     DiscountAmount.Equals(other.DiscountAmount)
                     ) &&
                 (
                     GoogleProductCategoryId == other.GoogleProductCategoryId ||
                     GoogleProductCategoryId != null &&
                     GoogleProductCategoryId.Equals(other.GoogleProductCategoryId)
                 ) &&
                 (
                     LineAmountTotal == other.LineAmountTotal ||
                     LineAmountTotal != null &&
                     LineAmountTotal.Equals(other.LineAmountTotal)
                 ) &&
                 (
                     ProductCategory == other.ProductCategory ||
                     ProductCategory != null &&
                     ProductCategory.Equals(other.ProductCategory)
                 ) &&
                 (
                     ProductCode == other.ProductCode ||
                     ProductCode != null &&
                     ProductCode.Equals(other.ProductCode)
                 ) &&
                 (
                     ProductName == other.ProductName ||
                     ProductName != null &&
                     ProductName.Equals(other.ProductName)
                 ) &&
                 (
                     ProductPrice == other.ProductPrice ||
                     ProductPrice != null &&
                     ProductPrice.Equals(other.ProductPrice)
                 ) &&
                 (
                     ProductType == other.ProductType ||
                     ProductType != null &&
                     ProductType.Equals(other.ProductType)
                 ) &&
                 (
                     Quantity == other.Quantity ||
                     Quantity != null &&
                     Quantity.Equals(other.Quantity)
                 ) &&
                 (
                     TaxAmount == other.TaxAmount ||
                     TaxAmount != null &&
                     TaxAmount.Equals(other.TaxAmount)
                 ) &&
                 (
                     Unit == other.Unit ||
                     Unit != null &&
                     Unit.Equals(other.Unit)
                 ));
        }
        // 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);
            }
        }