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

            addDpmt.addDepartment(dpmtName, dpmtPermissions);

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

            removeDpmt.removeDeparment(tempDeleteDpmtStr);

            this.Close();
        }
Ejemplo n.º 4
0
        public Oversight()
        {
            InitializeComponent();

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

            removeDpmt.removeDeparment(tempDeleteDpmtStr);

            Close();
        }
Ejemplo n.º 6
0
        public Oversight(UserData user)
        {
            InitializeComponent();

            stenerManagement     = new StenerManagement();
            departmentManagement = new DepartmentManagement();
            accountManagement    = new AccountManagement();
            violationManagement  = new ViolationManagement();
            currentUser          = user;
        }
Ejemplo n.º 7
0
        public NewUser()
        {
            InitializeComponent();
            departmentManagement = new DepartmentManagement();

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

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