示例#1
0
 internal Row(User user, Role role)
 {
     User = user;
     Role = role;
     LabelUserName.Content = User.UserName;
     LabelUserName.HorizontalContentAlignment = HorizontalAlignment.Left;
     LabelContextHeader.Content = User.UserName;
     ImageAvatar.Height         = 28;
     ImageAvatar.Width          = 28;
     SetDock(LabelUserName, Dock.Left);
     SetDock(ImageAvatar, Dock.Left);
     Children.Add(ImageAvatar);
     Children.Add(LabelUserName);
     //
     UserContextMenu.Items.Add(LabelContextHeader);
     UserContextMenu.Items.Add(MenuItemChangeRole);
     UserContextMenu.Items.Add(MenuItemKick);
     EventTrigger.RoutedEvent  = Button.ClickEvent;
     LabelUserName.ContextMenu = UserContextMenu;
     LabelUserName.Triggers.Add(EventTrigger);
     LabelUserName.MouseEnter += (o, e) => { LabelUserName.Background = Brushes.DarkGray; };
     LabelUserName.MouseLeave += (o, e) => { LabelUserName.Background = Brushes.Transparent; };
     MenuItemKick.Click       += (o, e) => { KickUser?.Invoke(this, new KickUserEventArgs(User)); };
     MenuItemChangeRole.Click += (o, e) => { ChangeUserRole?.Invoke(this, new ChangeUserRoleEventArgs(User, Role)); };
     LabelUserName.MouseUp    += (o, e) => { LabelUserName.ContextMenu.IsOpen = true; };
     Application.Current.Dispatcher.Invoke(async() => {
         await ImageResolver.DownloadUserImageAsync(user.ImageName, bitmap => {
             ImageAvatar.Source = bitmap;
         });
     });
 }
示例#2
0
        public void ChangeRole(ChangeUserRole command)
        {
            var user = userDatabase.Single(x => x.Id == command.UserId);

            user.Role =
                AutoMapper.Mapper.Map <RoleDetails, Role>(roleDatabase.SingleOrDefault(r => r.Id == command.RoleId));

            user.Modified = DateTime.Now;
        }
        public IActionResult ChangeRole(RoleList _roleList, User u)
        {
            var           emailOfUser = u._email;
            List <string> roleStr     = new List <string>();

            foreach (var item in _roleList.roles)
            {
                if (item.IsChecked)
                {
                    var tester = item.RoleName;
                    roleStr.Add(tester);
                }
            }

            ChangeUserRole changeuserrole = new ChangeUserRole(emailOfUser, roleStr[0]);

            var stringJson = JsonConvert.SerializeObject(changeuserrole);
            var jsonObject = JObject.Parse(stringJson);

            var returnType = _users.ChangeRoleOfUser(jsonObject);

            return(RedirectToAction("Index"));
        }
        /* Private member functions */
        /// <summary>
        /// Creates object for each individual command
        /// Corresponding command constructor initializes command specific parameters
        /// Also adds each command name and command object to command dictionary
        /// </summary>
        private static void CommandInitializer()
        {
            #region Chassis Infrastructure Commands
            GetServiceVersion getServiceVersionCmd = new GetServiceVersion();
            commandMap.Add(WcsCliConstants.getserviceversion, getServiceVersionCmd);

            // Get Chassis Info
            GetChassisInfo getChassisInfoCmd = new GetChassisInfo();
            commandMap.Add(WcsCliConstants.getChassisInfo, getChassisInfoCmd);

            GetChassisHealth getChassisHealthCmd = new GetChassisHealth();
            commandMap.Add(WcsCliConstants.getChassisHealth, getChassisHealthCmd);

            // Get Blade Info
            GetBladeInfo getBladeInfoCmd = new GetBladeInfo();
            commandMap.Add(WcsCliConstants.getBladeInfo, getBladeInfoCmd);

            GetBladeHealth getBladeHealthCmd = new GetBladeHealth();
            commandMap.Add(WcsCliConstants.getBladeHealth, getBladeHealthCmd);

            // PSU Firmware
            UpdatePsuFirmware updatePsuFirmwareCmd = new UpdatePsuFirmware();
            commandMap.Add(WcsCliConstants.updatePsuFirmware, updatePsuFirmwareCmd);

            GetPsuFirmwareStatus getPsuFirmwareStatusCmd = new GetPsuFirmwareStatus();
            commandMap.Add(WcsCliConstants.getPsuFirmwareStatus, getPsuFirmwareStatusCmd);

            #endregion

            #region Blade Management Commands
            // Get Power State
            GetBladeHardPowerState getBladeHardPowerStateCmd = new GetBladeHardPowerState();
            commandMap.Add(WcsCliConstants.getBladeHardPowerState, getBladeHardPowerStateCmd);

            SetPowerOn poweronCmd = new SetPowerOn();
            commandMap.Add(WcsCliConstants.setPowerOn, poweronCmd);

            SetPowerOff poweroffCmd = new SetPowerOff();
            commandMap.Add(WcsCliConstants.setPowerOff, poweroffCmd);

            GetBladeSoftPowerState getBladeSoftPowerStateCmd = new GetBladeSoftPowerState();
            commandMap.Add(WcsCliConstants.getBladeSoftPowerState, getBladeSoftPowerStateCmd);

            SetBladeOn bladeOnCmd = new SetBladeOn();
            commandMap.Add(WcsCliConstants.setBladeOn, bladeOnCmd);

            SetBladeOff bladeOffCmd = new SetBladeOff();
            commandMap.Add(WcsCliConstants.setBladeOff, bladeOffCmd);

            // Blade Default Power On state
            SetBladeDefaultPowerState setBladeDefaultPowerStateCmd = new SetBladeDefaultPowerState();
            commandMap.Add(WcsCliConstants.setBladeDefaultPowerState, setBladeDefaultPowerStateCmd);

            GetBladeDefaultPowerState getBladeDefaultPowerStateCmd = new GetBladeDefaultPowerState();
            commandMap.Add(WcsCliConstants.getBladeDefaultPowerState, getBladeDefaultPowerStateCmd);

            SetBladeActivePowerCycle powercycleCmd = new SetBladeActivePowerCycle();
            commandMap.Add(WcsCliConstants.setBladeActivePowerCycle, powercycleCmd);

            GetNextBoot getNextBootCmd = new GetNextBoot();
            commandMap.Add(WcsCliConstants.getnextboot, getNextBootCmd);

            SetNextBoot setNextBootCmd = new SetNextBoot();
            commandMap.Add(WcsCliConstants.setnextboot, setNextBootCmd);

            // Blade Attention LED on
            SetBladeAttentionLEDOn setBladeAttentionLEDOnCmd = new SetBladeAttentionLEDOn();
            commandMap.Add(WcsCliConstants.setBladeAttentionLEDOn, setBladeAttentionLEDOnCmd);

            // Blade Attention LED off
            SetBladeAttentionLEDOff setBladeAttentionLEDOffCmd = new SetBladeAttentionLEDOff();
            commandMap.Add(WcsCliConstants.setBladeAttentionLEDOff, setBladeAttentionLEDOffCmd);

            // Read Blade Log
            ReadBladeLog readBladeLogCmd = new ReadBladeLog();
            commandMap.Add(WcsCliConstants.readBladeLog, readBladeLogCmd);

            // Clear Blade Log
            ClearBladeLog clearBladeLogCmd = new ClearBladeLog();
            commandMap.Add(WcsCliConstants.clearBladeLog, clearBladeLogCmd);

            getpowerreading getpowerreadingCmd = new getpowerreading();
            commandMap.Add(WcsCliConstants.getpowerreading, getpowerreadingCmd);

            getpowerlimit getpowerlimitCmd = new getpowerlimit();
            commandMap.Add(WcsCliConstants.getpowerlimit, getpowerlimitCmd);

            setpowerlimit setpowerlimitCmd = new setpowerlimit();
            commandMap.Add(WcsCliConstants.setpowerlimit, setpowerlimitCmd);

            SetBladeActivePowerLimitOn activatepowerlimitCmd = new SetBladeActivePowerLimitOn();
            commandMap.Add(WcsCliConstants.setBladePowerLimitOn, activatepowerlimitCmd);

            SetBladeActivePowerLimitOff deactivatepowerlimitCmd = new SetBladeActivePowerLimitOff();
            commandMap.Add(WcsCliConstants.setBladePowerLimitOff, deactivatepowerlimitCmd);

            SetDataSafeBladeOn dataSafeBladeOnCmd = new SetDataSafeBladeOn();
            commandMap.Add(WcsCliConstants.dataSafeBladeOn, dataSafeBladeOnCmd);

            SetDataSafePowerOn dataSafePowerOnCmd = new SetDataSafePowerOn();
            commandMap.Add(WcsCliConstants.dataSafePowerOn, dataSafePowerOnCmd);

            SetDataSafeBladeOff dataSafeBladeOffCmd = new SetDataSafeBladeOff();
            commandMap.Add(WcsCliConstants.dataSafeBladeOff, dataSafeBladeOffCmd);

            SetDataSafePowerOff dataSafePowerOffCmd = new SetDataSafePowerOff();
            commandMap.Add(WcsCliConstants.dataSafePowerOff, dataSafePowerOffCmd);

            SetDataSafeBladeActivePowerCycle dataSafePowerCycleCmd = new SetDataSafeBladeActivePowerCycle();
            commandMap.Add(WcsCliConstants.dataSafePowerCycle, dataSafePowerCycleCmd);

            GetBladeDataSafePowerState getBladeDataSafePowerStateCmd = new GetBladeDataSafePowerState();
            commandMap.Add(WcsCliConstants.getBladeDataSafePowerState, getBladeDataSafePowerStateCmd);

            GetBladeBiosPostCode getBiosPostCodeCmd = new GetBladeBiosPostCode();
            commandMap.Add(WcsCliConstants.getBladeBiosPostCode, getBiosPostCodeCmd);

            SetBladePsuAlertDefaultPowerCap setPsuAlertDpcCmd = new SetBladePsuAlertDefaultPowerCap();
            commandMap.Add(WcsCliConstants.setBladePsuAlertDpc, setPsuAlertDpcCmd);

            GetBladePsuAlertDpc getPsuAlertDpcCmd = new GetBladePsuAlertDpc();
            commandMap.Add(WcsCliConstants.getBladePsuAlertDpc, getPsuAlertDpcCmd);

            GetBladePsuAlert getPsuAlertCmd = new GetBladePsuAlert();
            commandMap.Add(WcsCliConstants.getBladePsuAlert, getPsuAlertCmd);

            ActivateDeactivateBladePsuAlert activateDeactivatePsuAlertCmd = new ActivateDeactivateBladePsuAlert();
            commandMap.Add(WcsCliConstants.activateDeactivateBladePsuAlert, activateDeactivatePsuAlertCmd);

            GetBladeAssetInfo getBladeAssetInfoCmd = new GetBladeAssetInfo();
            commandMap.Add(WcsCliConstants.getBladeAssetInfo, getBladeAssetInfoCmd);

            GetBladeMezzAssetInfo getBladeMezzAssetInfoCmd = new GetBladeMezzAssetInfo();
            commandMap.Add(WcsCliConstants.getBladeMezzAssetInfo, getBladeMezzAssetInfoCmd);

            SetBladeAssetInfo setBladeAssetInfoCmd = new SetBladeAssetInfo();
            commandMap.Add(WcsCliConstants.setBladeAssetInfo, setBladeAssetInfoCmd);

            GetBladeMezzPassThroughMode getBladeMezzPassThroughModeCmd = new GetBladeMezzPassThroughMode();
            commandMap.Add(WcsCliConstants.getBladeMezzPassThroughMode, getBladeMezzPassThroughModeCmd);

            SetBladeMezzPassThroughMode setBladeMezzPassThroughModeCmd = new SetBladeMezzPassThroughMode();
            commandMap.Add(WcsCliConstants.setBladeMezzPassThroughMode, setBladeMezzPassThroughModeCmd);
            #endregion

            #region Chassis Management Commands
            // Chassis Attention LED Status
            GetChassisAttentionLEDStatus getChassisAttentionLEDStatusCmd = new GetChassisAttentionLEDStatus();
            commandMap.Add(WcsCliConstants.getChassisAttentionLEDStatus, getChassisAttentionLEDStatusCmd);

            // Chassis Attention LED On
            SetChassisAttentionLEDOn setChassisAttentionLEDCmd = new SetChassisAttentionLEDOn();
            commandMap.Add(WcsCliConstants.setChassisAttentionLEDOn, setChassisAttentionLEDCmd);

            // Chassis Attention LED Off
            SetChassisAttentionLEDOff setChassisAttentionLEDOffCmd = new SetChassisAttentionLEDOff();
            commandMap.Add(WcsCliConstants.setChassisAttentionLEDOff, setChassisAttentionLEDOffCmd);

            ReadChassisLog readChassisLogCmd = new ReadChassisLog();
            commandMap.Add(WcsCliConstants.readChassisLog, readChassisLogCmd);

            ClearChassisLog clearChassisLogCmd = new ClearChassisLog();
            commandMap.Add(WcsCliConstants.clearChassisLog, clearChassisLogCmd);

            // Get AC socket power state
            GetACSocketPowerState getACSocketPowerStateCmd = new GetACSocketPowerState();
            commandMap.Add(WcsCliConstants.getACSocketPowerState, getACSocketPowerStateCmd);

            // Set AC socket power state On
            SetACSocketPowerStateOn setACSocketPowerStateOnCmd = new SetACSocketPowerStateOn();
            commandMap.Add(WcsCliConstants.setACSocketPowerStateOn, setACSocketPowerStateOnCmd);

            // Set AC socket power state Off
            SetACSocketPowerStateOff setACSocketPowerStateOffCmd = new SetACSocketPowerStateOff();
            commandMap.Add(WcsCliConstants.setACSocketPowerStateOff, setACSocketPowerStateOffCmd);

            GetChassisAssetInfo getChassisAssetInfoCmd = new GetChassisAssetInfo();
            commandMap.Add(WcsCliConstants.getCMAssetInfo, getChassisAssetInfoCmd);

            GetPDBAssetInfo getPDBAssetInfoCmd = new GetPDBAssetInfo();
            commandMap.Add(WcsCliConstants.getPDBAssetInfo, getPDBAssetInfoCmd);

            SetChassisManagerAssetInfo setCMAssetInfoCmd = new SetChassisManagerAssetInfo();
            commandMap.Add(WcsCliConstants.setCMAssetInfo, setCMAssetInfoCmd);

            SetPDBAssetInfo setPDBAssetInfoCmd = new SetPDBAssetInfo();
            commandMap.Add(WcsCliConstants.setPDBAssetInfo, setPDBAssetInfoCmd);
            #endregion

            #region Local Commands (WCSCLI Serial Mode Only)
            SetNetworkProperties setNetworkPropertiesCmd = new SetNetworkProperties();
            setNetworkPropertiesCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.setNetworkProperties, setNetworkPropertiesCmd);

            GetNetworkProperties getNetworkPropertiesCmd = new GetNetworkProperties();
            getNetworkPropertiesCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.getNetworkProperties, getNetworkPropertiesCmd);

            Clear clearCmd = new Clear();
            clearCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.clear, clearCmd);
            #endregion

            #region Chassis Manager Service Configuration Commands (WCSCLI Serial Mode Only)
            StartChassisManagerService startCMServiceCmd = new StartChassisManagerService();
            startCMServiceCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.startchassismanager, startCMServiceCmd);

            StopChassisManagerService stopCMServiceCmd = new StopChassisManagerService();
            stopCMServiceCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.stopchassismanager, stopCMServiceCmd);

            GetCMServiceStatus getCMServiceStatusCmd = new GetCMServiceStatus();
            getCMServiceStatusCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.getchassismanagerstatus, getCMServiceStatusCmd);

            EnableSSL enableSslCmd = new EnableSSL();
            enableSslCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.enablessl, enableSslCmd);

            DisableSSL disableSslCmd = new DisableSSL();
            disableSslCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.disablessl, disableSslCmd);
            #endregion

            #region User Management Commands
            adduser adduserCmd = new adduser();
            commandMap.Add(WcsCliConstants.adduser, adduserCmd);

            ChangeUserRole changeuserCmd = new ChangeUserRole();
            commandMap.Add(WcsCliConstants.changeuserrole, changeuserCmd);

            ChangeUserPassword changeUserPwd = new ChangeUserPassword();
            commandMap.Add(WcsCliConstants.changeuserpassword, changeUserPwd);

            removeuser removeuserCmd = new removeuser();
            commandMap.Add(WcsCliConstants.removeuser, removeuserCmd);
            #endregion

            #region Serial Session Commands
            startBladeSerialSession startBladeSerialSessionCmd = new startBladeSerialSession();
            commandMap.Add(WcsCliConstants.startBladeSerialSession, startBladeSerialSessionCmd);

            StopBladeSerialSession stopBladeSerialSessionCmd = new StopBladeSerialSession();
            commandMap.Add(WcsCliConstants.stopBladeSerialSession, stopBladeSerialSessionCmd);

            startPortSerialSession startPortSerialSessionCmd = new startPortSerialSession();
            commandMap.Add(WcsCliConstants.startPortSerialSession, startPortSerialSessionCmd);

            StopPortSerialSession stopPortSerialSessionCmd = new StopPortSerialSession();
            commandMap.Add(WcsCliConstants.stopPortSerialSession, stopPortSerialSessionCmd);

            EstablishConnectionToCm establishCmConnectionCmd = new EstablishConnectionToCm();
            establishCmConnectionCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.establishCmConnection, establishCmConnectionCmd);

            TerminateCmConnection terminateCmConnectionCmd = new TerminateCmConnection();
            terminateCmConnectionCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.terminateCmConnection, terminateCmConnectionCmd);
            #endregion

            help helpCmd = new help();
            helpCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.help, helpCmd);

            return;
        }
示例#5
0
        /* Private memeber functions */
        /// <summary>
        /// Creates object for each individual command
        /// Corresponding command constructor initializes command specific parameters
        /// Also adds each command name and command object to command dictionary
        /// </summary>
        private static void CommandInitializer()
        {
            getinfo getinfoCmd = new getinfo();

            commandMap.Add(WcsCliConstants.getinfo, getinfoCmd);

            getscinfo getscinfoCmd = new getscinfo();

            commandMap.Add(WcsCliConstants.getscinfo, getscinfoCmd);
            commandsWithSledIdAndSledName.Add(getscinfoCmd);

            help helpCmd = new help();

            helpCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.help, helpCmd);

            ncidon ncidonCmd = new ncidon();

            commandMap.Add(WcsCliConstants.ncidon, ncidonCmd);

            ncidoff ncidoffCmd = new ncidoff();

            commandMap.Add(WcsCliConstants.ncidoff, ncidoffCmd);

            ncidstatus ncidstatusCmd = new ncidstatus();

            commandMap.Add(WcsCliConstants.ncidstatus, ncidstatusCmd);

            scidon scidonCmd = new scidon();

            commandMap.Add(WcsCliConstants.scidon, scidonCmd);
            commandsWithSledIdAndSledName.Add(scidonCmd);

            scidoff scidoffCmd = new scidoff();

            commandMap.Add(WcsCliConstants.scidoff, scidoffCmd);
            commandsWithSledIdAndSledName.Add(scidoffCmd);

            setscponstate setscponstateCmd = new setscponstate();

            commandMap.Add(WcsCliConstants.setscponstate, setscponstateCmd);
            commandsWithSledIdAndSledName.Add(setscponstateCmd);

            getscponstate getscponstateCmd = new getscponstate();

            commandMap.Add(WcsCliConstants.getscponstate, getscponstateCmd);
            commandsWithSledIdAndSledName.Add(getscponstateCmd);

            poweron poweronCmd = new poweron();

            commandMap.Add(WcsCliConstants.poweron, poweronCmd);
            commandsWithSledIdAndSledName.Add(poweronCmd);

            poweroff poweroffCmd = new poweroff();

            commandMap.Add(WcsCliConstants.poweroff, poweroffCmd);
            commandsWithSledIdAndSledName.Add(poweroffCmd);

            bladeon bladeOnCmd = new bladeon();

            commandMap.Add(WcsCliConstants.bladeon, bladeOnCmd);
            commandsWithSledIdAndSledName.Add(bladeOnCmd);

            bladeoff bladeOffCmd = new bladeoff();

            commandMap.Add(WcsCliConstants.bladeoff, bladeOffCmd);
            commandsWithSledIdAndSledName.Add(bladeOffCmd);

            getbladestate bladeStateCmd = new getbladestate();

            commandMap.Add(WcsCliConstants.getbladestate, bladeStateCmd);
            commandsWithSledIdAndSledName.Add(bladeStateCmd);

            powercycle powercycleCmd = new powercycle();

            commandMap.Add(WcsCliConstants.powercycle, powercycleCmd);
            commandsWithSledIdAndSledName.Add(powercycleCmd);

            getscpowerstate getscpowerstateCmd = new getscpowerstate();

            commandMap.Add(WcsCliConstants.getscpowerstate, getscpowerstateCmd);
            commandsWithSledIdAndSledName.Add(getscpowerstateCmd);

            powerinton powerintonCmd = new powerinton();

            commandMap.Add(WcsCliConstants.powerinton, powerintonCmd);

            powerintoff powerintoffCmd = new powerintoff();

            commandMap.Add(WcsCliConstants.powerintoff, powerintoffCmd);

            getpowerintstate getpowerintstateCmd = new getpowerintstate();

            commandMap.Add(WcsCliConstants.getpowerintstate, getpowerintstateCmd);

            startBladeSerialSession startBladeSerialSessionCmd = new startBladeSerialSession();

            commandMap.Add(WcsCliConstants.startBladeSerialSession, startBladeSerialSessionCmd);
            commandsWithSledIdAndSledName.Add(startBladeSerialSessionCmd);

            startPortSerialSession startPortSerialSessionCmd = new startPortSerialSession();

            commandMap.Add(WcsCliConstants.startPortSerialSession, startPortSerialSessionCmd);
            commandsWithSledIdAndSledName.Add(startBladeSerialSessionCmd);

            StopPortSerialSession stopsersessionCmd = new StopPortSerialSession();

            commandMap.Add(WcsCliConstants.stopPortSerialSession, stopsersessionCmd);
            commandsWithSledIdAndSledName.Add(stopsersessionCmd);

            StopBladeSerialSession stopBladeSerialSessionCmd = new StopBladeSerialSession();

            commandMap.Add(WcsCliConstants.stopBladeSerialSession, stopBladeSerialSessionCmd);
            commandsWithSledIdAndSledName.Add(stopBladeSerialSessionCmd);

            readnclog readnclogCmd = new readnclog();

            commandMap.Add(WcsCliConstants.readnclog, readnclogCmd);

            clrnclog clrnclogCmd = new clrnclog();

            commandMap.Add(WcsCliConstants.clrnclog, clrnclogCmd);

            readsclog readsclogCmd = new readsclog();

            commandMap.Add(WcsCliConstants.readsclog, readsclogCmd);
            commandsWithSledIdAndSledName.Add(readsclogCmd);

            clrsclog clrsclogCmd = new clrsclog();

            commandMap.Add(WcsCliConstants.clrsclog, clrsclogCmd);
            commandsWithSledIdAndSledName.Add(clrsclogCmd);

            adduser adduserCmd = new adduser();

            commandMap.Add(WcsCliConstants.adduser, adduserCmd);

            ChangeUserRole changeuserCmd = new ChangeUserRole();

            commandMap.Add(WcsCliConstants.changeuserrole, changeuserCmd);

            ChangeUserPassword changeUserPwd = new ChangeUserPassword();

            commandMap.Add(WcsCliConstants.changeuserpassword, changeUserPwd);

            removeuser removeuserCmd = new removeuser();

            commandMap.Add(WcsCliConstants.removeuser, removeuserCmd);

            getnic getnicCmd = new getnic();

            getnicCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.getnic, getnicCmd);

            setnic setnicCmd = new setnic();

            setnicCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.setnic, setnicCmd);

            getpowerreading getpowerreadingCmd = new getpowerreading();

            commandMap.Add(WcsCliConstants.getpowerreading, getpowerreadingCmd);

            getpowerlimit getpowerlimitCmd = new getpowerlimit();

            commandMap.Add(WcsCliConstants.getpowerlimit, getpowerlimitCmd);

            setpowerlimit setpowerlimitCmd = new setpowerlimit();

            commandMap.Add(WcsCliConstants.setpowerlimit, setpowerlimitCmd);

            activatepowerlimit activatepowerlimitCmd = new activatepowerlimit();

            commandMap.Add(WcsCliConstants.activatepowerlimit, activatepowerlimitCmd);

            deactivatepowerlimit deactivatepowerlimitCmd = new deactivatepowerlimit();

            commandMap.Add(WcsCliConstants.deactivatepowerlimit, deactivatepowerlimitCmd);

            GetChassisHealth getChassisHealthCmd = new GetChassisHealth();

            commandMap.Add(WcsCliConstants.getChassisHealth, getChassisHealthCmd);

            GetBladeHealth getBladeHealthCmd = new GetBladeHealth();

            commandMap.Add(WcsCliConstants.getBladeHealth, getBladeHealthCmd);

            SetNextBoot setNextBootCmd = new SetNextBoot();

            commandMap.Add(WcsCliConstants.setnextboot, setNextBootCmd);

            GetNextBoot getNextBootCmd = new GetNextBoot();

            commandMap.Add(WcsCliConstants.getnextboot, getNextBootCmd);

            GetServiceVersion getServiceVersionCmd = new GetServiceVersion();

            commandMap.Add(WcsCliConstants.getserviceversion, getServiceVersionCmd);

            EstablishConnectionToCm establishCmConnectionCmd = new EstablishConnectionToCm();

            establishCmConnectionCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.establishCmConnection, establishCmConnectionCmd);

            TerminateCmConnection terminateCmConnectionCmd = new TerminateCmConnection();

            terminateCmConnectionCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.terminateCmConnection, terminateCmConnectionCmd);

            StartChassisManagerService startCMServiceCmd = new StartChassisManagerService();

            startCMServiceCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.startchassismanager, startCMServiceCmd);

            StopChassisManagerService stopCMServiceCmd = new StopChassisManagerService();

            stopCMServiceCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.stopchassismanager, stopCMServiceCmd);

            GetCMServiceStatus getCMServiceStatusCmd = new GetCMServiceStatus();

            getCMServiceStatusCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.getchassismanagerstatus, getCMServiceStatusCmd);

            EnableSSL enableSslCmd = new EnableSSL();

            enableSslCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.enablessl, enableSslCmd);

            DisableSSL disableSslCmd = new DisableSSL();

            disableSslCmd.isCmServiceCommand = false;
            commandMap.Add(WcsCliConstants.disablessl, disableSslCmd);

            return;
        }
示例#6
0
    public async Task <IActionResult> ChangeUserRole([FromBody] ChangeUserRole command)
    {
        await _mediator.Send(command);

        return(NoContent());
    }
示例#7
0
 private void ButtonOk_Click(object sender, RoutedEventArgs e)
 {
     ChangeUserRole?.Invoke(this, new ChangeUserRoleEventArgs(UserToChange, RadioButtonRoles[RadioButtonSelected]));
 }