コード例 #1
0
        public void DataBind(string key = "")
        {
            DataTable dt = new DataTable();

            if (!string.IsNullOrEmpty(Request.QueryString["ZoneId"]) && DataConverter.CLng(Request.QueryString["ZoneId"]) > 0)
            {
                int type   = DataConverter.CLng(Request.QueryString["type"]);
                int zoneid = DataConverter.CLng(Request.QueryString["ZoneId"]);
                if (!string.IsNullOrEmpty(Request.QueryString["type"]) && type > 0)
                {
                    dt = advBll.GetAdvByTypeAndZoneId(type, zoneid);
                }
                else
                {
                    dt = advBll.GetTableADList(zoneid);
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(Request.QueryString["type"]))
                {
                    dt = B_Advertisement.GetAdvByType(Convert.ToInt32(Request.QueryString["type"]));
                }
                else
                {
                    dt = B_Advertisement.GetAllAdvertisementList();
                }
            }

            Egv.DataSource = dt;
            Egv.DataBind();
        }
コード例 #2
0
ファイル: ADManage.aspx.cs プロジェクト: zwt-zf/cms
        private void RepNodeBind()
        {
            DataTable da = B_Advertisement.GetAllAdvertisementList();

            if (da.Rows.Count > 0)
            {
                this.nocontent.Style["display"] = "none";
                this.GridView1.DataSource       = da;
                this.GridView1.DataKeyNames     = new string[] { "ADID" };
                this.GridView1.DataBind();
                this.GridView1.Visible = true;
            }
            else
            {
                this.nocontent.Style["display"] = "";
                this.GridView1.Visible          = false;
            }
        }