Example #1
0
        private void btnLogIn_Click(object sender, EventArgs e)
        {
            string password = tbPassword.Text;
            string username = tbUsername.Text;

            UserBL userBL = new UserBL();
            User user = new User();
            user = userBL.CeckUser(username, password);
            string userRole = user.userRole ;
            if (userRole != null)
            {
                if (userRole.Equals("admin"))
                {
                    this.Visible = false;
                    AdminForm adminForm = new AdminForm();
                    adminForm.Show();

                }
                if (userRole.Equals("user"))
                {
                    this.Visible = false;

                    ClientForm clientForm = new ClientForm(user);
                    clientForm.Show();

                }
            }
            else
            {
                MessageBox.Show("User not exist");
            }
        }
Example #2
0
 private void buttonRelaod_Click(object sender, EventArgs e)
 {
     BL.UserBL userBL = new BL.UserBL();
     int userID = _user.Id;
     var userPackages =  userBL.ReturnUserPackages(userID);
     var bindingList = new BindingList<package>(userPackages);
     var source = new BindingSource(bindingList, null);
     dataGridView1.DataSource = source;
 }
        private void buttonSignUp_Click(object sender, EventArgs e)
        {
            String username = textBoxUsername.Text;
            String password = textBoxPassword.Text;

            BL.UserBL userBL = new BL.UserBL();
            userBL.RegisterUser(username, password);
            MessageBox.Show("Try to login");

            this.Dispose();
        }