Esempio n. 1
0
 public ServerResponseInformation RecieveComputerHardwareInformation
     (ComputerHardwareInformationDTO computeHardwareInformation, ClientLoginModel clientLogin)
 {
     try
     {
         _computerComponentService.UpdateProcessor
             (clientLogin.Login, computeHardwareInformation.Processor);
         _computerComponentService.UpdateMotherBoard
             (clientLogin.Login, computeHardwareInformation.MotherBoard);
         _computerComponentService.UpdateVideoCards
             (clientLogin.Login, computeHardwareInformation.VideoCards);
         _computerComponentService.UpdateDiskDrives
             (clientLogin.Login, computeHardwareInformation.DiskDrives);
         _computerComponentService.UpdatePhysicalMemories
             (clientLogin.Login, computeHardwareInformation.PhysicalMemories);
         return(new ServerResponseInformation
         {
             Status = 1,
             SerializedData = "Success"
         });
     }
     catch (ServerServicesException exception)
     {
         return(new ServerResponseInformation
         {
             Status = -1,
             SerializedData = exception.Message
         });
     }
 }
        public string GetComputerComponentCommandHandle(ClientCommandRequest clientCommandRequest)
        {
            HardwareSystemInformationController hardwareSystemInformationController
                = (HardwareSystemInformationController)_serviceProvider.GetService(typeof(HardwareSystemInformationController));
            ComputerHardwareInformationDTO chInformation = hardwareSystemInformationController
                                                           .GetComputerHardwareInformation();

            return(JsonConvert.SerializeObject(chInformation));
        }
        public ServerResponseInformation GetComputerComponent
            (ClientCommandInformation clientCommand)
        {
            AuthorizeController authorizeController = (AuthorizeController)_serviceProvider
                                                      .GetService(typeof(AuthorizeController));
            var resAuthorize = authorizeController.Authorize(clientCommand.ClientLogin);

            if (resAuthorize != null)
            {
                return(resAuthorize);
            }

            ComputerHardwareInformationDTO chInformation = JsonConvert
                                                           .DeserializeObject <ComputerHardwareInformationDTO>(clientCommand.SerializedData);
            ComputerController computerController = (ComputerController)_serviceProvider
                                                    .GetService(typeof(ComputerController));

            return(computerController.RecieveComputerHardwareInformation(chInformation, clientCommand.ClientLogin));
        }