private void btnSave_Click(object sender, EventArgs e)
        {
            if (this.txtBox_CustName.Text.Trim() == "")
            {
                MessageBox.Show("Please insert 'Item Name' ", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtBox_CustName.Focus();
            }
            else if (this.txtBox_CustAddress.Text.Trim() == "")
            {
                MessageBox.Show("Please insert 'Address' ", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtBox_CustAddress.Focus();
            }
            else
            {
                if (editMode == true)
                {
                    dao.EditCustomer(GetTxtBoxData(), cust);
                }
                else
                {
                    dao.AddNewCustomer(GetTxtBoxData());
                }

                this.Close();
            }
        }
示例#2
0
 public int AddNewCustomer(CustomerInfo customerInfo)
 {
     return(customerDAO.AddNewCustomer(customerInfo));
 }
示例#3
0
 /// <summary>
 /// i.Enter new customers,
 /// </summary>
 /// <param name="customer"></param>
 public void addNewCustomer(Customer customer)
 {
     dal.AddNewCustomer(customer);
 }
        public int AddNewCustomer(CustomerDTO customer)
        {
            CustomerDAO dao = new CustomerDAO();

            return(dao.AddNewCustomer(customer));
        }