protected void ButtonQuery_Click(object sender, EventArgs e) { try { //清除目前選擇DATA //this.SelectLabelID.Text = ""; this.SelectLabelCode.Text = ""; this.SelectLabelName.Text = ""; //this.SelectLabelCreateDate.Text = ""; //this.SelectLabelCreateUID.Text = ""; //this.SelectLabelUpdateDate.Text = ""; //this.SelectLabelUpdateUID.Text = ""; //this.SelectLabelEnable.Text = ""; //GridView1.PageSize = Convert.ToInt32(TextBoxPagesize.Text.Trim()); STMModel.MaintainStoreGroup bco = new PIC.VDS2G.GFM.STM.MaintainStoreGroup(ConntionDB); firstpage = 0; firstindex = -1; ParameterList.Clear(); ParameterList.Add(SLP_StoreGroup.Text.Trim()); ParameterList.Add(TextBoxName.Text.Trim()); ParameterList.Add(TextBoxRowCountLimit.Text.Trim()); databind(bco.QueryByLikeForSLP(ParameterList)); } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0]; //直接取第一個 } finally { } }//ButtonQuery_Click
public string StoreGroupName(string Code) { string Name = ""; string ConnectionDBStr = ((DatabaseSettings)ConfigurationManager.GetSection("dataConfiguration")).DefaultDatabase; MaintainStoreGroup co_main = new MaintainStoreGroup(ConnectionDBStr); if (Code != "") { ArrayList ParameterList = new ArrayList(); ParameterList.Clear(); ParameterList.Add(Code); DataTable dt = co_main.QueryStoreGroupByCode(ParameterList); Name = ((dt.Rows.Count > 0) ? dt.Rows[0]["NAME"].ToString() : "查無資料"); } return Name; }