Ejemplo n.º 1
0
        protected void addButton_OnClick(object sender, EventArgs e)
        {
            Product aProduct = new Product();

            aProduct.ProductName   = nameTextBox.Text;
            aProduct.Price         = Convert.ToDecimal(priceTextBox.Text);
            aProduct.SellingPrice  = Convert.ToDecimal(sellingPriceTextBox.Text);
            aProduct.BrandId       = Convert.ToInt32(brandsDropDownList.SelectedItem.Value);
            aProduct.CategoryId    = Convert.ToInt32(categoryDropDownList.SelectedItem.Value);
            aProduct.SubCategoryId = Convert.ToInt32(subCategoryDropDownList.SelectedItem.Value);
            aProduct.GenderId      = Convert.ToInt32(genderDropDownList.SelectedItem.Value);
            aProduct.Description   = descriptionTextBox.Text;
            aProduct.Details       = productDetailsTextBox.Text;
            aProduct.MaterialCare  = materiaAndCareTextBox.Text;
            if (freeDeliveryCheackBox.Checked == true)
            {
                aProduct.FreeDelivery = 1;
            }
            else
            {
                aProduct.FreeDelivery = 0;
            }
            if (daysReturnCheackBox.Checked == true)
            {
                aProduct.DaysReturn = 1;
            }
            else
            {
                aProduct.DaysReturn = 0;
            }
            if (codCheackBox.Checked == true)
            {
                aProduct.Cod = 1;
            }
            else
            {
                aProduct.Cod = 0;
            }

            messageLabel.ForeColor = Color.Green;
            messageLabel.Text      = aProductBusinessLogic.AddProduct(aProduct, sizeCheackBoxList, quantityTextBox, fileUploadImage01, fileUploadImage02, fileUploadImage03,
                                                                      fileUploadImage04, fileUploadImage05);
        }