private void loaddata() { Maticsoft.BLL.wuzi wuzi_bll = new BLL.wuzi(); DataTable dt = wuzi_bll.GetList("style = 1").Tables[0]; GridView1.DataSource = dt; GridView1.DataBind(); AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name); User currentUser = new LTP.Accounts.Bus.User(user); fengongsi.Text = currentUser.TrueName; Maticsoft.BLL.peixunban1 bll = new Maticsoft.BLL.peixunban1(); DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); strWhere.Append("[start_time] < '"); strWhere.Append(DateTime.Today.AddDays(30).Date.ToShortDateString()); strWhere.Append("' and [end_time] > '"); strWhere.Append(DateTime.Today.AddDays(-30).Date.ToShortDateString()); strWhere.Append("'"); ds = bll.GetList(strWhere.ToString()); qishu.DataSource = ds; qishu.DataTextField = "name"; qishu.DataValueField = "id"; qishu.DataBind(); shijian.Text = DateTime.Now.ToShortDateString(); }
private void BindGrid() { Maticsoft.BLL.wuzi wz = new BLL.wuzi(); DataSet ds = wz.GetList(""); GridView1.DataSource = ds; GridView1.DataBind(); }