示例#1
0
        private void userEditBtn_Click(object sender, EventArgs e)
        {
            UserSecurity.User user = (UserSecurity.User)usersBinding.Current;

            if (user.Login == UserSecurity.CurrentUser.Login)
            {
                InfoBox ib = new InfoBox();

                ib.Icon = MessageBoxIcon.Error;
                ib.Show("You cannot edit yourself!");

                return;
            }

            if (user.Roles.Contains(m_adminRole))
            {
                if (!CanSuperAdmin("edit administrators"))
                {
                    return;
                }
            }

            UserEditForm dlg = new UserEditForm(user);

            dlg.ShowDialog(this);
        }
示例#2
0
        private void userAddBtn_Click(object sender, EventArgs e)
        {
            UserEditForm dlg = new UserEditForm(null);

            dlg.ShowDialog(this);
        }