예제 #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");
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            DepartmentManagement addDpmt = new DepartmentManagement();

            addDpmt.addDepartment(dpmtName, dpmtPermissions);

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

            removeDpmt.removeDeparment(tempDeleteDpmtStr);

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

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

            removeDpmt.removeDeparment(tempDeleteDpmtStr);

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

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

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

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