示例#1
0
        private void Button1_Click(object sender, EventArgs e)
        {
            var      Update = new AdjustData();
            var      Search = new SearchCustomer();
            Customer C      = Search.FindACustomer(_ID);

            C.FirstName = FirstNameBox.Text;
            C.LastName  = LastNameBox.Text;
            C.PersonID  = int.Parse(PersionIDBox.Text);

            if (Search.CheckPersonID(C))
            {
                MessageBox.Show("ID Already Exists");
            }
            else
            {
                Update.ChangeCustomer(C);
                this.Close();
            }
        }
示例#2
0
        private void Button1_Click(object sender, EventArgs e)
        {
            var Customer = new Customer();
            var Search   = new SearchCustomer();

            Customer.FirstName = FirstNameBox.Text;
            Customer.LastName  = LastNameBox.Text;
            Customer.PersonID  = int.Parse(PersionIDBox.Text);

            if (Search.CheckPersonID(Customer))
            {
                MessageBox.Show("ID Already Exists");
            }
            else
            {
                var Data = new AdjustData();
                Data.AddCustomer(Customer);

                this.Close();
            }
        }