Beispiel #1
0
        private void NewUserOK_Click(object sender, EventArgs e)
        {
            var newUser          = new AccountManagement();
            var department       = new DepartmentManagement();
            var departmentByName = department.GetDepartmentByName(departmentAssign.Text);

            if (newUsername.Text == "" || newUserPassword.Text == "" || confirmNewUserPassword.Text == "" ||
                departmentAssign.Text == "" || permissionsBox.Text == "" || confirmNewUserPassword.Text == "")
            {
                MessageBox.Show("You must have a value for ALL fields");
            }
            else if (newUserPassword.Text != "" || confirmNewUserPassword.Text != "")
            {
                if (confirmNewUserPassword.Text == newUserPassword.Text)
                {
                    newUser.CreateUser(newUsername.Text, newUserPassword.Text, departmentByName.DepartmentUid,
                                       Convert.ToInt32(permissionsBox.Text));
                    Hide();
                }
            }
            else
            {
                MessageBox.Show("Passwords do not match, Please re-enter");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            DepartmentManagement addDpmt = new DepartmentManagement();

            addDpmt.addDepartment(dpmtName, dpmtPermissions);

            this.Close();
        }
Beispiel #3
0
        private void deleteDepartmentButton_Click(object sender, EventArgs e)
        {
            DepartmentManagement removeDpmt = new DepartmentManagement();
            int tempDeleteDpmtStr           = Convert.ToInt32(departmentToDelete);

            removeDpmt.removeDeparment(tempDeleteDpmtStr);

            this.Close();
        }
Beispiel #4
0
        public Oversight()
        {
            InitializeComponent();

            stenerManagement     = new StenerManagement();
            departmentManagement = new DepartmentManagement();
            accountManagement    = new AccountManagement();
            violationManagement  = new ViolationManagement();
        }
        private void DeleteDepartmentButton_Click(object sender, EventArgs e)
        {
            var removeDpmt        = new DepartmentManagement();
            var tempDeleteDpmtStr = Convert.ToInt32(DepartmentToDelete);

            removeDpmt.removeDeparment(tempDeleteDpmtStr);

            Close();
        }
Beispiel #6
0
        public Oversight(UserData user)
        {
            InitializeComponent();

            stenerManagement     = new StenerManagement();
            departmentManagement = new DepartmentManagement();
            accountManagement    = new AccountManagement();
            violationManagement  = new ViolationManagement();
            currentUser          = user;
        }
Beispiel #7
0
        public NewUser()
        {
            InitializeComponent();
            departmentManagement = new DepartmentManagement();

            departmentAssign.Items.Clear();
            var departmentNames = departmentManagement.GetDepartmentNames();

            foreach (var dept in departmentNames)
            {
                departmentAssign.Items.Add(dept);
            }
        }
Beispiel #8
0
 public NewUser(UserData user)
 {
     InitializeComponent();
     newUser = user;
     departmentManagement = new DepartmentManagement();
 }