public async Task <IActionResult> EditAttributes(string id)
        {
            ProductDetailsPageData productDetailsPageData = new ProductDetailsPageData();

            productDetailsPageData = await _BadgerApiHelper.GenericGetAsync <ProductDetailsPageData>("/Product/detailpage/" + id);

            //  dynamic AttributeListDetails = new ExpandoObject();
            //  VendorPageModal.VendorCount = vendorPagerList.Count;
            //  VendorPageModal.VendorLists = vendorPagerList.vendorInfo;
            // VenderAdressandRep venderAdressandRep = await _BadgerApiHelper.GenericGetAsync<VenderAdressandRep>("/Vendor/detailsaddressandrep/103");

            //VendorPageModal.Reps = venderAdressandRep.Reps;
            return(View("EditAttributes", productDetailsPageData));
        }
示例#2
0
        public async Task <ProductDetailsPageData> GetProductDetailPage(string id)
        {
            ProductDetailsPageData productDetailsPageData = new ProductDetailsPageData();

            try
            {
                productDetailsPageData.Product = await _ProductRepo.GetByIdAsync(Convert.ToInt32(id));

                productDetailsPageData.productProperties = await _ProductRepo.GetProductProperties(id);

                productDetailsPageData.productcolorwiths = await _ProductRepo.GetProductcolorwiths(id);

                productDetailsPageData.productpairwiths = await _ProductRepo.GetProductpairwiths(id);

                productDetailsPageData.product_Images = await _ProductRepo.GetProductImages(id);

                productDetailsPageData.ProductDetails = await _ProductRepo.GetProductDetails(id);

                List <Notes> note = new List <Notes>(); //await _notesAndDocHelper.GenericNote<Notes>(Convert.ToInt32(id), 1, 1);
                if (note.Count > 0)
                {
                    productDetailsPageData.Product_Notes = note[0].note;
                }
                else
                {
                    productDetailsPageData.Product_Notes = "";
                }
                productDetailsPageData.AllColors = await _ProductRepo.GetAllProductColors();

                productDetailsPageData.AllTags = await _ProductRepo.GetAllProductTags();

                productDetailsPageData.shootstatus = await _ProductRepo.GetProductShootStatus(id);

                productDetailsPageData.shootModels = await _ProductRepo.GetPhotoshootModels();

                productDetailsPageData.productCategories = await _ProductRepo.GetProductCategories(id);

                productDetailsPageData.productPhotoshootModel = await _ProductRepo.GetProductPhotoshootModel(id);

                //(SELECT CAST(CONCAT('[', GROUP_CONCAT(JSON_OBJECT('product_category_id', pc.product_category_id, 'category_id', pc.category_id)), ']') AS JSON) AS productCategories  FROM product_categories pc WHERE pc.product_id = product.product_id) productCategories
            }
            catch (Exception ex)
            {
                var logger = _loggerFactory.CreateLogger("internal_error_log");
                logger.LogInformation("Problem happened in selecting the data for ProductDetailsPageData with message" + ex.Message);
            }
            return(productDetailsPageData);
        }