AJH.CMS.WEB.UI.Admin.ManageProducts_UC.btnSaveAndStay_Click C# (CSharp) Method

btnSaveAndStay_Click() private method

private btnSaveAndStay_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        void btnSaveAndStay_Click(object sender, EventArgs e)
        {
            try
            {
                Product product = new Product
                {
                    Name = txtName.Text,
                    Description = txtDescription.Text,
                    DisplayTextInStockText = txtDisplayTextInStock.Text,
                    DisplayTextInBackOrderText = txtDisplayTextWhenbackOrder.Text,
                    ShortDescription = txtShortDescription.Text,
                    Tags = txtTags.Text,

                    Ean13OrJan = txtEAN13.Text,
                    UPC = txtUpc.Text,
                    Location = txtLocation.Text,
                    IsDownloadable = cbIsDownloadable.Checked,
                    DisplayOnSaleIcon = cbDisplayOnSaleIcon.Checked,

                    IsEnabled = cbIsEnabled.Checked,

                    SizeChart = txtSizeChart.Text,

                    IsDeleted = false,
                    LanguageID = CMSContext.LanguageID,
                    PortalID = CMSContext.PortalID,
                    ModuleID = (int)CMSEnums.ECommerceModule.Product,
                };

                int supplierID = 0;
                int initialStock = 0;
                int minimumQuantity = 0;
                decimal additionalShippingCost = 0;
                int manufacturarID = 0;
                int taxID = 0;

                int.TryParse(cddlSupplier.SelectedValue, out supplierID);
                product.SupplierID = supplierID;

                int.TryParse(txtInitialStock.Text, out initialStock);
                product.InitialStock = initialStock;

                int.TryParse(txtMinimumQuantity.Text, out minimumQuantity);
                product.MinimumQuantity = minimumQuantity;

                decimal.TryParse(txtAdditionalShippingCost.Text, out additionalShippingCost);
                product.AdditionalShippingCost = additionalShippingCost;

                int.TryParse(cddlManufacturar.SelectedValue, out manufacturarID);
                product.ManufacturarID = manufacturarID;

                int.TryParse(cddlTax.SelectedValue, out taxID);
                product.TaxID = taxID;

                int productId = ProductManager.Add(product);

                Response.Redirect("FrmProduct.aspx?ProductID=" + productId);

            }
            catch (Exception ex)
            {
                dvProductProblems.Visible = true;
                dvProductProblems.InnerText = ex.ToString();
            }
            finally
            {
                upnlProduct.Update();
            }
        }