コード例 #1
0
        private void shipperLoginButton_Click(object sender, EventArgs e)
        {
            if (_shipper.Log(shipperLoginText.Text, ShipperPasswordText.Text))
            {
                DialogResult = DialogResult.OK;

                var ShipperMenu = new order_managerMenuForm(_shipper, _shipper.GetShipperByLogin(shipperLoginText.Text).ShipperID);
                ShipperMenu.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Invalid credentials");
            }
        }
コード例 #2
0
        private void shipperSignUpButtom_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0 || textBox2.Text.Length == 0 || textBox3.Text.Length == 0 || textBox4.Text.Length == 0 || textBox5.Text.Length == 0 || textBox6.Text.Length == 0)
            {
                MessageBox.Show("Invalid data");
            }
            else
            {
                ShipperDTO user = new ShipperDTO
                {
                    Login       = textBox1.Text,
                    Password    = new ConsoleProject.PasswordActions().PasswordEncryption(textBox2.Text),
                    EMail       = textBox3.Text,
                    Addres      = textBox4.Text,
                    Phone       = textBox5.Text,
                    Description = textBox6.Text
                };

                _shipper.AddShipper(user);
                var shipperMenu = new order_managerMenuForm(_shipper, user.ShipperID);
                shipperMenu.Show();
                this.Hide();
            }
        }