Esempio n. 1
0
        private void ViewNavigator(int Id)
        {
            CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();
            CateNewsBSO catenewsBSO = new CateNewsBSO();
            CateNews catenews = catenewsBSO.GetCateNewsById(Id);
            //HyperLinkCate.NavigateUrl = "~/Default.aspx?go=cate&Id=" + catenews.CateNewsID;


            title_name.Text = catenews.CateNewsName;

            //    Label1.Text = "<div class='gt_title'> <div class='title_article_top'>" + Literal1.Text + "</div><div class='title_article_bg'></div></div>";

            string cate = "<a href='" + ResolveUrl("~/") + "FullNews/" + catenews.GroupCate + "/" + GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName) + "/default.aspx' class='content_Text_Cat'>";
            string s1 = "";
            while (catenews.ParentNewsID != 0)
            {
                int pId = catenews.ParentNewsID;
                catenews = catenewsBSO.GetCateNewsById(pId);
                s1 = "<a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + "/default.aspx' class='content_Text_Cat'>" + catenews.CateNewsName + "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' >" + s1;
            }


            cate += cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName.ToUpper(); //Sửa lại
            cate += "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' >&nbsp;";
            cate += s1;
            title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.Home + "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' > &nbsp;";
            title_cate.Text += cate;

            Page.Title = "Thủy điện Sơn La : " + GetString(catenews.CateNewsName);

        }
Esempio n. 2
0
        private void ViewNewsGroupDetail(int Id)
        {
            CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();
            NewsGroupBSO newsgroupBSO = new NewsGroupBSO();
            NewsGroup newsgroup = newsgroupBSO.GetNewsGroupById(Id);
            if (newsgroup == null)
                Response.Redirect("~/Default.aspx");

            ltlTitle.Text = newsgroup.Title;
            LabelDate.Text = newsgroup.PostDate.ToString("dd/MM/yyyy");// Convert.ToString(newsgroup.PostDate);
            ltlDescribe.Text = newsgroup.ShortDescribe;
            FullDescirbe.Text = newsgroup.FullDescribe;
            LabelAuthor.Text = newsgroup.Author;
            txtNewsGroupID.Value = Convert.ToString(newsgroup.NewsGroupID);
            //if (newsgroup.ImageThumb != "")
            //    ltlImageThumb.Text = @"<img src='"+ResolveUrl("~/")+"Admin/Upload/NewsGroup/NewsGroupThumb/" + newsgroup.ImageThumb + "' align='left' class='border_image' width='250'  >";
            //Page.Title = newsgroup.Title;
            if (newsgroup.FileName != "")
                ltlFile.Text = @"<a href='" + ResolveUrl("~/") + "Admin/Upload/NewsGroup/Files/" + newsgroup.FileName + "'><img src='" + ResolveUrl("~/") + "images/icon_file.png' width='30' class='icon_bullet'/> Tải File đính kèm</a>";
            newsgroupBSO.NewsGroupClickUpdate(Id);
            NewsGroupFollow(newsgroup.NewsGroupID, newsgroup.CateNewsID);

            CateNewsBSO catenewsBSO = new CateNewsBSO();
            CateNews catenews = catenewsBSO.GetCateNewsById(newsgroup.CateNewsID);
            //HyperLinkCate.NavigateUrl = "~/Default.aspx?go=cate&Id=" + catenews.CateNewsID;
            title_name.Text = "<a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + ".aspx'>" + catenews.CateNewsName + "</a>";

            string cate = "<a href='" + ResolveUrl("~/") + "FullNews/" + catenews.GroupCate + "/" + GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName) + ".aspx' class='content_Text_Cat'>";
            string s1 = "";
            while (catenews.ParentNewsID != 0)
            {
                int pId = catenews.ParentNewsID;
                catenews = catenewsBSO.GetCateNewsById(pId);
                s1 = "<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'><a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + ".aspx'' class='content_Text_Cat'>" + catenews.CateNewsName + "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>&nbsp;" + s1;
            }
            cate += cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName.ToUpper(); //Sửa lại
            cate += "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>";
            cate += s1;
            title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + String.Format(Resources.resource.Home) + "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>&nbsp; ";
            title_cate.Text += cate;

            if (!String.IsNullOrEmpty(Request["error"]))
                error.Text = "<div class='error_register_text'>" + String.Format(Resources.resource.ThanksComment) + "</div>";

            if (!newsgroup.IsComment)
            {
                CommentPanel.Visible = false;
            }
            else
            {
                CommentPanel.Visible = true;
                GetNewsCommentById(Id);
            }

            Page.Title = GetString(newsgroup.Title);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int groupcate = Convert.ToInt32(hddValue.Value);

            GetOfficial(groupcate);
            CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();

            ltlTitle.Text = "<a href='" + ResolveUrl("~/") + "FullNews/" + groupcate + "/" + GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(groupcate).CateNewsGroupName) + "/default.aspx' >" + cateNewsgroupBSO.GetCateNewsGroupByGroupCate(groupcate).CateNewsGroupName + "</a>";

        }
        private void ViewNavigator(int Id)
        {
            CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();
            OfficialBSO officialBSO = new OfficialBSO();
            ETO.Official official = officialBSO.GetOfficialById(Id);

            CateNewsBSO catenewsBSO = new CateNewsBSO();
            CateNews catenews = catenewsBSO.GetCateNewsById(official.CateOfficialID);
            //HyperLinkCate.NavigateUrl = "~/Default.aspx?go=cate&Id=" + catenews.CateNewsID;
            title_name.Text = "<a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + "/default.aspx'>" + catenews.CateNewsName + "</a>";

            string cate = "<a href='" + ResolveUrl("~/") + "FullNews/" + catenews.GroupCate + "/" + GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName) + "/default.aspx' class='content_Text_Cat'>";
            string s1 = "";
            while (catenews.ParentNewsID != 0)
            {
                int pId = catenews.ParentNewsID;
                catenews = catenewsBSO.GetCateNewsById(pId);
                s1 = "<a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + "/default.aspx' class='content_Text_Cat'>" + catenews.CateNewsName + "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' > &nbsp;" + s1;
            }

            cate += cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName.ToUpper(); //Sửa lại
            cate += "</a>&nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' >";
            cate += s1;
            title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.Home + "</a>&nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>&nbsp;";
            title_cate.Text += cate;
        }
Esempio n. 5
0
        public void BuildFooterMenu()
        {
            if (!this.IsPostBack)
            {
                CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
                CateNewsBSO cateNewsBSO = new CateNewsBSO();
                DataTable table = catenewsGroupBSO.GetCateNewsGroupMenuAll();
                if (table != null)
                {
                    DataView view = new DataView(table)
                    {
                        RowFilter = "language = '" + Language.lang + "'",
                        Sort = "[Order] ASC"
                    };
                    table = view.ToTable();
                }
                foreach (DataRow row in table.Rows)
                {
                    string footerMenuItemText = "";
                    //menuItemText = row["CateNewsGroupName"].ToString();

                    string g = row["GroupCate"].ToString();
                    CateNewsGroup cateGroup = catenewsGroupBSO.GetCateNewsGroupByGroupCate(Convert.ToInt32(g));
                    if (cateGroup.IsUrl == true)
                        footerMenuItemText = "<a class=bannermenuitem href=" + cateGroup.Url;
                    else
                        if (cateGroup.IsPage == true)
                            footerMenuItemText = "<a class=bannermenuitem href=" + Page.ResolveUrl("FullPages/" + g + "/" + GetString(cateGroup.CateNewsGroupName) + "/default.aspx>");
                        else
                            footerMenuItemText = "<a class=bannermenuitem href=" + Page.ResolveUrl("FullNews/" + g + "/" + GetString(cateGroup.CateNewsGroupName) + "/default.aspx>");
                    footerMenuItemText += row["CateNewsGroupName"].ToString() + "</a>";
                    footerMenuItem.Text += footerMenuItemText;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int Id = 0;
            if (!String.IsNullOrEmpty(Request["id"]))
                int.TryParse(Request["id"], out Id);
            int groupcate = Convert.ToInt32(hddValue.Value);

            GetNewsActive(groupcate);
            //GetNewsGroupByCate(Id);

            //GetCateParentNewsGroup(gId);
            CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();
            string text = "<a href='" + ResolveUrl("~/") + "FullNews/" + groupcate + "/"
                + GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(groupcate).CateNewsGroupName) + "/default.aspx' >"
                + cateNewsgroupBSO.GetCateNewsGroupByGroupCate(groupcate).CateNewsGroupName + "</a>";
            ltlTitle.Text = text;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int groupcate = Convert.ToInt32(hddValue.Value);
            FullHotNewsGetGroup(Language.language, groupcate);

            CateNewsGroupBSO cateGroupBSO = new CateNewsGroupBSO();
            CateNewsGroup cateGroup = cateGroupBSO.GetCateNewsGroupByGroupCate(groupcate);
            ltlTitle.Text = "<a href='" + ResolveUrl("~/") + "FullNewsg/" + groupcate + "/" + GetString(cateGroup.CateNewsGroupName) + "/default.aspx' class='block_text_title'>" + cateGroup.CateNewsGroupName + "</a>";
        }
Esempio n. 8
0
        public void BuildMenu()
        {
            string menu = "";
            CateNewsGroupBSO cateNewsGroupBSO = new CateNewsGroupBSO();
            CateNewsBSO cateNewsBSO = new CateNewsBSO();
            DataTable dt = cateNewsGroupBSO.GetCateNewsGroupMenuAll();
            if (dt != null)
            {
                DataView view = new DataView(dt)
                {
                    RowFilter = "language = '" + Language.lang + "' and IsView='True'",
                    Sort = "[Order] ASC"
                };
                dt = view.ToTable();
            }
            if (dt.Rows.Count > 8)
                dt = dt.AsEnumerable().Take(8).CopyToDataTable();
            menu += "<ul class=\"nav navbar-nav\">";
            foreach (DataRow row in dt.Rows)
            {
                menu += "<li>";
                string g = row["GroupCate"].ToString();

                CateNewsGroup cateGroup = cateNewsGroupBSO.GetCateNewsGroupByGroupCate(Convert.ToInt32(g));
                DataTable dtSub = cateNewsGroupBSO.CateNewsGetByGroup(Convert.ToInt32(g));

                if (cateGroup.IsUrl == true)
                    menu += "<a href=\"" + row["Url"] + "\">";
                else
                    if (cateGroup.IsPage == true)
                        menu += "<a href=\"" + Page.ResolveUrl("FullPagesg/" + g + "/" + GetString(cateGroup.CateNewsGroupName) + "/default.aspx\">");
                    else
                        menu += "<a href=\"" + Page.ResolveUrl("FullNewsg/" + g + "/" + GetString(cateGroup.CateNewsGroupName) + "/default.aspx\">");

                if (dtSub != null && dtSub.Rows.Count > 0)
                    menu += row["CateNewsGroupName"].ToString() + "&nbsp;<span class=\"caret\"></span></a>";
                else
                    menu += row["CateNewsGroupName"].ToString() + "</a>";

                if (dtSub != null && dtSub.Rows.Count > 0)
                {
                    menu += "<ul class=\"dropdown-menu\" role=\"menu\">";
                    foreach (DataRow dr in dtSub.Rows)
                    {
                        if (Convert.ToBoolean(dr["IsUrl"].ToString()))
                            menu += "<li><a href=" + dr["Url"] + ">";
                        else
                            menu += "<li><a href=" + Page.ResolveUrl("CateNewsg/" + dr["GroupCate"] + "/" + dr["CateNewsID"] + "/" + GetString(dr["CateNewsName"]) + "/default.aspx>");
                        menu += dr["CateNewsName"].ToString() + "</a></li>";
                    }
                    menu += "</ul>";
                }
                menu += "</li>";
            }
            menu += "</ul>";
            ltrMenuFull.Text = menu;
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
                CateNewsBSO cateNewsBSO = new CateNewsBSO();
                DataTable table = catenewsGroupBSO.GetCateNewsGroupMenuAll();
                if (table != null)
                {
                    DataView view = new DataView(table)
                    {
                        RowFilter = "language = '" + Language.lang + "'",
                        Sort = "[Order] ASC"
                    };
                    table = view.ToTable();
                }
                string menuItemText = "<ul id=topnav>";
                foreach (DataRow row in table.Rows)
                {
                    //menuItemText = row["CateNewsGroupName"].ToString();
                    menuItemText += "<li>";
                    string g = row["GroupCate"].ToString();
                    CateNewsGroup cateGroup = catenewsGroupBSO.GetCateNewsGroupByGroupCate(Convert.ToInt32(g));
                    if (cateGroup.IsUrl == true)
                        menuItemText += "<a class=bannermenuitem href=" + cateGroup.Url;
                    else
                        if (cateGroup.IsPage == true)
                            menuItemText += "<a class=bannermenuitem href=" + Page.ResolveUrl("FullPages/" + g + "/" + GetString(cateGroup.CateNewsGroupName) + "/default.aspx>");
                        else
                            menuItemText += "<a class=bannermenuitem href=" + Page.ResolveUrl("FullNews/" + g + "/" + GetString(cateGroup.CateNewsGroupName) + "/default.aspx>");
                    menuItemText += row["CateNewsGroupName"].ToString() + "</a>";

                    DataTable dtSub = catenewsGroupBSO.CateNewsGetByGroup(Convert.ToInt32(g));
                    if (dtSub != null && dtSub.Rows.Count > 0)
                    {
                        menuItemText += "<ul>";
                        foreach (DataRow dr in dtSub.Rows)
                        {
                            if (Convert.ToBoolean(dr["IsUrl"].ToString()))
                                menuItemText += "<li><a class=bannermenuitem href='" + dr["Url"] + "'>";
                            else
                                menuItemText += "<li><a class=bannermenuitem href=" + Page.ResolveUrl("Category/" + dr["GroupCate"] + "/" + dr["CateNewsID"] + "/" + GetString(dr["CateNewsName"]) + "/default.aspx>");
                            menuItemText += dr["CateNewsName"].ToString() + "</a></li>";
                        }
                        menuItemText += "</ul>";
                    }
                    menuItemText += "</li>";
                }
                menuItemText += "</ull>";
                menuItem.Text = menuItemText;
            }
        }
Esempio n. 10
0
 public string ReturnUrl(string cateNewsGroup)
 {
     var cateNewsGroupBso = new CateNewsGroupBSO();
     var cateGroup = cateNewsGroupBso.GetCateNewsGroupByGroupCate(Convert.ToInt32(cateNewsGroup));
     var url = "";
     if (cateGroup.IsUrl)
         url = cateGroup.Url;
     else
     {
         url = cateGroup.IsPage ? Page.ResolveUrl("FullPagesg/" + cateNewsGroup + "/" + GetString(cateGroup.CateNewsGroupName) + "/default.aspx") : Page.ResolveUrl("FullNewsg/" + cateNewsGroup + "/" + GetString(cateGroup.CateNewsGroupName) + "/default.aspx");
     }
     return url;
 }
        //Tab
        private Tab CreateRootTab(string index, string g)
        {
            Tab tab = new Tab();
            tab.Text = index;
            CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
            CateNewsGroup cateGroup = catenewsGroupBSO.GetCateNewsGroupByGroupCate(Convert.ToInt32(g));
            if (cateGroup.IsUrl == true)
                tab.NavigateUrl = cateGroup.Url;
            else
                //  tab.NavigateUrl = "~/Default.aspx?go=fullnewsg&g=" + g;
                if (cateGroup.IsPage == true)
                    tab.NavigateUrl = "~/FullPages/" + g + "/" + GetString(cateGroup.CateNewsGroupName) + "/default.aspx";
                else
                    tab.NavigateUrl = "~/FullNews/" + g + "/" + GetString(cateGroup.CateNewsGroupName) + "/default.aspx";

            RadTabStrip1.Tabs.Add(tab);
            return tab;
        }
Esempio n. 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //int gId = Convert.ToInt32(Page.RouteData.Values["Id"].ToString());
            int gId = 0;
            if (!String.IsNullOrEmpty(Page.RouteData.Values["g"].ToString()))
                int.TryParse(Page.RouteData.Values["g"].ToString(), out gId);

            hddGroupCate.Value = Convert.ToString(gId);
            if (!IsPostBack)
            {
                GetCateParentNewsGroup(0, gId);
            }
            CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();
            title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>"+Resources.Resource.Home+"</a> &nbsp;>&nbsp;" + cateNewsgroupBSO.GetCateNewsGroupByGroupCate(gId).CateNewsGroupName;

            //title_name.Text = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(gId).CateNewsGroupName;

            //Page.Title = "" + GetString(title_name.Text);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int gId = 0;
            if (Page.RouteData.Values["g"]!=null)
                int.TryParse(Page.RouteData.Values["g"].ToString(), out gId);

            hddGroupCate.Value = Convert.ToString(gId);


            title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.Home + "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>";
            CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();

            title_name.Text = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(gId).CateNewsGroupName;

            if (!IsPostBack)
            {
                GetCateParentNews(0, gId);
            }
            Page.Title = GetString(title_name.Text);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int Id = 0;
            if (!String.IsNullOrEmpty(Request["Id"]))
                int.TryParse(Request["Id"], out Id);

            int gId = 0;
            if (!String.IsNullOrEmpty(Request["g"]))
                if (!int.TryParse(Request["g"].Replace(",", ""), out gId))
                    Response.Redirect("~/Default.aspx");

            hddGroupCate.Value = Convert.ToString(gId);
            if (!IsPostBack)
                ViewCompanyDetail(Id, gId);

            title_cate.Text = CateNavigator();

            CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();
            CateNewsGroup cateGroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(gId);
            title_name.Text = cateGroup.CateNewsGroupName;
            Page.Title = GetString(cateGroup.CateNewsGroupName);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.RouteData.Values["g"]!=null)
                if (!int.TryParse(Page.RouteData.Values["g"].ToString(), out gId))
                    Response.Redirect("~/Default.aspx");


            if (!Page.IsPostBack)
            {


                BindTabStrip();
                // ViewTextMarquee();


                if (gId != 0)
                {
                    CateNewsGroupBSO categroupBSO = new CateNewsGroupBSO();
                    CateNewsGroup categroup = categroupBSO.GetCateNewsGroupByGroupCate(gId);
                    if (categroup == null)
                        Response.Redirect("~/Default.aspx");

                    if (categroup.IsMenu == true)
                    {
                        RadTabStrip1.SelectedIndex = categroup.Order - 1;
                        RadMultiPage1.SelectedIndex = categroup.Order - 1;
                    }


                }


                MyTab = RadTabStrip1.InnerMostSelectedTab.Text;

            }
        }
Esempio n. 16
0
        private NewsGroup ReceiveHtml()
        {
            ConfigBSO configBSO = new ConfigBSO();
            Config config = configBSO.GetAllConfig(Language.language);
            CateNewsGroupBSO catgroup = new CateNewsGroupBSO();
            int thumb_w = Convert.ToInt32(config.New_thumb_w);
            int thumb_h = Convert.ToInt32(config.New_thumb_h);

            commonBSO commonBSO = new commonBSO();
            string path_thumb = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/NewsGroup/NewsGroupThumb/";
            string image_thumb = commonBSO.UploadImage(file_image_thumb, path_thumb, thumb_w, thumb_h);

            int large_w = Convert.ToInt32(config.New_large_w);
            int large_h = Convert.ToInt32(config.New_large_h);
            string path_large = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/NewsGroup/NewsGroupLarge/";
            string image_large = commonBSO.UploadImage(file_image_thumb, path_large, large_w, large_h);

            string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/NewsGroup/Files/";
            string file_upload = commonBSO.UploadFile(file_attached, path, 1800000000000);

            NewsGroup newsgroup = new NewsGroup();
            newsgroup.NewsGroupID = (hddNewsGroupID.Value != "") ? Convert.ToInt32(hddNewsGroupID.Value) : 0;
            newsgroup.CateNewsID = Convert.ToInt32(ddlCateNews.SelectedValue);
            newsgroup.ParentNewsID = (hddParentNewsID.Value != "") ? Convert.ToInt32(hddParentNewsID.Value) : 0;
            newsgroup.GroupCate = Convert.ToInt32(hddGroup.Value);

            newsgroup.Title = txtTitle.Text;
            newsgroup.ShortDescribe = txtRadShort.Html;
            newsgroup.FullDescribe = txtRadFull.Html;
            newsgroup.ImageThumb = (image_thumb != "") ? image_thumb : hddImageThumb.Value;
            newsgroup.ImageLarge = (image_large != "") ? image_large : hddImageLarge.Value;
            newsgroup.FileName = (file_upload != "") ? file_upload : hddFileName.Value;

            newsgroup.Author = txtAuthor.Text;
            newsgroup.PostDate = txtRadDate.SelectedDate.Value;
            newsgroup.RelationTotal = (hddRelationTotal.Value != "") ? Convert.ToInt32(hddRelationTotal.Value) : 0;
            newsgroup.Status = Convert.ToBoolean(rdbStatus.SelectedItem.Value);
            newsgroup.Language = catgroup.GetCateNewsGroupByGroupCate(Convert.ToInt32(hddGroup.Value)).Language;
            newsgroup.Ishot = Convert.ToBoolean(rdbIshot.SelectedValue);
            newsgroup.Ishome = Convert.ToBoolean(rdbIshome.SelectedValue);

            newsgroup.TypeNews = Convert.ToBoolean(rdbTypeNews.SelectedValue);

            newsgroup.IsComment = Convert.ToBoolean(rdbComment.SelectedValue);

            newsgroup.Isview = (hddIsView.Value != "") ? Convert.ToInt32(hddIsView.Value) : 0;
            newsgroup.CommentTotal = (hddCommentTotal.Value != "") ? Convert.ToInt32(hddCommentTotal.Value) : 0;

            newsgroup.CreatedUserName = (hddCreateUserName.Value != "") ? hddCreateUserName.Value : Session["Admin_UserName"].ToString();



            newsgroup.IsApproval = Convert.ToBoolean(rdbApproval.SelectedValue);
            if (hddApprovalUserName.Value != "")
            {
                newsgroup.ApprovalUserName = hddApprovalUserName.Value;
                newsgroup.ApprovalDate = Convert.ToDateTime(hddApprovalDate.Value);
            }
            else
                if (Convert.ToBoolean(rdbApproval.SelectedValue))
                {
                    newsgroup.ApprovalUserName = Session["Admin_UserName"].ToString();
                    newsgroup.ApprovalDate = DateTime.Now;
                }
                else
                {
                    newsgroup.ApprovalUserName = "";
                    newsgroup.ApprovalDate = DateTime.Now;
                }


            return newsgroup;

        }
Esempio n. 17
0
        private void GetNewsGroupByCate(int cId)
        {
            CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();

            NewsGroupBSO newsGroupBSO = new NewsGroupBSO();
            DataTable table = newsGroupBSO.GetNewsGroupByCate(cId, Language.language, "1");

            DataView view = new DataView(table);
            view.Sort = "PostDate Desc";
            table = view.ToTable();

            DataTable tableClone = table.Clone();
            DataTable tblClone = table.Clone();

            for (int j = 0; j < table.Rows.Count; j++)
            {
                if (j < 10)
                    tableClone.ImportRow(table.Rows[j]);
                else if (j < 20)
                {
                    tblClone.ImportRow(table.Rows[j]);
                    Label1.Text = "<div class='gt_title'> <div class='title_article_top'>Các tin khác</div></div>";
                }
                else
                    break;

            }
            if (table.Rows.Count > 0)
            {
                DataListCateNews.Visible = true;
                DataListCateNews.DataSource = tableClone;
                DataListCateNews.DataBind();
                CateNewsPanel.Visible = true;
                Repeater1.DataSource = tblClone;
                Repeater1.DataBind();
            }
            else
            {
                DataListCateNews.Visible = false;
                CateNewsPanel.Visible = false;
            }


            CateNewsBSO catenewsBSO = new CateNewsBSO();
            CateNews catenews = catenewsBSO.GetCateNewsById(cId);
            //HyperLinkCate.NavigateUrl = "~/Default.aspx?go=cate&Id=" + catenews.CateNewsID;


            title_name.Text = catenews.CateNewsName;

            //    Label1.Text = "<div class='gt_title'> <div class='title_article_top'>" + Literal1.Text + "</div><div class='title_article_bg'></div></div>";

            string cate = "<a href='" + ResolveUrl("~/") + "FullNews/" + catenews.GroupCate + "/" + GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName) + "/default.aspx' class='content_Text_Cat'>";
            string s1 = "";
            while (catenews.ParentNewsID != 0)
            {
                int pId = catenews.ParentNewsID;
                catenews = catenewsBSO.GetCateNewsById(pId);
                s1 = "<a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + "/default.aspx' class='content_Text_Cat'>" + catenews.CateNewsName + "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>&nbsp;" + s1;
            }

            cate += cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName.ToUpper(); //Sửa lại
            cate += "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>";
            cate += s1;
            title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.Home + "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>&nbsp;";
            title_cate.Text += cate;

            Page.Title = GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName);

        }
        private PageView BuildPageViewContents(int gId)
        {
            PageView pageView = new PageView();


            StringBuilder returnString = new StringBuilder();
            string str = "";

            CateNewsBSO catenewsBSO = new CateNewsBSO();

            CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
            CateNewsGroup cateGroup = catenewsGroupBSO.GetCateNewsGroupByGroupCate(gId);
            if (cateGroup.IsPage == true)
                catenewsBSO.MenuJqueryCateGroupUrl(returnString, 0, Language.language, "", gId, ResolveUrl("~/") + "CategoryPages/" + gId + "/", "/default.aspx");
            else
                catenewsBSO.MenuJqueryCateGroupUrl(returnString, 0, Language.language, "", gId, ResolveUrl("~/") + "Category/" + gId + "/", "/default.aspx");

            //str = "<div id='menu'>" + returnString.ToString() + "</div>";

            str = "<div style='position:absolute;left:" + cateGroup.Position + "px;white-space: nowrap;'><div id='menu'>" + returnString.ToString() + "</div></div>";


            pageView.Controls.Add(new LiteralControl(str));


            return pageView;
        }