Example #1
0
        /// <summary>
        /// This method is used to modify the selected role
        /// </summary>
        private void ModifyRole()
        {
            frmRolesInfo rolesinfo;
            string       rolename;

            try
            {
                if (RoleUserSecurities.SelectedRole != null)
                {
                    rolename = RoleUserSecurities.SelectedRole.Row["ROLE_NAME"].ToString().Trim();
                    if (rolename.ToString().ToUpper() == "ADMINISTRATOR")
                    {
                        MessageBox.Show("The role '" + rolename + "' cannot be edited.", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                        return;
                    }
                    rolesinfo = new frmRolesInfo(_userInformation, RoleUserSecurities.SelectedRole, "U");
                    rolesinfo.ShowInTaskbar = false;
                    //permissions.Owner = App.Current.MainWindow;
                    rolesinfo.ShowDialog();
                    NotifyPropertyChanged("RoleUserSecurities");
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
Example #2
0
        /// <summary>
        /// This method is used to show the Add Role screen
        /// </summary>
        private void ShowAddRole()
        {
            frmRolesInfo rolesinfo;

            try
            {
                rolesinfo = new frmRolesInfo(_userInformation, null, "I");
                rolesinfo.ShowInTaskbar = false;
                //permissions.Owner = App.Current.MainWindow;
                rolesinfo.ShowDialog();
                _securitydet.GetRoles(RoleUserSecurities);
                NotifyPropertyChanged("RoleUserSecurities");
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }