Пример #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (ImageUpload.PostedFile != null)
            {
                SaveImage();

                Shopping shopping = new Shopping
                {
                    ProductName       = TxtProductName.Text,
                    ProducDescription = TxtDescriptions.Text,
                    ProductPrice      = TxtPrice.Text.ToString(),
                    ProductImage      = "~/ImageStore/" + ImageUpload.FileName,
                    CategoryID        = Convert.ToInt32(DDLCategory.SelectedValue),
                    ProductQuantity   = Convert.ToInt32(txtQuantity.Text)
                };

                shopping.AddNewProduct();
                ClearText();
            }
        }