protected void ButtonQuery_Click(object sender, EventArgs e) { try { //清除目前選擇DATA this.SelectLabelCode.Text = ""; this.SelectLabelName.Text = ""; GridView1.PageSize = Convert.ToInt32(TextBoxPagesize.Text.Trim()); VAMModel.VendorDisc bco = new VAMModel.VendorDisc(ConntionDB); firstpage = 0; firstindex = -1; ParameterList.Clear(); ParameterList.Add(TextBoxRowCountLimit.Text.Trim()); ParameterList.Add(TextBoxCode.Text.Trim() + "%"); ParameterList.Add(SLP_SLPDate1.Text.Trim()); ParameterList.Add(txt_VendorBase.Text.Trim()); ParameterList.Add(SLP_VendorBase1.Text.Trim()); databind(bco.QueryAllForSLP(ParameterList)); } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } finally { } }//ButtonQuery_Click
public string VendorDiscName(string Code, string Manufacture ) { string Name = ""; string ConnectionDBStr = ((DatabaseSettings)ConfigurationManager.GetSection("dataConfiguration")).DefaultDatabase; VendorDisc VendorDisc = new VendorDisc(ConnectionDBStr); if (Code != "") { ArrayList ParameterList = new ArrayList(); ParameterList.Add(Code); ParameterList.Add(Manufacture); DataTable dt = VendorDisc.QueryForSLP(ParameterList); Name = ((dt.Rows.Count > 0) ? dt.Rows[0]["DISC_DATE"].ToString() : "查無資料"); } return Name; }