Example #1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            hddID.Value       = "";
            btnUpdate.Enabled = false;
            btnDelete.Enabled = false;

            if (txtName.Text.Trim() == "")
            {
                lblStatusUpdate.Text = AppEnv.NoticeRequired(lang, "TÊN TRƯỜNG");
                return;
            }

            var info = new ZoneInfo();

            info.Zone_ParentID    = ConvertUtility.ToInt32(dropZones.SelectedValue);
            info.Zone_Name        = txtName.Text.Trim();
            info.Zone_Description = txtDescription.Text;

            info.Zone_FriendlyUrl = UnicodeUtility.UnicodeToFriendlyUrl(txtName.Text);

            info.Zone_RealUrl               = txtRealUrl.Text.Trim();
            info.Zone_Avatar                = txtAvatar.Text.Trim();
            info.Zone_Priority              = ZoneDB.GetChildCount(ConvertUtility.ToInt32(dropZones.SelectedValue));
            info.Zone_MetaDescription       = txtMetaDescription.Text;
            info.Zone_MetaKeywords          = txtMetaKeywords.Text;
            info.Zone_Layout                = dropLayout.SelectedValue;
            info.Zone_SubcategoryDisplay    = dropSubcategoryDisplay.SelectedValue;
            info.Zone_ContentListingDisplay = dropContentDisplay.SelectedValue;
            info.Zone_VisibleInMainNav      = chkMainNav.Checked;
            info.Zone_VisibleInLeftNav      = chkLeftNav.Checked;
            info.Zone_VisibleInTopNav       = chkTopNav.Checked;
            info.Zone_VisibleInFooterNav    = chkFooterNav.Checked;
            info.Zone_ExcludeFromNav        = chkExcludeFromNav.Checked;
            info.Zone_Visible               = chkVisible.Checked;
            info.Zone_Disable               = chkDisable.Checked;
            info.Zone_Lang            = lang;
            info.Zone_IsStandAloneBox = false;

            if (ZoneDB.Insert(info))
            {
                lblStatusUpdate.Text = AppEnv.NoticeAdd(lang, true);
                Reset();
            }
            else
            {
                lblStatusUpdate.Text = AppEnv.NoticeAdd(lang, false);
            }
            LoadZones();
        }