Пример #1
0
        private void RegjistrohuButton_Click(object sender, EventArgs e)
        {
            UserModel userModel = new UserModel();

            userModel.Emri     = EmriBox.Text;
            userModel.Email    = EmailBox.Text;
            userModel.Password = PasswordBox.Text;
            userModel.Roli     = RoliBox.Text;

            DataController dataController = new DataController();

            if (dataController.regjistroPerdorues(userModel))
            {
                UserModel user = dataController.returnUserID(userModel.Email);

                if (user.Roli.Equals("manaxher"))
                {
                    ManagerDashboard managerDashboard = new ManagerDashboard(user);
                    this.Hide();
                    managerDashboard.Show();
                }
                else if (user.Roli.Equals("kamarier"))
                {
                    KamarierDashboard kamarierDashboard = new KamarierDashboard(user);
                    this.Hide();
                    kamarierDashboard.Show();
                }
            }
            else
            {
                MessageBox.Show("Regjistrim pa sukses!");
            }
        }
Пример #2
0
        private void EnterButton_Click(object sender, EventArgs e)
        {
            string UserEmail = UsernameBox.Text;

            if (ConfirmEmailAddress(UserEmail))
            {
                string UserPassword = PasswordBox.Text;

                if (ConfirmPassword(UserPassword))
                {
                    DataController dc = new DataController();

                    if (dc.konfirmoPerdorues(UserEmail, UserPassword))
                    {
                        //int UserID = Convert.ToInt32(dc.returnUserID(UserEmail));

                        UserModel model = dc.returnUserID(UserEmail);

                        if (model.Roli.Equals("manaxher"))
                        {
                            ManagerDashboard managerDashboard = new ManagerDashboard(model);
                            this.Hide();
                            managerDashboard.Show();
                        }
                        else if (model.Roli.Equals("kamarier"))
                        {
                            KamarierDashboard kamarierDashboard = new KamarierDashboard(model);
                            this.Hide();
                            kamarierDashboard.Show();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Password jo i sakte. Provoni perseri.");
                    }
                }
                else
                {
                    MessageBox.Show("Vendosni Password.");
                }
            }
            else
            {
                MessageBox.Show("Vendosni Username te sakte.");
            }
        }