private void DBBind() { string strProviderID = this.txtProviderID.Text.Trim(); string strProviderName = this.txtProviderName.Text.Trim(); Hashtable htPara = new Hashtable(); htPara.Add("strProviderID", strProviderID); htPara.Add("strProviderName", strProviderName); Hashtable htapp = (Hashtable)Application["appconf"]; string strcons = (string)htapp["cons"]; StoBusi = new BusiComm.StorageBusi(strcons); try { DataTable dtout = StoBusi.GetProvider(htPara); if (dtout == null) { this.SetErrorMsgPageBydir("查询出错,请重试!"); return; } else { this.TableConvert(dtout, "供应商分类", "tbNameCodeToStorage", "vcCommSign='PrvdClass'"); this.TableConvert(dtout, "信用等级", "tbNameCodeToStorage", "vcCommSign='PrvdCredit'"); this.TableConvert(dtout, "有效标志", "tbNameCodeToStorage", "vcCommSign='PrvdActF'"); dtout.TableName = "供应商档案"; DataTable dtexcel = dtout.Copy(); Session["QUERY"] = dtout; } UcPageView1.MyDataGrid.PageSize = 20; DataView dvOut = new DataView(dtout); this.UcPageView1.MyDataSource = dvOut; this.UcPageView1.BindGrid(); } catch (Exception er) { this.clog.WriteLine(er); this.SetErrorMsgPageBydir("查询错误,请重试!"); return; } }
protected void btnQuery_Click(object sender, System.EventArgs e) { string strProviderID = this.txtProviderID.Text.Trim(); string strProviderName = this.txtProviderName.Text.Trim(); Hashtable htPara = new Hashtable(); htPara.Add("strProviderID", strProviderID); htPara.Add("strProviderName", strProviderName); Hashtable htapp = (Hashtable)Application["appconf"]; string strcons = (string)htapp["cons"]; StoBusi = new BusiComm.StorageBusi(strcons); try { DataTable dtout = StoBusi.GetProvider(htPara); if (dtout == null) { this.SetErrorMsgPageBydir("查询出错,请重试!"); return; } else { dtout.TableName = "供应商信息"; DataTable dtexcel = dtout.Copy(); Session["QUERY"] = dtout; } UcPageView1.MyDataGrid.PageSize = 20; DataView dvOut = new DataView(dtout); this.UcPageView1.MyDataSource = dvOut; this.UcPageView1.BindGrid(); } catch (Exception er) { this.clog.WriteLine(er); this.SetErrorMsgPageBydir("查询错误,请重试!"); return; } }