private void btnCustSearch_Click(object sender, EventArgs e) { CustomerSearchDialog dialog = new CustomerSearchDialog(); dialog.ShowDialog(this); if (dialog.DialogResult == DialogResult.OK) { cust = dialog.ReturnCustomer(); if (cust != null) { txtCustName.Text = cust.cust_name.Trim(); txtAddress.Text = cust.cust_address.Trim(); txtPhone.Text = cust.cust_phone.Trim(); saleOrder.cust_id = cust.cust_id; // Update Sale order } } }
private void btnQuickSearch_Click(object sender, EventArgs e) { var customer = db.Customers.Where(c => c.cust_name.Equals("Unknown")).First(); if (customer != null) { cust = customer; saleOrder.cust_id = cust.cust_id; txtCustName.Text = cust.cust_name.Trim(); txtAddress.Text = cust.cust_address.Trim(); txtPhone.Text = cust.cust_phone.Trim(); } }
private void btnClearCust_Click(object sender, EventArgs e) { cust = null; txtCustName.Text = string.Empty; txtAddress.Text = string.Empty; txtPhone.Text = string.Empty; }