AJH.CMS.WEB.UI.Admin.ManageSupplier_UC.btnSave_Click C# (CSharp) Метод

btnSave_Click() приватный Метод

private btnSave_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
Результат void
        void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                Supplier supplier = new Supplier();
                supplier.IsDeleted = false;
                supplier.LanguageID = CMSContext.LanguageID;
                supplier.PortalID = CMSContext.PortalID;

                supplier.Name = txtName.Text;
                supplier.Description = txtDescription.Text;
                supplier.IsEnabled = cbIsEnabled.Checked;

                int parentSupplierId = -1;
                int.TryParse(ddlParentSupplier.SelectedValue, out parentSupplierId);
                if (parentSupplierId > 0)
                    supplier.ParentSupplierID = parentSupplierId;

                List<string> files = ucSWFUpload.GetFilesName();
                if (files.Count > 0)
                    supplier.LogoImage = files[0];
                else
                    supplier.LogoImage = string.Empty;

                supplier.MetaTitle = txtMetaTitle.Text;
                supplier.MetaDescription = txtMetaDescription.Text;
                supplier.MetaKeywords = txtMetaKeywords.Text;

                supplier.ModuleID = (int)CMSEnums.ECommerceModule.Supplier;
                SupplierManager.Add(supplier);

                BeginAddMode();

                FillSupplierTree();
                upnlSupplier.Update();
            }
            catch (Exception ex)
            {
                dvProblems.Visible = true;
                dvProblems.InnerText = ex.ToString();
                upnlSupplier.Update();
            }
        }