コード例 #1
0
        private void customerLoginButton_Click(object sender, EventArgs e)
        {
            if (_customer.Log(customerLoginText.Text, customerPasswordText.Text))
            {
                DialogResult = DialogResult.OK;

                var CustomerMenu = new customerMenuForm(_customer, _customer.GetCustomerByLogin(customerLoginText.Text).CustomerID);
                CustomerMenu.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Invalid credentials");
            }
        }
コード例 #2
0
        private void shipperSignUpButtom_Click(object sender, EventArgs e)
        {
            if (textBox3.Text.Length == 0 || textBox4.Text.Length == 0 || textBox5.Text.Length == 0 || textBox6.Text.Length == 0)
            {
                MessageBox.Show("Invalid data");
            }
            else
            {
                CustomerDTO user = new CustomerDTO
                {
                    EMail       = textBox3.Text,
                    Addres      = textBox4.Text,
                    Phone       = textBox5.Text,
                    Description = textBox6.Text
                };

                _customer.AddCustomer(user);
                var customerMenu = new customerMenuForm(_customer, user.CustomerID);
                customerMenu.Show();
                this.Hide();
            }
        }