コード例 #1
0
ファイル: Footer.ascx.cs プロジェクト: trungjc/quanlyhocsinh
        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;
            }
        }
コード例 #2
0
        protected void ViewService(int Group)
        {
            CateNewsBSO cate = new CateNewsBSO();
            DataTable dt = cate.GetCateGroup(Language.lang, Group);

            rptService.DataSource = dt;
            rptService.DataBind();
        }
コード例 #3
0
        protected void ViewService(int Group)
        {
            CateNewsBSO cate = new CateNewsBSO();
            DataTable dt = cate.GetCateGroup(Session["Lang"].ToString(), Group);

            rptService.DataSource = dt;
            rptService.DataBind();
        }
コード例 #4
0
ファイル: Footer.ascx.cs プロジェクト: trungjc/quanlyhocsinh
        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;
            }
        }