Exemplo n.º 1
0
        private void userToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var usersForm = new UsersForm();

            usersForm.MdiParent   = this;
            usersForm.WindowState = FormWindowState.Maximized;
            usersForm.Show();
        }
Exemplo n.º 2
0
        internal static void endLogin()
        {
            UsersForm form2 = new UsersForm();

            //MessageService service1 = new MessageService();
            //authTest auth1 = new authTest();

            //Presenter presenter = new Presenter(form2, auth1, service1);
            form2.Show();
        }
Exemplo n.º 3
0
        private void ListUsersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MdiChildren.Count() > 0)
            {
                MdiChildren[0].Close();

                UsersForm users = new UsersForm();

                users.MdiParent = this;
                users.Anchor    = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
                users.Show();
            }
        }
Exemplo n.º 4
0
        private void BackButton_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show(Constants.WarningMessages.UnsavedChanges, Constants.GoBackPrompt, MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                UsersForm usersForm = new UsersForm();
                usersForm.TopLevel   = false;
                usersForm.AutoScroll = true;
                this.Hide();
                ((Button)sender).Parent.Parent.Controls.Add(usersForm);
                usersForm.Show();
            }
        }
Exemplo n.º 5
0
        private void ShowUsersPage(object sender, EventArgs e)
        {
            Form form = FormActivation(typeof(UsersForm));

            if (form == null)
            {
                UsersForm f = new UsersForm();
                f.MdiParent = this;
                f.Show();
            }
            else
            {
                form.Activate();
            }
        }
Exemplo n.º 6
0
        private void ShowUsersBtn_Click(object sender, EventArgs e)
        {
            foreach (Form frm in this.MdiChildren)
            {
                frm.Close();
            }
            UsersForm form = new UsersForm {
                MdiParent = this,
                Dock      = DockStyle.Fill
            };

            form.Show();
            Slider.Top    = ShowUsersBtn.Top;
            Slider.Height = ShowUsersBtn.Height;
        }
Exemplo n.º 7
0
 private void EditUserButton_Click(object sender, EventArgs e)
 {
     try
     {
         string oldUsername = user.Username;
         string newUsername = UsernameTextBox.Text;
         string email       = EmailTextBox.Text;
         string phoneNumber = PhoneNumberTextBox.Text;
         Role   role        = (Role)Enum.Parse(typeof(Role), RoleComboBox.Text);
         bool   isDeleted   = NoRadioButton.Checked;
         UserService.UpdateUser(oldUsername, newUsername, email, phoneNumber, role, isDeleted);
         MessageBox.Show(Constants.SuccessMessages.UserUpdatedSuccessfully);
         UsersForm usersForm = new UsersForm();
         usersForm.TopLevel   = false;
         usersForm.AutoScroll = true;
         this.Hide();
         ((Button)sender).Parent.Parent.Controls.Add(usersForm);
         usersForm.Show();
     }
     catch (Exception exception)
     {
         MessageBox.Show(Constants.ErrorMessages.UserUpdateErrorMesage);
     }
 }
Exemplo n.º 8
0
        private void UserManagementToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var usersForm = new UsersForm();

            usersForm.Show();
        }