Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zonecurrent = ZoneUtility.GetZoneCurrent();
            var source = ZoneDB.GetByParentID(_zonecurrent);

            if (source.Rows.Count == 0)
            {
                pntSub.Visible = false;

                var zoneInfo = ZoneDB.GetInfo(_zonecurrent);
                if (zoneInfo != null)
                {
                    pnZoneName.Visible = true;
                    litZoneName.Text   = zoneInfo.Zone_Name;
                    var listStyle = zoneInfo.Zone_ContentListingDisplay;
                    if (listStyle == "one")
                    {
                        PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/NewsFocus.ascx"));
                    }
                    else
                    {
                        PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/NewsList.ascx"));
                    }
                }
                else
                {
                    Response.Redirect("/");
                }
            }
            else
            {
                rptData.DataSource = source;
                rptData.DataBind();
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zonecurrent = ZoneUtility.GetZoneCurrent();

            var zoneInfo = ZoneDB.GetInfo(_zonecurrent);

            if (zoneInfo != null)
            {
                lnkZone.Text        = zoneInfo.Zone_Name;
                lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zonecurrent);
                var listStyle = zoneInfo.Zone_ContentListingDisplay;
                if (listStyle == "one")
                {
                    SpecialInZone1.Visible = false;
                    PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/NewsFocus.ascx"));
                }
                else
                {
                    PlaceHolder1.Controls.Add(Page.LoadControl("Project/TuyenSinhList.ascx"));
                }
            }
            else
            {
                Response.Redirect("/");
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "tuyensinhhome";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

            if (zoneid <= 0)
            {
                return;
            }
            var info = ZoneDB.GetInfo(zoneid);

            if (info == null)
            {
                return;
            }

            lnkOther.NavigateUrl = UrlFilter.BuildUrlByZoneID(info.Zone_ParentID);

            string lang = AppEnv.GetLanguageFrontEnd();

            var zoneClassRegister = ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + lang));

            lnkRegister.NavigateUrl = UrlFilter.BuildUrlByZoneID(zoneClassRegister);

            var dtData = DistributionDB.GetContentByZoneIDselfAndNumberRecord(zoneid, 10);

            if (dtData.Rows.Count <= 0)
            {
                return;
            }

            rptData.DataSource = dtData;
            rptData.DataBind();
        }
Ejemplo n.º 4
0
        private void LoadInfo(int zoneID)
        {
            hddID.Value = "";
            ZoneInfo info = ZoneDB.GetInfo(zoneID);

            if (info == null)
            {
                //  cmdEmpty_Click(null, null);
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                return;
            }

            btnUpdate.Enabled = true;
            btnDelete.Enabled = true;

            hddID.Value = info.Zone_ID.ToString();

            dropZones.SelectedIndex = -1;
            if (dropZones.Items.FindByValue(info.Zone_ParentID.ToString()) != null)
            {
                dropZones.Items.FindByValue(info.Zone_ParentID.ToString()).Selected = true;
            }

            txtName.Text = info.Zone_Name;
            txtDescriptionCK.HtmlValue = info.Zone_Description;
            txtFriendlyUrl.Text        = info.Zone_FriendlyUrl;
            txtRealUrl.Text            = info.Zone_RealUrl;
            txtAvatar.Text             = info.Zone_Avatar;
            //priority field


            //lang field
            //isStandAloneBox field
        }
Ejemplo n.º 5
0
        private void LoadInfo(int zoneID)
        {
            hddID.Value = "";
            ZoneInfo info = ZoneDB.GetInfo(zoneID);

            if (info == null)
            {
                //  cmdEmpty_Click(null, null);
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                return;
            }

            btnUpdate.Enabled = true;
            btnDelete.Enabled = true;

            hddID.Value = info.Zone_ID.ToString();

            dropZones.SelectedIndex = -1;
            if (dropZones.Items.FindByValue(info.Zone_ParentID.ToString()) != null)
            {
                dropZones.Items.FindByValue(info.Zone_ParentID.ToString()).Selected = true;
            }

            txtName.Text        = info.Zone_Name;
            txtDescription.Text = info.Zone_Description;
            txtFriendlyUrl.Text = info.Zone_FriendlyUrl;
            txtRealUrl.Text     = info.Zone_RealUrl;
            txtAvatar.Text      = info.Zone_Avatar;
            //priority field
            txtMetaDescription.Text = info.Zone_MetaDescription;
            txtMetaKeywords.Text    = info.Zone_MetaKeywords;

            dropLayout.SelectedIndex = -1;
            if (dropLayout.Items.FindByValue(info.Zone_Layout) != null)
            {
                dropLayout.Items.FindByValue(info.Zone_Layout).Selected = true;
            }

            dropSubcategoryDisplay.SelectedIndex = -1;
            dropSubcategoryDisplay.SelectedValue = info.Zone_SubcategoryDisplay;

            dropContentDisplay.SelectedIndex = -1;
            dropContentDisplay.SelectedValue = info.Zone_ContentListingDisplay;

            chkMainNav.Checked   = info.Zone_VisibleInMainNav;
            chkLeftNav.Checked   = info.Zone_VisibleInLeftNav;
            chkTopNav.Checked    = info.Zone_VisibleInTopNav;
            chkFooterNav.Checked = info.Zone_VisibleInFooterNav;

            chkExcludeFromNav.Checked = info.Zone_ExcludeFromNav;
            chkVisible.Checked        = info.Zone_Visible;
            chkDisable.Checked        = info.Zone_Disable;

            //lang field
            //isStandAloneBox field
        }
Ejemplo n.º 6
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (hddID.Value == "")
            {
                return;
            }

            ZoneInfo info = ZoneDB.GetInfo(ConvertUtility.ToInt32(hddID.Value));

            if (info == null)
            {
                Reset();
                return;
            }

            if (txtName.Text.Trim() == "")
            {
                lblStatusUpdate.Text = AppEnv.NoticeRequired(lang, "TÊN MỤC");
                return;
            }


            info.Zone_ParentID    = ConvertUtility.ToInt32(dropZones.SelectedValue);
            info.Zone_Name        = txtName.Text.Trim();
            info.Zone_Description = txtDescriptionCK.HtmlValue;
            info.Zone_FriendlyUrl = txtFriendlyUrl.Text.Replace(" ", "");
            info.Zone_RealUrl     = txtRealUrl.Text.Trim();
            info.Zone_Avatar      = txtAvatar.Text.Trim();
            //priority field
            info.Zone_Lang = lang;

            if (info.Zone_ID == info.Zone_ParentID)
            {
                lblStatusUpdate.Text = "<font color='red'>" + (lang == "vi-VN" ? " Trùng mục cha, chọn mục cha khác !" : "The same Index Parent,Select other index Parent !") + "</font>";
                return;
            }
            if (ZoneDB.Update(info))
            {
                lblStatusUpdate.Text = AppEnv.NoticeEdit(lang, true);
                hddID.Value          = "";
                btnUpdate.Enabled    = false;
                btnDelete.Enabled    = false;
                Reset();
            }
            else
            {
                lblStatusUpdate.Text = AppEnv.NoticeEdit(lang, false);
            }

            LoadZones();
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zonecurrent = ZoneUtility.GetZoneCurrent();

            var zoneInfo = ZoneDB.GetInfo(_zonecurrent);

            if (zoneInfo != null)
            {
                lnkZone.Text        = zoneInfo.Zone_Name;
                lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zonecurrent);
            }
            else
            {
                Response.Redirect("/");
            }
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "homebottomright";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

            if (zoneid <= 0)
            {
                return;
            }
            var info = ZoneDB.GetInfo(zoneid);

            if (info == null)
            {
                return;
            }

            var realUrl = (info.Zone_RealUrl);

            if (realUrl.Length > 0)
            {
                lnkOther.NavigateUrl = realUrl;
            }
            else
            {
                lnkOther.NavigateUrl = UrlFilter.BuildUrlByZoneID(info.Zone_ParentID);
            }

            var dtSpecial = DistributionDB.GetContentByZoneIDAndRank(zoneid, 1, (int)AppEnv.CMSContentRank.Special);

            if (dtSpecial.Rows.Count > 0)
            {
                rptSpecial.DataSource = dtSpecial;
                rptSpecial.DataBind();
            }

            var dtData = DistributionDB.GetContentByZoneIDAndRank(zoneid, 3, (int)AppEnv.CMSContentRank.Default);

            if (dtData.Rows.Count <= 0)
            {
                return;
            }

            rptData.DataSource = dtData;
            rptData.DataBind();
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "addresshome";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

            if (zoneid <= 0)
            {
                return;
            }
            var info = ZoneDB.GetInfo(zoneid);

            if (info == null)
            {
                return;
            }

            litContent.Text = info.Zone_Description;
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "tuyensinhtrangtrong";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

            if (zoneid <= 0)
            {
                return;
            }
            var info = ZoneDB.GetInfo(zoneid);

            if (info == null)
            {
                return;
            }

            //litName.Text = info.Zone_Name;
            litContent.Text = info.Zone_Description;
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "homebottomcenter";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

            if (zoneid <= 0)
            {
                return;
            }
            var info = ZoneDB.GetInfo(zoneid);

            if (info == null)
            {
                return;
            }

            var avatar = info.Zone_Avatar;

            if (avatar.Length > 0)
            {
                imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 235, 0);
            }
            else
            {
                imgAvatar.Visible = false;
            }

            lnkName.Text = info.Zone_Name;

            var realUrl = info.Zone_RealUrl;

            if (realUrl.Length > 0)
            {
                lnkOther.NavigateUrl = lnkName.NavigateUrl = realUrl;
            }
            else
            {
                lnkOther.NavigateUrl = lnkName.NavigateUrl = UrlFilter.BuildUrlByZoneID(info.Zone_ParentID);
            }
        }
Ejemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "homebottomleft";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

            if (zoneid <= 0)
            {
                return;
            }
            var info = ZoneDB.GetInfo(zoneid);

            if (info == null)
            {
                return;
            }

            lnkZoneName.Text = info.Zone_Name;

            var realUrl = (info.Zone_RealUrl);

            if (realUrl.Length > 0)
            {
                lnkMore.NavigateUrl = lnkZoneName.NavigateUrl = realUrl;
            }
            else
            {
                lnkMore.NavigateUrl = lnkZoneName.NavigateUrl = UrlFilter.BuildUrlByZoneID(info.Zone_ParentID);
            }

            var dtData = DistributionDB.GetContentByZoneIDselfAndNumberRecord(zoneid, 2);

            if (dtData.Rows.Count <= 0)
            {
                return;
            }

            rptData.DataSource = dtData;
            rptData.DataBind();
        }
Ejemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "subvideo";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

            if (zoneid <= 0)
            {
                return;
            }
            var info = ZoneDB.GetInfo(zoneid);

            if (info == null)
            {
                return;
            }

            lnkName.Text = info.Zone_Name;

            var realUrl = (info.Zone_RealUrl);

            if (realUrl.Length > 0)
            {
                lnkName.NavigateUrl = realUrl;
            }
            else
            {
                lnkName.NavigateUrl = UrlFilter.BuildUrlByZoneID(info.Zone_ParentID);
            }

            var dtSpecial = DistributionDB.GetContentRandomByZoneIDselfAndNumberRecord(zoneid, 1);

            if (dtSpecial.Rows.Count > 0)
            {
                rptSpecial.DataSource = dtSpecial;
                rptSpecial.DataBind();
            }
        }
Ejemplo n.º 14
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (hddID.Value == "")
            {
                return;
            }

            ZoneInfo info = ZoneDB.GetInfo(ConvertUtility.ToInt32(hddID.Value));

            if (info == null)
            {
                Reset();
                return;
            }

            if (txtName.Text.Trim() == "")
            {
                lblStatusUpdate.Text = AppEnv.NoticeRequired(lang, "TÊN MỤC");
                return;
            }


            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();
            //priority field
            info.Zone_MetaDescription       = txtDescription.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;

            if (info.Zone_ID == info.Zone_ParentID)
            {
                lblStatusUpdate.Text = "<font color='red'>" + (lang == "vi-VN" ? " Trùng mục cha, chọn mục cha khác !" : "The same Index Parent,Select other index Parent !") + "</font>";
                return;
            }
            if (ZoneDB.Update(info))
            {
                lblStatusUpdate.Text = AppEnv.NoticeEdit(lang, true);
                hddID.Value          = "";
                btnUpdate.Enabled    = false;
                btnDelete.Enabled    = false;
                Reset();
            }
            else
            {
                lblStatusUpdate.Text = AppEnv.NoticeEdit(lang, false);
            }

            LoadZones();
        }