AJH.CMS.WEB.UI.Admin.ManageCatalog_UC.btnSave_Click C# (CSharp) Method

btnSave_Click() private method

private btnSave_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                Catalog catalog = new Catalog();

                catalog.IsDeleted = false;
                catalog.LanguageID = CMSContext.LanguageID;
                catalog.PortalID = CMSContext.PortalID;
                catalog.Description = txtDescription.Text;

                catalog.IsDisplayed = cbIsDisplayed.Checked;
                catalog.IsGalleryOnly = cbIsGalleryOnly.Checked;
                catalog.IsPublished = cbIsPublishedOnslider.Checked;

                catalog.MetaDescription = txtMetaDescription.Text;
                catalog.MetaKeywords = txtMetaKeywords.Text;
                catalog.MetaTitle = txtMetaTitle.Text;
                catalog.ModuleID = (int)CMSEnums.ECommerceModule.Catalog;
                catalog.Name = txtName.Text;

                int catalogOrder = 0;
                int.TryParse(txtCatalogOrder.Text, out catalogOrder);
                catalog.Order = catalogOrder;

                int parentCatalogId = -1;
                int.TryParse(ddlParentCatalog.SelectedValue, out parentCatalogId);

                catalog.ParentCalalogID = parentCatalogId;

                CatalogManager.Add(catalog);

                BeginAddMode();

                FillCatalogTree();
                upnlCatalog.Update();
            }
            catch (Exception ex)
            {
                dvProblems.Visible = true;
                dvProblems.InnerText = ex.ToString();
                upnlCatalog.Update();
            }
        }
        #endregion