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
        public void BuildFooterMenu()
        {
            string menu = "";

            CateNewsGroupBSO cateNewsGroupBSO = new CateNewsGroupBSO();
            CateNewsBSO cateNewsBSO = new CateNewsBSO();

            DataTable dt = cateNewsGroupBSO.GetCateLanguage(Language.lang);

            DataTable dtCate = new DataTable();
            if (dt != null && dt.Rows.Count > 0)
            {
                dt = dt.Select("IsView=true and IsNew=true").CopyToDataTable();
                if (dt.Rows.Count > 4)
                    dt = dt.AsEnumerable().Take(4).CopyToDataTable();
                foreach (DataRow dr in dt.Rows)
                {
                    string g = dr["GroupCate"].ToString();
                    menu += "<div class=\"col-md-1 f-colum\"><div class=\"row title\"><a href=\"" + Page.ResolveUrl("fullnewsg/" + g + "/" + GetString(dr["CateNewsGroupName"].ToString()) + "/default.aspx\">") + dr["CateNewsGroupName"].ToString() + "</a></div>";
                    dtCate = cateNewsBSO.GetCateGroup(Language.lang, Convert.ToInt32(dr["GroupCate"].ToString()));
                    if (dtCate != null && dtCate.Rows.Count > 0)
                    {
                        foreach (DataRow drChild in dtCate.Rows)
                        {
                            string h = drChild["CateNewsId"].ToString();
                            menu += "<div class=\"row content\"> <a href=\"" + Page.ResolveUrl("catenewsg/" + g + "/" + h + "/" + GetString(drChild["CateNewsName"].ToString()) + "/default.aspx\">") + drChild["CateNewsName"].ToString() + "</a></div>";
                        }
                    }
                    menu += "</div>";
                }
                ltrMenu.Text = menu;
            }
        }
        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. 4
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;
                }
            }
        }
        public void ViewCateNewsGroup()
        {
            var cateNewsGroupBSO = new CateNewsGroupBSO();
            var table = cateNewsGroupBSO.GetCateNewsGroupHomeAll();

            DataList1.DataSource = table;
            DataList1.DataBind();
        }
 public void ViewCateNewsGroup()
 {
     CateNewsGroupBSO cateNewsGroupBSO = new CateNewsGroupBSO();
     DataTable table = cateNewsGroupBSO.GetCateNewsGroupPageAll();
     
     DataList1.DataSource = table;
     DataList1.DataBind();
 }
Esempio n. 7
0
        private void GetCateNewsGroup(string _ngonNgu)
        {
            CateNewsGroupBSO cateNewsGroupBSO = new CateNewsGroupBSO();
            //DataTable table = cateNewsGroupBSO.GetCateNewsGroupAll();
            DataTable table = cateNewsGroupBSO.GetCateLanguage(_ngonNgu);

            DataList1.DataSource = table;
            DataList1.DataBind();
        }
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;
        }
        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. 10
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 ViewCateGroup()
 {
     CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
     DataTable table = catenewsGroupBSO.GetCateNewsGroupAll();
     DataView dv = new DataView(table);
     dv.RowFilter = "CateNewsGroupName <> 'Văn bản pháp quy' and language = 'vi-VN'";
     DataTable dt = dv.ToTable();
     commonBSO commonBSO = new commonBSO();
     commonBSO.FillToDropDown(ddlValueCategory, dt, "Không có giá trị", "0", "CateNewsGroupName", "GroupCate", "");
 }
Esempio n. 13
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;
            }
        }
        private void initControl(int Id)
        {
            if (Id > 0)
            {
                btn_add.Visible = false;
                btn_edit.Visible = true;
                try
                {
                    CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
                    CateNewsGroup catenewsGroup = catenewsGroupBSO.GetCateNewsGroupById(Id);
                    hddCateNewsGroupID.Value = Convert.ToString(catenewsGroup.CateNewsGroupID);

                    txtCateNewsGroupName.Text = catenewsGroup.CateNewsGroupName;
                    txtGroupCate.Text = catenewsGroup.GroupCate.ToString();
                    txtDescription.Text = catenewsGroup.Description;
                    hddOrder.Value = Convert.ToString(catenewsGroup.Order);

                    chkView.Checked = catenewsGroup.IsView;
                    chkHome.Checked = catenewsGroup.IsHome;
                    chkMenu.Checked = catenewsGroup.IsMenu;
                    chkNews.Checked = catenewsGroup.IsNew;
                    chkPage.Checked = catenewsGroup.IsPage;
                    NgonNgu.SelectedValue = catenewsGroup.Language;
                    hddIcon.Value = catenewsGroup.Icon;
                    uploadPreview.Src = ResolveUrl("~/Upload/Category/Group/") + catenewsGroup.Icon;
                    rdbUrl.SelectedValue = Convert.ToString(catenewsGroup.IsUrl);
                    txtUrl.Text = catenewsGroup.Url;

                    txtPosition.Text = Convert.ToString(catenewsGroup.Position);

                    if (catenewsGroup.IsUrl == true)
                    {
                        txtUrl.Visible = true;
                    }
                    else
                    {
                        txtUrl.Visible = false;
                    }

                }
                catch (Exception ex)
                {
                    clientview.Text = ex.Message.ToString();
                }
            }
            else
            {
                btn_edit.Visible = false;
                btn_add.Visible = true;

            }
        }
Esempio n. 15
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;
 }
        private void BindTabStrip()
        {
            CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
            DataTable table = catenewsGroupBSO.GetCateNewsGroupMenuAll();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                Tab rootTab = CreateRootTab(table.Rows[i]["CateNewsGroupName"].ToString(), table.Rows[i]["GroupCate"].ToString());
                PageView pv = BuildPageViewContents(Convert.ToInt32(table.Rows[i]["GroupCate"].ToString()));
                RadMultiPage1.PageViews.Add(pv);


            }
        }
        public void ViewCateNewsGroup()
        {
            int Ngon_Ngu = Convert.ToInt32(ViewState["CauHinh_Viet"]);

            CateNewsGroupBSO cateNewsGroupBSO = new CateNewsGroupBSO();
            //DataTable table = cateNewsGroupBSO.GetCateNewsGroupViewAll();
            DataTable table = new DataTable();
            if (Ngon_Ngu == 1 || Ngon_Ngu == 0)
                table = cateNewsGroupBSO.GetCateLanguage(Language.language);
            else
                table = cateNewsGroupBSO.GetCateLanguage(Language.language_Eng);

            DataList1.DataSource = table;
            DataList1.DataBind();

        }
        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 grvCateNewsGroup_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int Id = Convert.ToInt32(e.CommandArgument.ToString());
            string nName = e.CommandName.ToLower();
            switch (nName)
            {

                case "_edit":
                    Response.Redirect("~/Admin/editcatenewsgroup/" + Id + "/Default.aspx");
                    break;
                case "_delete":
                    CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
                    catenewsGroupBSO.DeleteCateNewsGroup(Id);
                    ViewCateGroup();
                    break;
            }
        }
Esempio n. 20
0
        protected void LoadMenuBottom(string lang)
        {
            var menuBottom = "";
            // b1: Load menu cấp 1
            var parentMenu = new CateNewsGroupBSO();
            var dtParent = parentMenu.GetCateLanguage(lang);
            if (dtParent != null && dtParent.Rows.Count > 0)
            {
                dtParent = dtParent.Select("IsView=true and IsNew=true").CopyToDataTable();
                if (dtParent.Rows.Count > 4)
                    dtParent = dtParent.AsEnumerable().Take(4).CopyToDataTable();
                foreach (DataRow dr in dtParent.Rows)
                {
                    var g = dr["GroupCate"].ToString();

                    menuBottom += "<div class=\"col-md-3\"><div class=\"row\">";
                    if (Convert.ToBoolean(dr["IsUrl"]))
                        menuBottom += "<a href=\"" + dr["Url"] + "\" target=\"_blank\">";
                    else
                        if (Convert.ToBoolean(dr["IsPage"]))
                            menuBottom += "<a href=\"" + Page.ResolveUrl("FullPagesg/" + g + "/" + GetString(dr["CateNewsGroupName"]) + "/default.aspx\">");
                        else
                            menuBottom += "<a href=\"" + Page.ResolveUrl("FullNewsg/" + g + "/" + GetString(dr["CateNewsGroupName"]) + "/default.aspx\">");

                    menuBottom += "<img src=\"ImageHandler.aspx?image=Admin/Upload/Category/Group/" + dr["Icon"] + "\" alt=\"\" width=27 /><span><b>" + dr["CateNewsGroupName"] + "  </b></span></a></div>";
                    // B2: Load menu cấp 2 từ id của menu cấp 1
                    var childMenu = new CateNewsBSO();
                    var dtChild = childMenu.GetCateGroup(lang, Convert.ToInt32(dr["GroupCate"]));
                    if (dtChild != null && dtChild.Rows.Count > 0)
                    {
                        dtChild = dtChild.Select("ParentNewsID=0").CopyToDataTable();
                        menuBottom += "<div class=\"row list-new-footter\"><ul>";
                        foreach (DataRow drChild in dtChild.Rows)
                        {
                            var h = drChild["CateNewsID"].ToString();
                            menuBottom += "<li><a href=\"" + Page.ResolveUrl("~/CateNewsg/" + g + "/" + h + "/" + GetString(drChild["CateNewsName"]) + "/default.aspx\">") + drChild["CateNewsName"] + "</a></li>";
                        }
                        menuBottom += "</ul></div>";
                    }
                    menuBottom += "</div>";
                }

                ltrMenuBottom.Text = menuBottom;
            }
        }
        //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. 22
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;

            }
        }
        public void ViewCateNewsGroup()
        {
            CateNewsGroupBSO cateNewsGroupBSO = new CateNewsGroupBSO();
            DataTable table = new DataTable();
            int Ngon_Ngu = Convert.ToInt32(ViewState["CauHinh_Viet"]);
            if (Ngon_Ngu == 1 || Ngon_Ngu == 0)
                table = cateNewsGroupBSO.GetCateLanguage(Language.language);
            else
                table = cateNewsGroupBSO.GetCateLanguage(Language.language_Eng);

            DataView dv = new DataView(table);
            dv.RowFilter = "GroupCate <> 4";
            //for (int i = 0; i < table.Rows.Count; i++)
            //{
            //    if (Convert.ToInt32(table.Rows[i]["GroupCate"]) == 4)
            //    {
            //        table.Rows[i].Delete();
            //    }
            //}
            //table.AcceptChanges();
            DataList1.DataSource = dv.ToTable();
            DataList1.DataBind();

        }
        private void ViewCateGroup()
        {
            ConfigBSO configBSO = new ConfigBSO();
            int Ngon_Ngu = Convert.ToInt32(ViewState["CauHinh_Viet"]);
            if (Ngon_Ngu == 1 || Ngon_Ngu == 0)
            {
                CateNewsGroupBSO CateBSO = new CateNewsGroupBSO();
                DataTable table = CateBSO.GetCateLanguage(Language.language);
                commonBSO commonBSO = new commonBSO();
                commonBSO.FillToGridView(grvCateNewsGroup, table);
            }
            else
            {
                CateNewsGroupBSO CateBSO = new CateNewsGroupBSO();
                DataTable table = CateBSO.GetCateLanguage(Language.language_Eng);
                commonBSO commonBSO = new commonBSO();
                commonBSO.FillToGridView(grvCateNewsGroup, table);
            }
            //CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
            //DataTable table = catenewsGroupBSO.GetCateNewsGroupAll();
            //commonBSO commonBSO = new commonBSO();
            //commonBSO.FillToGridView(grvCateNewsGroup, table);

        }
Esempio n. 28
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;
        }
        protected void NgonNgu_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (NgonNgu.SelectedValue == "vi-VN")
            {
                CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
                DataTable table = catenewsGroupBSO.GetCateNewsGroupAll();
                DataView dv = new DataView(table);
                dv.RowFilter = "CateNewsGroupName <> 'Văn bản pháp quy' and language = 'vi-VN'";
                DataTable dt = dv.ToTable();
                commonBSO commonBSO = new commonBSO();
                commonBSO.FillToDropDown(ddlValueCategory, dt, "Không có giá trị", "0", "CateNewsGroupName", "GroupCate", "");
            }
            if (NgonNgu.SelectedValue == "en-US")
            {
                CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
                DataTable table = catenewsGroupBSO.GetCateNewsGroupAll();
                DataView dv = new DataView(table);
                dv.RowFilter = "CateNewsGroupName <> 'Văn bản pháp quy' and language = 'en-US'";
                DataTable dt = dv.ToTable();
                commonBSO commonBSO = new commonBSO();
                commonBSO.FillToDropDown(ddlValueCategory, dt, "Không có giá trị", "0", "CateNewsGroupName", "GroupCate", "");

            }


        }