예제 #1
0
        private void buttonAut_Click(object sender, EventArgs e)
        {
            Controllers.Interfaces.IAuthorizationController controller = new Controllers.AuthorizationController(Model);

            string name = textName.Text;
            string pasw = textPas.Text;
            Form   form;
            bool   aut = controller.Autorize(name, pasw);

            if (aut == true)
            {
                UserType type = UserType.Client;
                if (comboUser.SelectedIndex == 0)
                {
                    form = new ClientView(Model);
                }
                if (comboUser.SelectedIndex == 1)
                {
                    form = new ManagerView(Model);
                }
                if (comboUser.SelectedIndex == 2)
                {
                    form = new OperatorView(Model);
                }
                label4.Text = "Aut is successful";
            }
        }
예제 #2
0
        private void buttonReg_Click(object sender, EventArgs e)
        {
            Controllers.Interfaces.IAuthorizationController controller = new Controllers.AuthorizationController(Model);

            string   name = textName.Text;
            string   pasw = textPas.Text;
            UserType type = UserType.Client;

            if (comboUser.SelectedIndex == 0)
            {
                type = UserType.Client;
            }
            if (comboUser.SelectedIndex == 1)
            {
                type = UserType.Manager;
            }
            if (comboUser.SelectedIndex == 2)
            {
                type = UserType.Operator;
            }
            controller.Register(name, pasw, type);
            label4.Text = "Registration is Done";
        }