コード例 #1
0
        private void binds()
        {
            GetDataFromTable tsd = new GetDataFromTable();
            DataTable        tds = tsd.GetAllDataFromtblAdministrator();

            rpItem.DataSource = tds;
            rpItem.DataBind();
        }
コード例 #2
0
        private DataTable DataBindNow()
        {
            DataTable td = new DataTable();
            /*查询账号级别*/
            string Sql = "";

            if (Request.Cookies["administator"]["ID"] != null)
            {
                Sql = "SELECT state FROM [XcXm].[dbo].[tblAdministrator] WHERE AdminId='" + Request.Cookies["administator"]["ID"].ToString() + "'";
            }
            int Jibie = Convert.ToInt32(DB.CarryOutSqlGetFirstColmun(Sql));

            ViewState["Grade"] = Jibie;
            if (Jibie == 30)
            {
                td = getTable.GetAllDataFromtblAdministrator("AdminId='" + ViewState["AdminId"].ToString() + "'");
            }
            else if (Jibie == 100)
            {
                td = getTable.GetAllDataFromtblAdministrator();
            }
            return(td);
        }