//显示资产数据 private void BindData(string danwei) { int totalRow = 0; int curpage = 1; if (ViewState["curpage"] != null) { curpage = (int)ViewState["curpage"]; } U_ZCBU Zc1 = new U_ZCBU(); List <SearchField> list1 = new List <SearchField>(); if (danwei != null) { list1.Add(new SearchField("danwei", danwei, SearchOperator.包含)); } string sql = " bstatus is null"; list1.Add(new SearchField("", sql, SearchOperator.用户定义)); DataSet ds1 = Zc1.GetZcBaoList(list1, curpage, -1, out totalRow); this.GridView1.DataSource = ds1; this.GridView1.DataBind(); ds1.Dispose(); Zc1.Close(); this.PageNavigator1.TotalRows = totalRow; this.PageNavigator1.CurrentPage = curpage; }
void AdvanceSearch1_OnMySearchClick(object sender, EventArgs e) { ZcMng1_AdvanceSearch search1 = sender as ZcMng1_AdvanceSearch; if (search1 != null) { int totalRow = 0; int curpage = 1; List <SearchField> list1 = search1.SearchConditon; U_ZCBU Zc1 = new U_ZCBU(); DataSet ds1 = Zc1.GetZcBaoList(list1, curpage, -1, out totalRow); DataView dv1 = ds1.Tables[0].DefaultView; dv1.Sort = "num2"; this.GridView1.DataSource = dv1; this.GridView1.DataBind(); ds1.Dispose(); Zc1.Close(); this.PageNavigator1.TotalRows = totalRow; this.PageNavigator1.CurrentPage = curpage; } }