Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zoneCurrent = ZoneUtility.GetZoneCurrent();

            lnkZone.Text        = ZoneDB.GetZoneNameByID(_zoneCurrent);
            lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zoneCurrent);

            var source = DistributionDB.GetNewContentByZoneIDNoPage(_zoneCurrent, true, _excludeSpecial);

            if (source.Rows.Count > 0)
            {
                CollectionPager1.DataSource    = source.DefaultView;
                CollectionPager1.BindToControl = rptData;

                if (AppEnv.GetLanguageFrontEnd() == "vi-VN")
                {
                    CollectionPager1.LabelText = "Trang: ";
                }
                else
                {
                    CollectionPager1.LabelText = "Page: ";
                }

                CollectionPager1.BackText              = "<<";
                CollectionPager1.PageNumbersSeparator  = "&nbsp;&nbsp;&nbsp;";
                CollectionPager1.BackNextLinkSeparator = "&nbsp;&nbsp;&nbsp;";

                rptData.DataSource = CollectionPager1.DataSourcePaged;
                rptData.DataBind();
            }
            else
            {
                rptData.Visible = false;
            }
        }
Esempio n. 2
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (!IsPostBack)
            {
                string    zoneDeployed   = "|";
                DataTable dtZoneDeployed = DistributionDB.GetZoneDeployed(contentInfo.Content_ID);
                foreach (DataRow row in dtZoneDeployed.Rows)
                {
                    zoneDeployed += row["Distribution_ZoneID"] + "|";
                }

                foreach (ListItem item in lstZones.Items)
                {
                    if (zoneDeployed.IndexOf("|" + item.Value + "|") >= 0)
                    {
                        item.Selected = true;
                    }
                    else
                    {
                        item.Selected = false;
                    }
                }
            }
        }
Esempio 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();
        }
 protected void dtgWaitingDeployList_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandName == "return")
     {
         try
         {
             ContentDB.SetStatus(ConvertUtility.ToInt32(e.Item.Cells[0].Text), (int)AppEnv.CMSWorkFlow.Return);
             ContentDB.SetComment(ConvertUtility.ToInt32(e.Item.Cells[0].Text), Convert.ToChar(34) + txtComment.Text + Convert.ToChar(34) + "\r\n Trả lại bởi : " + CurrentAdminInfo.User_FullName);
             lblStatusUpdate.Text = AppEnv.MSG_Return + dropZones.SelectedItem.Text;
             txtComment.Text      = string.Empty;
         }
         catch
         {
             lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
         }
     }
     if (e.CommandName == "deploy")
     {
         try
         {
             ContentDB.SetStatus(ConvertUtility.ToInt32(e.Item.Cells[0].Text), (int)AppEnv.CMSWorkFlow.Deploy);
             lblStatusUpdate.Text = AppEnv.MSG_Deploy + dropZones.SelectedItem.Text;
             DistributionInfo info = new DistributionInfo();
             info.Distribution_ContentID = ConvertUtility.ToInt32(e.Item.Cells[0].Text);
             info.Distribution_ZoneID    = ConvertUtility.ToInt32(dropZones.SelectedValue);
             info.Distribution_Rank      = (int)AppEnv.CMSContentRank.Default;
             DistributionDB.Insert(info);
         }
         catch
         {
             lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
         }
     }
 }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zoneCurrent    = ZoneUtility.GetZoneCurrent();
            _excludeSpecial = ConvertUtility.ToInt32(SessionUtility.GetValue("excludeid"));

            var source = DistributionDB.GetNewContentByZoneIDNoPage(_zoneCurrent, true, _excludeSpecial);

            if (source.Rows.Count > 0)
            {
                CollectionPager1.DataSource    = source.DefaultView;
                CollectionPager1.BindToControl = rptData;

                if (AppEnv.GetLanguageFrontEnd() == "vi-VN")
                {
                    CollectionPager1.LabelText = "Trang:&nbsp;";
                }
                else
                {
                    CollectionPager1.LabelText = "Page:&nbsp;";
                }

                CollectionPager1.BackText              = "<<";
                CollectionPager1.PageNumbersSeparator  = "&nbsp;&nbsp;&nbsp;";
                CollectionPager1.BackNextLinkSeparator = "&nbsp;&nbsp;&nbsp;";

                rptData.DataSource = CollectionPager1.DataSourcePaged;
                rptData.DataBind();
            }
            else
            {
                rptData.Visible = false;
            }
        }
Esempio n. 6
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (!IsPostBack)
            {
                var isTemp = contentInfo.Content_IsTemp;

                if (!isTemp)
                {
                    trRank.Visible            = false;
                    spanDisableHeader.Visible = false;
                    chkVisible.Checked        = contentInfo.Content_Visible;
                }
                else
                {
                    chkVisible.Checked = true;
                }

                txtName.Text       = contentInfo.Content_Name;
                txtTeaser.Text     = contentInfo.Content_Teaser;
                Editor1.HtmlValue  = contentInfo.Content_Body;
                txtCreateDate.Text = contentInfo.Content_CreateDate.ToString();
                MiscUtility.SetSelected(dropZones.Items, contentInfo.Content_OriginalZoneID.ToString());
                txtAuthor.Text               = contentInfo.Content_Author;
                txtEventDate.Text            = contentInfo.Content_EventDate.ToShortDateString();
                Calendar1.SelectedDate       = ConvertUtility.ToDateTime(contentInfo.Content_EventDate.ToShortDateString());
                txtFriendlyUrl.Text          = contentInfo.Content_FriendlyUrl;
                chkExcludeFromSearch.Checked = contentInfo.Content_ExcludeFromSearch;
                chkIsPhoto.Checked           = contentInfo.Content_IsPhoto;
                chkIsDownload.Checked        = contentInfo.Content_IsDownload;
                chkIsVideo.Checked           = contentInfo.Content_IsVideo;
                chkIsPoll.Checked            = contentInfo.Content_IsPoll;
                chkIsProduct.Checked         = contentInfo.Content_IsProduct;

                string    zoneDeployed   = "|";
                DataTable dtZoneDeployed = DistributionDB.GetZoneDeployed(contentInfo.Content_ID);
                foreach (DataRow row in dtZoneDeployed.Rows)
                {
                    zoneDeployed += row["Distribution_ZoneID"] + "|";
                }

                foreach (ListItem item in lstZones.Items)
                {
                    if (zoneDeployed.IndexOf("|" + item.Value + "|") >= 0)
                    {
                        item.Selected = true;
                    }
                    else
                    {
                        item.Selected = false;
                    }
                }
            }
        }
Esempio n. 7
0
        private void ShowInfo()
        {
            var dtContent = DistributionDB.GetContentByZoneIDselfAndNumberRecord(_zonecurrent, 1);

            if (dtContent.Rows.Count != 0)
            {
                var rowIntro = dtContent.Rows[0];

                litContent.Text = rowIntro["Content_Body"].ToString();
            }
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zonecurrent = ZoneUtility.GetZoneCurrent();
            var dtData = DistributionDB.GetContentByZoneAndRankInZone(_zonecurrent, true, 0, (int)AppEnv.CMSContentRank.Special, 1);

            if (dtData.Rows.Count > 0)
            {
                rptData.DataSource = dtData;
                rptData.DataBind();
            }
            else
            {
                Visible = false;
            }
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zoneCurrent = ZoneUtility.GetZoneCurrent();

            _itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]);

            _distInfo = DistributionDB.GetInfo(_itemid);
            if (_distInfo == null)
            {
                Visible = false;
                return;
            }

            DistributionDB.UpdateView(_distInfo.Distribution_ID, 1);

            _contentId = _distInfo.Distribution_ContentID;

            var contentInfo = ContentDB.GetInfo(_contentId);

            lnkName.Text        = contentInfo.Content_Name;
            lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(_itemid);



            lnkZone.Text        = ZoneDB.GetZoneNameByID(_zoneCurrent);
            lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zoneCurrent);

            var strSQL = "SELECT CMS_ContentVideo.*, CMS_Videos.* FROM CMS_ContentVideo ";

            strSQL += " INNER JOIN CMS_Videos ON CMS_ContentVideo.Video_ID = CMS_Videos.Video_ID ";
            strSQL += " WHERE 1=1 ";

            strSQL += " AND CMS_ContentVideo.Content_ID=" + _contentId + " ";
            strSQL += " AND CMS_Videos.Video_Visible=1 ";
            strSQL += " ORDER BY CMS_ContentVideo.Priority ASC ";

            var source = DataHelper.GetDataFromTable(strSQL);

            if (source.Rows.Count > 0)
            {
                rptData.DataSource = source;
                rptData.DataBind();
            }
            else
            {
                rptData.Visible = false;
            }
        }
Esempio n. 10
0
        protected void dtgDeployList_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            try
            {
                switch (e.CommandName)
                {
                case "updaterank":
                    if (isManager || isDeployer)
                    {
                        foreach (DataGridItem item in dtgDeployList.Items)
                        {
                            DropDownList dropContentRank = (DropDownList)item.FindControl("dropContentRank");
                            DistributionDB.SetRank(ConvertUtility.ToInt32(item.Cells[0].Text), ConvertUtility.ToInt32(dropContentRank.SelectedValue));
                        }
                    }
                    break;

                case "updatepriority":
                    if (isManager || isDeployer)
                    {
                        foreach (DataGridItem item in dtgDeployList.Items)
                        {
                            DropDownList dropIndex = (DropDownList)item.FindControl("dropIndex");
                            DistributionDB.SetPriority(ConvertUtility.ToInt32(item.Cells[0].Text), ConvertUtility.ToInt32(dropIndex.SelectedValue));
                        }
                    }
                    break;

                case "remover":
                    DistributionDB.Delete(ConvertUtility.ToInt32(e.Item.Cells[0].Text));
                    break;

                case "delete":
                    // xoa anh?
                    ContentDB.Delete(ConvertUtility.ToInt32(e.Item.Cells[1].Text));
                    break;

                case "edit":
                    Response.Redirect(AppEnv.ADMIN_CMD + "cmseditcontent&contentid=" + ConvertUtility.ToInt32(e.Item.Cells[1].Text));
                    break;
                }
                lblStatusUpdate.Text = MiscUtility.UPDATE_SUCCESS;
            }
            catch
            {
                lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
            }
        }
Esempio n. 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zoneCurrent = ZoneUtility.GetZoneCurrent();

            var source = DistributionDB.GetNewContentByZoneIDNoPage(_zoneCurrent, true, _excludeSpecial);

            if (source.Rows.Count > 0)
            {
                rptData.DataSource = source;
                rptData.DataBind();
            }
            else
            {
                rptData.Visible = false;
            }
        }
Esempio n. 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zoneCurrent = ZoneUtility.GetZoneCurrent();

            //lnkZone.Text = ZoneDB.GetZoneNameByID(zoneCurrent);
            //lnkZone.NavigateUrl = ZoneUtility.BuildUrlByZoneCurrent(zoneCurrent);

            DataTable dtSpecial = DistributionDB.GetContentByZoneIDAndRank(_zoneCurrent, 1, (int)AppEnv.CMSContentRank.Special);

            if (dtSpecial.Rows.Count > 0)
            {
                int contentID = Convert.ToInt32(dtSpecial.Rows[0]["Content_ID"]);
                //litName.Text = dtSpecial.Rows[0]["Content_Name"].ToString();
                litContent.Text = ContentDB.GetInfo(contentID).Content_Body;
            }
        }
Esempio n. 13
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            if (isManager || isDeployer)
            {
                //try
                //{

                lblStatusUpdate.Text = AppEnv.MSG_Deploy + "<br /> ";
                //lstZones.Items.FindByValue(dropZones.SelectedValue).Selected = true;
                foreach (ListItem item in lstZones.Items)
                {
                    if (item.Selected)
                    {
                        if (!DistributionDB.CheckContentExist(contentInfo.Content_ID, Convert.ToInt32(item.Value)))
                        {
                            //DistributionDB.RemoverInZoneID(contentInfo.Content_ID, Convert.ToInt32(item.Value));
                            int zoneID  = ConvertUtility.ToInt32(item.Value);
                            var newDist = new DistributionInfo();
                            newDist.Distribution_ContentID     = contentInfo.Content_ID;
                            newDist.Distribution_ZoneID        = zoneID;
                            newDist.Distribution_CreateDate    = DateTime.Now;
                            newDist.Distribution_Rank          = ConvertUtility.ToInt32(AppEnv.CMSContentRank.Default);
                            newDist.Distribution_Layout        = "zone";
                            newDist.Distribution_DisableTeaser = false;
                            newDist.Distribution_DisableAvatar = false;
                            DistributionDB.Insert(newDist);
                        }
                        lblStatusUpdate.Text += item.Text + ",<br>";
                    }
                    else
                    {
                        DistributionDB.RemoverInZoneID(contentInfo.Content_ID, Convert.ToInt32(item.Value));
                    }
                }



                lblStatusUpdate.Text  = lblStatusUpdate.Text.Substring(0, lblStatusUpdate.Text.Length - 5) + "</font>";
                lblStatusUpdate2.Text = MiscUtility.UPDATE_SUCCESS;
                //cmdHuy_Click(null, null);
                //}
                //catch
                //{
                //    lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
                //}
            }
        }
Esempio n. 14
0
        public static int GetZoneCurrent()
        {
            var zonecurrent = 0;

            var itemId = ConvertUtility.ToInt32(HttpContext.Current.Request.QueryString["itemid"]);

            if (itemId > 0)
            {
                zonecurrent = DistributionDB.GetZoneID(itemId);
            }
            else
            {
                zonecurrent = ConvertUtility.ToInt32(HttpContext.Current.Request.QueryString["zoneid"]);
            }

            return(zonecurrent);
        }
Esempio n. 15
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();
        }
Esempio n. 16
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            int zoneID = ConvertUtility.ToInt32(dropZones.SelectedValue);

            AppEnv.ZoneSelected = zoneID;
            if (!isManager && !isDeployer)
            {
                dtgDeployList.DataSource = DistributionDB.GetDeployByZoneID(zoneID, CurrentAdminInfo.User_ID);
            }
            else
            {
                int totalRecord;
                dtgDeployList.DataSource       = DistributionDB.GetDeployByZoneID(zoneID, dtgDeployList.PageSize, dtgDeployList.CurrentPageIndex, out totalRecord);
                dtgDeployList.VirtualItemCount = totalRecord;
            }
            dtgDeployList.DataBind();
        }
Esempio n. 17
0
        protected void dtgReturnList_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            try
            {
                int contentID = ConvertUtility.ToInt32(e.Item.Cells[0].Text);
                switch (e.CommandName)
                {
                case "deploy":
                {
                    if (isManager || isDeployer)
                    {
                        ContentDB.SetStatus(contentID, (int)AppEnv.CMSWorkFlow.Deploy);
                        DistributionInfo newDist = new DistributionInfo();
                        newDist.Distribution_ContentID = contentID;
                        newDist.Distribution_ZoneID    = ConvertUtility.ToInt32(dropZones.SelectedValue);
                        newDist.Distribution_Rank      = (int)AppEnv.CMSContentRank.Default;
                        DistributionDB.Insert(newDist);
                        lblStatusUpdate.Text = AppEnv.MSG_Deploy + dropZones.SelectedItem.Text;
                    }
                    else
                    if (isCreater)
                    {
                        ContentDB.SetStatus(contentID, (int)AppEnv.CMSWorkFlow.Waiting);
                        lblStatusUpdate.Text = AppEnv.MSG_Waiting + dropZones.SelectedItem.Text;
                    }
                    break;
                }

                case "delete":
                    ContentDB.Delete(contentID);
                    lblStatusUpdate.Text = MiscUtility.UPDATE_SUCCESS;
                    break;

                case "edit":
                    Response.Redirect(AppEnv.ADMIN_CMD + "cmseditcontent&contentid=" + contentID);
                    break;
                }
            }
            catch
            {
                lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
            }
        }
Esempio n. 18
0
        protected void dtgDeployList_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            DataRowView rowData = (DataRowView)e.Item.DataItem;

            DropDownList dropContentRank = (DropDownList)e.Item.FindControl("dropContentRank");

            dropContentRank.Items.FindByValue(rowData["Distribution_Rank"].ToString()).Selected = true;

            DropDownList dropIndex = (DropDownList)e.Item.FindControl("dropIndex");

            MiscUtility.FillIndex(dropIndex, MAX_PRIORITY, ConvertUtility.ToInt32(rowData["Distribution_Priority"]));

            HyperLink lnkHeadline = (HyperLink)e.Item.FindControl("lnkHeadline");

            lnkHeadline.Text        = DistributionDB.GetNameByDistID(ConvertUtility.ToInt32(e.Item.Cells[0].Text));
            lnkHeadline.NavigateUrl = AppEnv.ADMIN_CMD + "cmsviewcontent&contentID=" + e.Item.Cells[1].Text;

            lnkHeadline.ToolTip = ContentDB.GetAuthorInfoByContentID(Convert.ToInt32(e.Item.Cells[1].Text));

            Button cmdRemove = (Button)e.Item.FindControl("cmdRemove");
            Button cmdDel    = (Button)e.Item.FindControl("cmdDel");
            Button cmdEdit   = (Button)e.Item.FindControl("cmdEdit");

            if (!isManager && !isDeployer)
            {
                cmdDel.Enabled          = false;
                cmdEdit.Enabled         = false;
                cmdRemove.Enabled       = false;
                dropContentRank.Enabled = false;
                dropIndex.Enabled       = false;
            }
            else
            {
                cmdRemove.Attributes.Add("onclick", MiscUtility.DELETE_CONFIRM);
                cmdDel.Attributes.Add("onclick", MiscUtility.DELETE_CONFIRM);
            }
        }
Esempio n. 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]);

            var disInfo = DistributionDB.GetInfo(_itemid);

            if (disInfo != null)
            {
                if (disInfo.Distribution_Layout == "zone")
                {
                    PlaceHolder1.Controls.Add(Page.LoadControl("Layout/" + ZoneDB.GetZoneLayout(disInfo.Distribution_ZoneID) + "_Item.ascx"));
                }
                else
                {
                    PlaceHolder1.Controls.Add(Page.LoadControl("Layout/" + disInfo.Distribution_Layout + "_Item.ascx"));
                }
            }
            else
            {
                Response.Redirect("/");
            }
        }
Esempio n. 20
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();
        }
Esempio n. 21
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();
            }
        }
Esempio n. 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zoneCurrent = ZoneUtility.GetZoneCurrent();

            _itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]);

            _distInfo = DistributionDB.GetInfo(_itemid);
            if (_distInfo == null)
            {
                Visible = false;
                return;
            }

            DistributionDB.UpdateView(_distInfo.Distribution_ID, 1);

            _contentId = _distInfo.Distribution_ContentID;

            var contentInfo = ContentDB.GetInfo(_contentId);

            lnkName.Text        = contentInfo.Content_Name;
            lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(_itemid);



            lnkZone.Text        = ZoneDB.GetZoneNameByID(_zoneCurrent);
            lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zoneCurrent);

            var strSQL = "SELECT CMS_ContentImage.*, CMS_Images.* FROM CMS_ContentImage ";

            strSQL += " INNER JOIN CMS_Images ON CMS_ContentImage.Image_ID = CMS_Images.Image_ID ";
            strSQL += " WHERE 1=1 ";

            strSQL += " AND CMS_ContentImage.Content_ID=" + _contentId + " ";
            strSQL += " AND CMS_Images.Image_Visible=1 ";
            strSQL += " ORDER BY CMS_ContentImage.Priority ASC ";

            var source = DataHelper.GetDataFromTable(strSQL);

            if (source.Rows.Count > 0)
            {
                CollectionPager1.DataSource    = source.DefaultView;
                CollectionPager1.BindToControl = rptData;

                if (AppEnv.GetLanguageFrontEnd() == "vi-VN")
                {
                    CollectionPager1.LabelText = "Trang:&nbsp;";
                }
                else
                {
                    CollectionPager1.LabelText = "Page:&nbsp;";
                }

                CollectionPager1.BackText              = "<<";
                CollectionPager1.PageNumbersSeparator  = "&nbsp;&nbsp;&nbsp;";
                CollectionPager1.BackNextLinkSeparator = "&nbsp;&nbsp;&nbsp;";

                rptData.DataSource = CollectionPager1.DataSourcePaged;
                rptData.DataBind();
            }
            else
            {
                rptData.Visible = false;
            }
        }
Esempio n. 23
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            contentInfo.Content_Name              = txtName.Text;
            contentInfo.Content_Teaser            = txtTeaser.Text;
            contentInfo.Content_Body              = Editor1.HtmlValue;
            contentInfo.Content_CreateDate        = ConvertUtility.ToDateTime(txtCreateDate.Text);
            contentInfo.Content_ModifiedDate      = DateTime.Now;
            contentInfo.Content_OriginalZoneID    = ConvertUtility.ToInt32(dropZones.SelectedValue);
            contentInfo.Content_ModifiedUserID    = CurrentAdminInfo.User_ID;
            contentInfo.Content_Author            = txtAuthor.Text;
            contentInfo.Content_EventDate         = ConvertUtility.ToDateTime(txtEventDate.Text);
            contentInfo.Content_FriendlyUrl       = UnicodeUtility.UnicodeToFriendlyUrl(txtName.Text);
            contentInfo.Content_ExcludeFromSearch = chkExcludeFromSearch.Checked;
            contentInfo.Content_IsPhoto           = chkIsPhoto.Checked;
            contentInfo.Content_IsDownload        = chkIsDownload.Checked;
            contentInfo.Content_IsVideo           = chkIsVideo.Checked;
            contentInfo.Content_IsPoll            = chkIsPoll.Checked;
            contentInfo.Content_IsProduct         = chkIsProduct.Checked;
            contentInfo.Content_Visible           = chkVisible.Checked;
            contentInfo.Content_IsTemp            = false;

            if (isManager || isDeployer)
            {
                //try
                //{
                contentInfo.Content_Status = (int)AppEnv.CMSWorkFlow.Deploy;
                ContentDB.Update(contentInfo);

                lblStatusUpdate.Text = AppEnv.MSG_Deploy + "<br /> ";
                lstZones.Items.FindByValue(dropZones.SelectedValue).Selected = true;
                foreach (ListItem item in lstZones.Items)
                {
                    if (item.Selected)
                    {
                        if (!DistributionDB.CheckContentExist(contentInfo.Content_ID, Convert.ToInt32(item.Value)))
                        {
                            //DistributionDB.RemoverInZoneID(contentInfo.Content_ID, Convert.ToInt32(item.Value));
                            int zoneID  = ConvertUtility.ToInt32(item.Value);
                            var newDist = new DistributionInfo();
                            newDist.Distribution_ContentID     = contentInfo.Content_ID;
                            newDist.Distribution_ZoneID        = zoneID;
                            newDist.Distribution_CreateDate    = DateTime.Now;
                            newDist.Distribution_Rank          = ConvertUtility.ToInt32(rdoContentRanks.SelectedValue);
                            newDist.Distribution_Layout        = dropLayout.SelectedValue;
                            newDist.Distribution_DisableTeaser = chkDisableTeaser.Checked;
                            newDist.Distribution_DisableAvatar = chkDisableAvatar.Checked;
                            DistributionDB.Insert(newDist);
                        }
                        lblStatusUpdate.Text += item.Text + ",<br>";
                    }
                    else
                    {
                        DistributionDB.RemoverInZoneID(contentInfo.Content_ID, Convert.ToInt32(item.Value));
                    }
                }



                lblStatusUpdate.Text  = lblStatusUpdate.Text.Substring(0, lblStatusUpdate.Text.Length - 5) + "</font>";
                lblStatusUpdate2.Text = MiscUtility.UPDATE_SUCCESS;
                //cmdHuy_Click(null, null);
                //}
                //catch
                //{
                //    lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
                //}
            }
            else
            {
                //try
                //{
                ContentDB.Update(contentInfo);

                lblStatusUpdate.Text = lblStatusUpdate2.Text = MiscUtility.UPDATE_SUCCESS;
                //}
                //catch
                //{
                //    lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
                //}
            }
        }
Esempio n. 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            litDescription.Text = "<meta name=\"description\" content=\"" + AppEnv.MetaDescription + "\">";
            litKeyword.Text     =
                "<meta name=\"keywords\" content=\"" + AppEnv.MetaSearch + "\">";

            AppEnv.GetLanguageFrontEnd();

            string jumpto = ConvertUtility.ToString(Request.QueryString["tab"]);

            switch (jumpto)
            {
            case "zone":
                PlaceHolder1.Controls.Add(Page.LoadControl("Layout/Zone.ascx"));
                break;

            case "content":
                PlaceHolder1.Controls.Add(Page.LoadControl("Layout/Content.ascx"));
                break;

            case "register":
                PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/Register_Member.ascx"));
                break;

            case "active":
                PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/Active_Member.ascx"));
                break;

            case "cart":
                PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/Cart.ascx"));
                break;

            default:
                PlaceHolder1.Controls.Add(Page.LoadControl("Layout/Home.ascx"));
                Pageclass               = "banner_wrap";
                Column_Right1.Visible   = false;
                TuyenSinh_Home1.Visible = true;
                Home_AloneArea1.Visible = true;
                break;
            }

            int itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]);

            if (itemid != 0)
            {
                switch (jumpto)
                {
                case "tab":
                    litWebTitle.Text = defaultTitle + " - " + DistributionDB.GetNameByDistID(itemid);
                    break;

                default:
                    litWebTitle.Text = defaultTitle;
                    break;
                }
            }
            else
            {
                int zonecurrent = ZoneUtility.GetZoneCurrent();

                if (zonecurrent == 0)
                {
                    litWebTitle.Text = defaultTitle;
                }
                else
                {
                    litWebTitle.Text = defaultTitle + " - " + ZoneDB.GetZoneNameByID(zonecurrent);
                }
            }
        }
Esempio n. 25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _distInfo = DistributionDB.GetInfo(ConvertUtility.ToInt32(Request.QueryString["itemid"]));
            if (_distInfo == null)
            {
                Visible = false;
                return;
            }

            DistributionDB.UpdateView(_distInfo.Distribution_ID, 1);

            var contentInfo = ContentDB.GetInfo(_distInfo.Distribution_ContentID);

            litName.Text = contentInfo.Content_Name;

            if (_distInfo.Distribution_DisableTeaser)
            {
                pnTeaser.Visible = false;
            }
            else
            {
                if (contentInfo.Content_Teaser.Length > 0)
                {
                    litTeaser.Text = contentInfo.Content_Teaser;
                }
                else
                {
                    litTeaser.Visible = false;
                }

                if (_distInfo.Distribution_DisableAvatar)
                {
                    imgAvatar.Visible = false;
                }
                else
                {
                    var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(contentInfo.Content_ID));
                    if (coverInfo != null)
                    {
                        string avatar = coverInfo.Image_File;
                        if (avatar.Length > 0)
                        {
                            imgAvatar.ImageUrl    = UrlFilter.BuildImageUrl(avatar, 150, 0);
                            lnkAvatar.NavigateUrl = MultimediaUtility.GetOriginalImage(avatar);

                            lnkAvatar.Attributes.Add("rel", "prettyPhoto");
                            lnkAvatar.ToolTip = coverInfo.Image_Description;
                        }
                        else
                        {
                            imgAvatar.Visible = false;
                        }
                    }
                    else
                    {
                        imgAvatar.Visible = false;
                    }
                }
            }



            litContent.Text = contentInfo.Content_Body;

            //litDatetime.Text = ConvertUtility.ToDateTime(distInfo.Distribution_CreateDate).ToString("dd/MM/yyyy");



            //DataTable dtNews = DistributionDB.GetNewsForCurrent(distInfo.Distribution_ID, 5);
            //if (dtNews.Rows.Count == 0)
            //{
            //    pnNew.Visible = false;
            //}
            //else
            //{
            //    rptNew.DataSource = dtNews;
            //    rptNew.DataBind();
            //}
        }
Esempio n. 26
0
        protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                var curData = (DataRowView)e.Item.DataItem;
                var lnkName = (HyperLink)e.Item.FindControl("lnkName");

                lnkName.Text        = curData["Content_Name"].ToString();
                lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(ConvertUtility.ToInt32(DistributionDB.GetOriginalDistID(ConvertUtility.ToInt32(curData["Distribution_ContentID"]))));
            }
        }