Beispiel #1
0
 public void CreateClientRemote(ClientRemoteUpdate newClt)
 {
     CreateClient(newClt.IdType,
                  newClt.Id,
                  newClt.Port,
                  newClt.Name,
                  newClt.AppFilePath, newClt.LogFilePath,
                  newClt.Timeout, newClt.MailEnabled, newClt.LogAttachEnabled, newClt.QueueSize);
 }
Beispiel #2
0
        private void EndCreateClientRemote(object sender, EventArgs e)
        {
            // crear clase de update
            ClientRemoteUpdate cltUpd = new ClientRemoteUpdate();

            cltUpd.Name             = tbName.Text;
            cltUpd.AppFilePath      = tbAppPath.Text;
            cltUpd.LogFilePath      = tbLogPath.Text;
            cltUpd.Timeout          = int.Parse(tbTimeout.Text);
            cltUpd.MailEnabled      = chkEmail.Checked;
            cltUpd.LogAttachEnabled = chkAttachLog.Checked;
            cltUpd.QueueSize        = int.Parse(tbQueueSize.Text);

            if (rbKeyId.Checked)
            {
                cltUpd.IdType = ClientIdType.KeyByIdString;
                cltUpd.Id     = tbKeyID.Text;
            }
            else
            {
                cltUpd.IdType = ClientIdType.KeyByUdpPort;
                cltUpd.Id     = null;
            }

            if (tbKeyPort.Text.Length == 0)
            {
                cltUpd.Port = 0;
            }
            else
            {
                cltUpd.Port = int.Parse(tbKeyPort.Text);
            }

            // enviar
            RemReqCreateClient msg = new RemReqCreateClient(cltUpd);

            Out_SendCreateClient(msg);

            // restablecer event handlers
            btApplyEdit.Click  -= EndCreateClientRemote;
            btCancelEdit.Click -= CancelCreateClientRemote;

            btApplyEdit.Click  += UpdateRemote;
            btCancelEdit.Click += CancelUpdateRemote;

            // restablecer datos de cliente seleccionado
            lbClients.SelectedIndex = _selIndx;
        }
        public void UpdateClient(ClientRemoteUpdate updatedClient)
        {
            ClientData oldClient = GetClient(updatedClient.ClientId);

            oldClient.IdType = updatedClient.IdType;
            oldClient.Id     = updatedClient.Id;
            oldClient.Port   = updatedClient.Port;
            oldClient.Name   = updatedClient.Name;

            oldClient.AppFilePath = updatedClient.AppFilePath;
            oldClient.LogFilePath = updatedClient.LogFilePath;
            oldClient.Timeout     = updatedClient.Timeout;

            oldClient.MailEnabled      = updatedClient.MailEnabled;
            oldClient.LogAttachEnabled = updatedClient.LogAttachEnabled;
            oldClient.QueueSize        = updatedClient.QueueSize;

            UpdateKeys();
        }
Beispiel #4
0
        private void DoUpdateClientRemote()
        {
            // crear clase de update
            ClientRemoteUpdate cltUpd = new ClientRemoteUpdate();

            cltUpd.ClientId         = _currentClient.ClientId;
            cltUpd.Name             = tbName.Text;
            cltUpd.AppFilePath      = tbAppPath.Text;
            cltUpd.LogFilePath      = tbLogPath.Text;
            cltUpd.Timeout          = int.Parse(tbTimeout.Text);
            cltUpd.MailEnabled      = chkEmail.Checked;
            cltUpd.LogAttachEnabled = chkAttachLog.Checked;
            cltUpd.QueueSize        = int.Parse(tbQueueSize.Text);

            if (rbKeyId.Checked)
            {
                cltUpd.IdType = ClientIdType.KeyByIdString;
                cltUpd.Id     = tbKeyID.Text;
            }
            else
            {
                cltUpd.IdType = ClientIdType.KeyByUdpPort;
                cltUpd.Id     = null;
            }

            if (tbKeyPort.Text.Length == 0)
            {
                cltUpd.Port = 0;
            }
            else
            {
                cltUpd.Port = int.Parse(tbKeyPort.Text);
            }

            // enviar
            RemReqUpdateClient msg = new RemReqUpdateClient(cltUpd);

            Out_SendClientUpdate(msg);
        }
Beispiel #5
0
 public RequestUpdateClient(ClientRemoteUpdate data)
 {
     Data = data;
 }
Beispiel #6
0
 public RemReqCreateClient(ClientRemoteUpdate data)
 {
     Data = data;
 }