コード例 #1
0
        public Title_Fault_Codes Verify_Title()
        {
            Title_Fault_Codes retval = 0;

            //Too Long
            if (this.Title.Length > this.Max_Title_Length)
            {
                retval = retval | Title_Fault_Codes.Too_Long;
            }

            //Invalid Chars
            //TODO: Contants should not be defined in methods
            string[] invalidChars = new string[] { "&amp", "&quot" };
            foreach (string invalidChar in invalidChars)
            {
                if (this.Title.Contains(invalidChar))
                {
                    retval = retval | Title_Fault_Codes.Invalid_Chars;
                }
            }

            if (this.Last_Fault_Codes == null)
            {
                this.Last_Fault_Codes = new Product_Fault_Code_Details();
            }

            this.Last_Fault_Codes.Title_Fault_Code = retval;

            return(retval);
        }
コード例 #2
0
        public async Task <Product_Fault_Codes> Verify_Product(Supplier supplier_feed = null)
        {
            Last_Fault_Codes = new Product_Fault_Code_Details();
            Product_Fault_Codes retval = 0;

            //Is price invalid
            List <Cost_Fault_Codes> price_faults = await this.Verify_Price();

            foreach (Cost_Fault_Codes codes in price_faults)
            {
                if ((int)codes > Price_Error_Threshold)
                {
                    retval = retval | Product_Fault_Codes.Invalid_Price;
                }
            }

            //Is title reasonable
            if ((int)this.Verify_Title() > 0)
            {
                retval = retval | Product_Fault_Codes.Poor_Title;
            }

            //Are supplier tags correct - do they match warehouse
            if (!await this.Verify_SupplierTags())
            {
                retval = retval | Product_Fault_Codes.Mismatched_Supplier;
            }

            //Does product have an mbot tag
            if (!Verify_mbotTags())
            {
                retval = retval | Product_Fault_Codes.No_mbot_Tags;
            }

            //Does product have ETA tags
            if (!Verify_ETATags())
            {
                retval = retval | Product_Fault_Codes.No_ETA_Tags;
            }

            //Does Vendor Match Vendor Tag
            if (!Verify_VendorTagMatchesField())
            {
                retval = retval | Product_Fault_Codes.Mismatched_Vendor;
            }

            //Is product description longer than supplier feed one?
            //TODO: Create product description from supplier.  this seems excessive to implement at this time. probably something to implement in MMT Supplier code not here

            //Does product have taxable set
            if (this.Product_Taxable())
            {
                retval = retval | Product_Fault_Codes.Product_Taxable;
            }

            return(retval);
        }