コード例 #1
0
    private void InquireCustomer()
    {
        string custref = txtCustRef.Text.Trim();

        if (custref.Equals(""))
        {
            ShowMessage("Please Enter Customer Reference Number", true);
            Button1.Enabled = false;
            txtCustRef.Focus();
        }
        else
        {
            ShowMessage(".", true);
            MultiView3.ActiveViewIndex = 0;
            Customer cust = new Customer();
            cust = bll.InquireCust(custref);
            if (cust.StatusCode.Equals("0"))
            {
                txtcode.Text             = cust.CustomerRef;
                txtname.Text             = cust.CustomerName;
                txtbal.Text              = cust.Balance.ToString("#,##0");
                txtCustType.Text         = cust.CustomerType.ToString().ToUpper();
                txtagentRef.Text         = "";
                txtAmount.Text           = "";
                cboVendor.SelectedIndex  = cboVendor.Items.IndexOf(cboVendor.Items.FindByValue("0"));
                cboPayType.SelectedIndex = cboPayType.Items.IndexOf(cboPayType.Items.FindByValue("0"));
                Button1.Enabled          = true;
            }
            else
            {
                ShowMessage(cust.StatusDescription, true);
                txtcode.Text     = "";
                txtname.Text     = "";
                txtCustType.Text = "";
                txtbal.Text      = "";
                txtAmount.Text   = "";
                txtPhone.Text    = "";
                Button1.Enabled  = false;
            }
        }
    }