예제 #1
0
        private void Set_Permissions()
        {
            var     con  = new Controller();
            objUser user = con.Get_User(User);

            con.Set_AdminPermission(user, this);
        }
예제 #2
0
        private void BtnSearchUser_Click(object sender, RoutedEventArgs e)
        {
            string searchString = txtUsername.Text;

            if (string.IsNullOrEmpty(searchString))
            {
                MessageBox.Show("Search can not be empty", "Search can not be empty", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            Controller con       = new Controller();
            objUser    foundUser = con.Get_User(searchString);

            if (foundUser == null)
            {
                MessageBox.Show("Can not find a user with the username " + searchString, "Search can not be empty", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            username = foundUser.Username;
            this.Close();
        }