Example #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!AddContact)
            {
                tblCustomer customer = new tblCustomer()
                {
                    customer_name = txtCustormerName.Text,
                    latitude      = Convert.ToDecimal(txtLatitude.Text),
                    longitude     = Convert.ToDecimal(txtLongitude.Text)
                };

                int customerId = customerRep.AddCustomer(customer);

                tblContact contact = new tblContact()
                {
                    contact_name   = txtContactName.Text,
                    contact_email  = txtContactEmail.Text,
                    contact_number = txtContactNumber.Text,
                    customer_id    = customerId
                };
                contactRep.AddContact(contact);
                ClearTextBoxes();
            }
            else
            {
                tblContact contact = new tblContact()
                {
                    contact_name   = txtContactName.Text,
                    contact_email  = txtContactEmail.Text,
                    contact_number = txtContactNumber.Text,
                    customer_id    = CustomerId
                };
                contactRep.AddContact(contact);
                ClearTextBoxes();
            }

            CustomerListForm listForm = new CustomerListForm();

            listForm.Show();
        }
Example #2
0
        private void customerListToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CustomerListForm listForm = new CustomerListForm();

            listForm.Show();
        }