public string GetComputerSystemInformation(ClientCommandRequest clientCommandRequest) { OperatingSystemInformationController operatingSystemInformationController = (OperatingSystemInformationController)_serviceProvider.GetService(typeof(OperatingSystemInformationController)); ComputerSystemDTO computerSystem = operatingSystemInformationController.GetComputerSystemInformation(); return(JsonConvert.SerializeObject(computerSystem)); }
public void UpdateComputerSystem(string computerLogin, ComputerSystemDTO computerSystem) { ComputerSystem oldComputerSystem = _unitOfWork.ComputerSystems .GetByComputerLogin(computerLogin); if (oldComputerSystem != null) { _unitOfWork.ComputerSystems.Remove(oldComputerSystem); } ComputerSystem newComputerSystem = _mapper.Map <ComputerSystemDTO, ComputerSystem> (computerSystem); newComputerSystem.ComputerId = _unitOfWork.Computers.GetIdByLogin(computerLogin); _unitOfWork.ComputerSystems.Update(newComputerSystem); _unitOfWork.SaveChanges(); }
public ServerResponseInformation GetComputerSystemInformation (ClientCommandInformation clientCommand) { AuthorizeController authorizeController = (AuthorizeController)_serviceProvider .GetService(typeof(AuthorizeController)); var resAuthorize = authorizeController.Authorize(clientCommand.ClientLogin); if (resAuthorize != null) { return(resAuthorize); } ComputerSystemDTO computerSystem = JsonConvert .DeserializeObject <ComputerSystemDTO>(clientCommand.SerializedData); ComputerController processesController = (ComputerController)_serviceProvider .GetService(typeof(ComputerController)); return(processesController.RecieveComputerSystemInformation(computerSystem, clientCommand.ClientLogin)); }
public ServerResponseInformation RecieveComputerSystemInformation (ComputerSystemDTO computerSystem, ClientLoginModel clientLogin) { try { _computerSystemService.UpdateComputerSystem(clientLogin.Login, computerSystem); return(new ServerResponseInformation { Status = 1, SerializedData = "Success" }); } catch (ServerServicesException exception) { return(new ServerResponseInformation { Status = -1, SerializedData = exception.Message }); } }