public void BindData() { #region //if (!Context.User.Identity.IsAuthenticated) //{ // return; //} //AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name); //if (user.HasPermissionID(PermId_Modify)) //{ // gridView.Columns[6].Visible = true; //} //if (user.HasPermissionID(PermId_Delete)) //{ // gridView.Columns[7].Visible = true; //} #endregion DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); if (txtKeyword.Text.Trim() != "") { #warning 代码生成警告:请修改 keywordField 为需要匹配查询的真实字段名称 //strWhere.AppendFormat("keywordField like '%{0}%'", txtKeyword.Text.Trim()); } ds = bll.GetList(strWhere.ToString()); gridView.DataSource = ds; gridView.DataBind(); }
private void BomFrom_Load(object sender, EventArgs e) { Maticsoft.BLL.parts part_bll = new Maticsoft.BLL.parts(); string where_string = this.query_wherestring(); this.totle_num = part_bll.GetRecordCount(where_string); string parem_num = string.Format("1/{0}", this.totle_num / this.cur_page_lenb + 1); labelX1.Text = parem_num; // Maticsoft.BLL.parts pr = new Maticsoft.BLL.parts(); DataSet ds = part_bll.GetList(" 1=1 limit 30 "); main_gc.DataSource = ds.Tables[0]; //DataTable dt = new DataTable();//创建表 //dt.Columns.Add("ljh", typeof(String)); //dt.Columns.Add("mc", typeof(String)); //dt.Columns.Add("gdh", typeof(String)); //dt.Columns.Add("scbh", typeof(String)); //dt.Columns.Add("cc", typeof(String)); //dt.Columns.Add("sandsm", typeof(String)); //dt.Columns.Add("tm", typeof(String)); //dt.Columns.Add("clbz", typeof(String)); //dt.Columns.Add("clsj", typeof(String)); //dt.Rows.Add(new object[] { "00001", "XX零件", "123223", "312312", "1*2*3","xxx.step" ,"3213123131231"});//添加行 //dt.Rows.Add(new object[] { "00002", "XX零件", "423523", "321122", "2*2*1", "xxx.step", "3213123131232" }); //dt.Rows.Add(new object[] { "00003", "XX零件", "242123", "441212", "2*3*3", "xxx.step", "3213123131233" }); //this.main_gc.DataSource = dt; }