Exemple #1
0
        /// <summary>
        /// Displays the customer search UI
        /// </summary>
        /// <returns>Customer if found, null otherwise</returns>
        public DE.ICustomer Search()
        {
            string selectedCustomerId = string.Empty;

            // Show the search dialog
            using (frmCustomerSearch searchDialog = new frmCustomerSearch())
            {
                this.Application.ApplicationFramework.POSShowForm(searchDialog);

                // Quit if cancel is pressed...
                if (searchDialog.DialogResult != System.Windows.Forms.DialogResult.OK)
                {
                    return(null);
                }
                selectedCustomerId = searchDialog.SelectedCustomerId;
            }

            //Get information about the selected customer and return it
            if (selectedCustomerId.Length != 0)
            {
                //Get the customer info...
                return(this.CustomerSystem.GetCustomerInfo(selectedCustomerId));
            }
            else
            {
                //No customer was selected
                return(null);
            }
        }
Exemple #2
0
        private void cmdCustomer_Click(object sender, EventArgs e)
        {
            frmCustomerSearch f = new frmCustomerSearch();

            f.AddItemCallback = new frmCustomerSearch.AddCustomerDelegate(this.SetCustomerCallBack);
            f.ShowDialog();
        }
Exemple #3
0
        private void cmdCustomer_Click(object sender, EventArgs e)
        {
            frmCustomerSearch f = new frmCustomerSearch();

            f.AddItemCallback = new frmCustomerSearch.AddCustomerDelegate(this.SetCustomerCallBack);
            f.ShowDialog();
            if (GStrCode != "")
            {
                DataSet dsSupplier = new mcustvendCRUD().getData(GStrCode, "", "");
                for (int i = 0; i < dsSupplier.Tables[0].Rows.Count; i++)
                {
                    txtCustomerDesc.Text = Convert.ToString(dsSupplier.Tables[0].Rows[i]["NAME"]);
                    txtAddress.Text      = Convert.ToString(dsSupplier.Tables[0].Rows[i]["ADDRESS"]);
                }
            }
        }