Ejemplo n.º 1
0
        private bool CheckError(ResponseDLL packet)
        {
            bool   hasError    = false;
            string description = "none";

            if (packet.err_server_code != 0)
            {
                description = packet.err_server_description;
                hasError    = true;
            }
            else if (packet.err_client_code != 0)
            {
                description = packet.err_client_description;
                hasError    = true;
            }
            else if (packet.err_terminal_code != 0)
            {
                description = packet.err_terminal_description;
                hasError    = true;
            }
            else if (packet.err_card_code != 0)
            {
                description = packet.err_card_description;
                hasError    = true;
            }
            if (hasError)
            {
                MessageBox.Show("Error: " + description);
            }
            return(hasError);
        }
Ejemplo n.º 2
0
        private void DelRestartTarget()
        {
            if (_selectedClient == null)
            {
                MessageBox.Show("Erreur: A client must be selected.");
                return;
            }
            ResponseDLL response = APIServerWrapper.RestartTarget(_selectedClient.ClientID);

            AddNewLog("RESTART", response);
        }
Ejemplo n.º 3
0
        private void DelDiagnoseClient()
        {
            if (_selectedClient == null)
            {
                MessageBox.Show("Erreur: A client must be selected.");
                return;
            }
            ResponseDLL response = APIServerWrapper.DiagClient(_selectedClient.ClientID);

            AddNewLog("DIAG", response);
        }
Ejemplo n.º 4
0
        private void DelEchoClient()
        {
            if (_selectedClient == null)
            {
                MessageBox.Show("Erreur: A client must be selected.");
                return;
            }
            ResponseDLL response = APIServerWrapper.EchoClient(_selectedClient.ClientID);

            AddNewLog("IS ALIVE", response);
        }
Ejemplo n.º 5
0
        private void DelSendCommandClient()
        {
            if (_selectedClient == null)
            {
                MessageBox.Show("Erreur: A client must be selected.");
                return;
            }
            ResponseDLL response = APIServerWrapper.SendCommand(_selectedClient.ClientID, _currentCommand);

            AddNewLog(String.Format("COMMAND {0}", _currentCommand), response);
        }
Ejemplo n.º 6
0
 private void AddNewLog(string request, ResponseDLL response)
 {
     if (_logsList.Count == logsLimit)
     {
         _logsList[logsPointer] = new LogModel(_selectedClient.ClientID, _selectedClient.ClientName, request, response);
     }
     else
     {
         _logsList.Add(new LogModel(_selectedClient.ClientID, _selectedClient.ClientName, request, response));
     }
     logsPointer = (logsPointer + 1) % logsLimit;
 }
Ejemplo n.º 7
0
        private void DelStopClient()
        {
            if (_selectedClient == null)
            {
                MessageBox.Show("Erreur: A client must be selected.");
                return;
            }
            ResponseDLL response = APIServerWrapper.StopClient(_selectedClient.ClientID);

            AddNewLog("STOP CLIENT", response);
            _clientsList.Remove(_selectedClient);
            _selectedClient = null;
            OnPropertyChanged("ClientsList");
        }