private void bind() { DataTable dataTable = new DataTable(); if (base.Request["PrjCode"] == null || base.Request["Levels"] == null) { this.DataGrid1.DataSource = ""; this.DataGrid1.DataBind(); } else { string text = "prjcode='" + base.Request["PrjCode"].ToString() + "' and ProgSign=" + base.Request["Levels"].ToString(); if (base.Request["Type"] == "View" || base.Request["Type"] == "List") { text += " and FlowState=1"; } dataTable = ItemProgAction.GetItemProgCollections(text); this.DataGrid1.DataSource = dataTable; this.DataGrid1.DataBind(); } this.ViewState[ItemProgList.resourceTable] = dataTable; }
protected void Button_query_Click(object sender, EventArgs e) { DataTable value = new DataTable(); if (base.Request["PrjCode"] == null || base.Request["Levels"] == null) { this.DataGrid1.DataSource = ""; this.DataGrid1.DataBind(); } else { string text = string.Concat(new string[] { "prjcode='", base.Request["PrjCode"].ToString(), "' and ProgSign=", base.Request["Levels"].ToString(), " and ProgSortCode=", this.DropDownList_lb.SelectedValue }); if (base.Request["Type"] == "View" || base.Request["Type"] == "List") { text += " and FlowState=1"; } if (!string.IsNullOrEmpty(this.TextBox_bcfdx.Text.Trim())) { text = text + " and ByProgObject like '%" + this.TextBox_bcfdx.Text.Trim() + "%'"; } if (!string.IsNullOrEmpty(this.TextBox_cfdw.Text.Trim())) { text = text + " and ProgUnit like '%" + this.TextBox_cfdw.Text.Trim() + "%'"; } value = ItemProgAction.GetItemProgCollections(text); this.DataGrid1.DataSource = ItemProgAction.GetItemProgCollections(text); this.DataGrid1.DataBind(); } this.ViewState[ItemProgList.resourceTable] = value; }