Пример #1
0
 private void ClearForm()
 {
     if (BrandId == 0)
     {
         IdTextbox.Text = "0";
         BrandTextbox.Clear();
     }
     else
     {
         IdTextbox.Text = BrandId.ToString();
         LoadBrandDetails();
     }
 }
Пример #2
0
        public ProductDocument CreateDocument(int index)
        {
            // cheap, naive way to make a unique id
            var id = $"{Category1Id}{Category2Id}{BrandId}{index}";

            var document = new ProductDocument(id, Title);

            document.Categories.Add(new Category {
                Id = Category1Id.ToString(), Name = Category1Name
            });
            document.Categories.Add(new Category {
                Id = Category2Id.ToString(), Name = Category2Name
            });

            document.Brand.Id   = BrandId.ToString();
            document.Brand.Name = BrandName;

            document.ShortDescription = CopyDescription.Substring(0, 57);

            document.Copy.Description = CopyDescription;
            document.Copy.Notes       = CopyNotes;
            document.Copy.Bullets.Add(CopyBullet1);
            document.Copy.Bullets.Add(CopyBullet2);
            document.Copy.Bullets.Add(CopyBullet3);

            document.Price = new Price {
                Currency = "USD", Value = RetailPrice
            };

            document.PrimaryImage.SmallUrl = PrimarySmallImage;
            document.PrimaryImage.LargeUrl = PrimaryLargeImage;

            document.AdditionalImages.Add(new Image()
            {
                SmallUrl = AdditionalImage1Small, LargeUrl = AdditionalImage1Large
            });

            return(document);
        }