如何实现按钮按下的时候,按钮不可用。查询完成,可用。
想实现功能:
CmdQuery按下的时候,按钮不可用。查询完成,可用。
如何实现?
Private Sub CmdQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdQuery.Click
Dim RefsMsg As String, RefRS As ADODB.Recordset = Nothing
Dim CQuote As New BLL.Quote.CQuote
Dim CDateGrid As New Common.CADOToDOTNET
Dim RefTable As New DataTable
Dim CCommon As New Common.CommonClass
Dim GetDataGridCol() As String = {"quote_num", "stat", "cust_num", "name", "sumprice", "cust_seq", "cust_addr", "contact", "fax_num", "slsman", "slsman_name", "contact_tel", "cust_po", "tax_code", "terms_code", "terms_der", "curr_code", "ship_code", "input_man", "input_man_name", "input_date"}
Dim GetDataGridColDescription() As String = {"报价单号", "状态", "客户编码", "客户名称", "总金额", "发货序", "发货地址", "联系人", "传真", "外勤", "外勤姓名", "电话", "PO号", "税码", "结算代码", "结算描述", "货币码", "发货类型", "内勤", "内勤姓名", "创建时间"}
Dim CSecurity As New BLL.SessionStat
If CSecurity.SessionOutLogin(Me) = True Then Exit Sub
If drpYyNameList.SelectedValue = "" Then
CCommon.MsgBox("不存在营业所!", "drpYyNameList", Me)
Exit Sub
End If
If txtValue.Text.Trim = "" Then
CCommon.MsgBox("查询条件不可为空!", "txtValue", Me)
Exit Sub
End If
Session.Add(BLL.UserInfoConstant.SESSION_USER_INFO_YYCODE, drpYyNameList.SelectedValue)
CQuote.CN = CType(Session(BLL.UserInfoConstant.SESSION_USER_CON_CN), ADODB.Connection)
RefsMsg = CQuote.Query(drpYyNameList.SelectedValue, Sort.SelectedIndex + 1, txtValue.Text.Trim, IIf(ChkMyQuote.Checked, Session(BLL.UserInfoConstant.SESSION_USER_INFO_GONGHAO), ""), 50, True, RefRS)
If RefsMsg <> Nothing Then
CCommon.MsgBox(RefsMsg.Trim.ToString, "txtValue", Me)
Exit Sub
End If
If RefRS.EOF = False Then
RefTable = CDateGrid.RsToDateView(RefRS, GetDataGridCol, GetDataGridColDescription)
dagr_ShowData.DataSource = RefTable.DefaultView
dagr_ShowData.DataBind()
CCommon.TextSetFocus("dagr_ShowData:_ctl2:_ctl0", Me)
Else
CCommon.MsgBox("没有你想查询的数据结果!", "txtValue", Me)
RefRS = Nothing
Exit Sub
End If
RefRS.Close() : RefRS = Nothing
lbl_Count.Text = "共有<FONT color='red'>" + RefTable.DefaultView.Count.ToString() + "</FONT>条记录"
End Sub