Beispiel #1
0
 public RMASwapBL()
 {
     connectionString      = ConfigurationSettings.AppSettings["sqlconn"];
     TSTConnectionString   = ConfigurationSettings.AppSettings["sqlconnMfgTST"];
     objCommonValidationBL = new CommonValidationBL();
     objCommonBL           = new CommonBL();
     objBL = new LicenseBL();
     objParentChildAssociationBL = new ParentChildAssociationBL();
     objEventLogger          = new EventLogger();
     objSoftDeleteLicensesBL = new SoftDeleteLicensesBL();
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="objParentChildAssociationRequest"></param>
        /// <param name="objParentChildAssociationResponse"></param>
        /// <returns></returns>
        public bool ValidateRequest(GetParentChildAssociationRequest objParentChildAssociationRequest, GetParentChildAssociationResponse objParentChildAssociationResponse)
        {
            CommonValidationBL objCommonValidationBL = new CommonValidationBL();
            bool  ValidationStatus = true;
            Int64 countSN          = Convert.ToInt64((ConfigurationSettings.AppSettings["countSN"]));

            if (!objParentChildAssociationRequest.RequestID.IsValidString() && ValidationStatus)
            {
                objParentChildAssociationResponse.ResponseStatus  = (int)Constants.ResponseStatus.InvalidParameter;
                objParentChildAssociationResponse.ResponseMessage = Constants.ResponseStatus.InvalidParameter.ToString();
                ValidationStatus = false;
            }
            if (!objParentChildAssociationRequest.RequestingSystem.IsValidString() && ValidationStatus)
            {
                objParentChildAssociationResponse.ResponseStatus  = (int)Constants.ResponseStatus.InvalidParameter;
                objParentChildAssociationResponse.ResponseMessage = Constants.ResponseStatus.InvalidParameter.ToString();
                ValidationStatus = false;
            }
            if (!objParentChildAssociationRequest.RequestingSystem.IsValidString() && ValidationStatus)
            {
                objParentChildAssociationResponse.ResponseStatus  = (int)Constants.ResponseStatus.InvalidParameter;
                objParentChildAssociationResponse.ResponseMessage = Constants.ResponseStatus.InvalidParameter.ToString();
                ValidationStatus = false;
            }
            if (objCommonValidationBL.DupCheckRequestId(objParentChildAssociationRequest.RequestID, objParentChildAssociationRequest.RequestingSystem) && ValidationStatus)
            {
                objParentChildAssociationResponse.ResponseStatus  = (int)Constants.ResponseStatus.AmbigousRequest;
                objParentChildAssociationResponse.ResponseMessage = Constants.ResponseMessage[3].ToString();
                ValidationStatus = false;
            }
            if ((objParentChildAssociationRequest.SNum == null || objParentChildAssociationRequest.SNum.Length < 1 || objParentChildAssociationRequest.SNum.Length > countSN) && ValidationStatus)  //VALIDATE SNUM UNIT (MAX 100)
            {
                objParentChildAssociationResponse.ResponseStatus  = (int)Constants.ResponseStatus.InvalidParameter;
                objParentChildAssociationResponse.ResponseMessage = "Invalid SNum List";
                ValidationStatus = false;
            }
            if (objParentChildAssociationRequest.SNum != null && ValidationStatus)
            {
                for (int i = 0; i < objParentChildAssociationRequest.SNum.Length; i++)
                {
                    if (!objParentChildAssociationRequest.SNum[i].IsValidSNumFormat() && ValidationStatus)  //VALIDATE SNUM FORMAT
                    {
                        objParentChildAssociationResponse.ResponseStatus  = (int)Constants.ResponseStatus.InvalidParameter;
                        objParentChildAssociationResponse.ResponseMessage = "Invalid SNum Format";
                        ValidationStatus = false;
                    }
                }
            }
            return(ValidationStatus);
        }
 public SoftDeleteLicensesBL()
 {
     connectionString      = ConfigurationSettings.AppSettings["sqlconn"];
     objCommonValidationBL = new CommonValidationBL();
 }
Beispiel #4
0
 public SetSKUMetadataBL()
 {
     connectionString      = ConfigurationSettings.AppSettings["sqlconn"];
     objCommonValidationBL = new CommonValidationBL();
 }
 public SoftwareVersionsBL()
 {
     connectionString      = ConfigurationSettings.AppSettings["sqlconn"];
     objCommonValidationBL = new CommonValidationBL();
 }