예제 #1
0
        public static string GetName(DSFileTypes type)
        {
            switch (type)
            {
            case DSFileTypes.ItemsFull:
                return("Items");

            case DSFileTypes.ItemsLite:
                return("Inventory");
            }
            return("");
        }
예제 #2
0
        public IList <string> GetSourceFieldsListForIncomingFeed(DSFileTypes feedType, DSProductType productType)
        {
            var results = new List <string>();

            if (feedType == DSFileTypes.ItemsFull)
            {
                var featureList = new List <string>();
                var itemTypeId  = DSHelper.GetItemTypeIdFromDSProductType((int)productType);
                using (var db = _dbFactory.GetRDb())
                {
                    featureList = db.Features.GetAllAsDto()
                                  .Where(f => f.ItemTypeId == itemTypeId ||
                                         !f.ItemTypeId.HasValue)
                                  .OrderBy(f => f.Order)
                                  .Select(f => f.Name)
                                  .ToList();
                }

                results.Add("SKU");
                //results.Add("Model");
                results.Add("Qty");
                results.Add("Cost");
                results.Add("Sale Price");
                results.Add("MSRP");
                results.Add("Barcode");
                results.Add("Name");
                results.Add("Description");
                results.Add("Main Image");
                results.Add("Image 1");
                results.Add("Image 2");
                results.Add("Image 3");

                //featureList = featureList.Where(f => f != "Product Type").ToList();

                results.AddRange(featureList);
            }
            if (feedType == DSFileTypes.ItemsLite)
            {
                results.Add("SKU");
                results.Add("Sale Price");
                results.Add("Qty");
                results.Add("Cost");
            }

            return(results);
        }