Exemplo n.º 1
0
        internal void CreateConfig()
        {
            _dbHandler = new DbHandler();

            // Crear nueva base de datos
            _dbHandler.CreateNewDb();

            ClientData client = new ClientData();

            /*
             *  Win1
             *  c:\Tmp\ClientUdp\wcudp1.exe
             *  20
             *  8001
             */
            client.Name        = "Win1";
            client.AppFilePath = "c:\\Tmp\\ClientUdp\\wcudp1.exe";
            client.LogFilePath = "c:\\Tmp\\ClientUdp\\wcudp1.txt";
            client.MailEnabled = true;
            client.Timeout     = 15;
            client.Port        = 8001;
            client.QueueSize   = 12;
            _dbHandler.ClientConfigDict.Add(client.Name, client);

            // Do it again...
            client                  = new ClientData();
            client.Name             = "Win2";
            client.AppFilePath      = "c:\\Tmp\\ClientUdp\\wcudp2.exe";
            client.LogFilePath      = "c:\\Tmp\\ClientUdp\\wcudp2.txt";
            client.MailEnabled      = true;
            client.LogAttachEnabled = true;
            client.Timeout          = 15;
            client.Port             = 8002;
            client.QueueSize        = 24;
            _dbHandler.ClientConfigDict.Add(client.Name, client);

            //// ... and again
            client                  = new ClientData();
            client.Name             = "Con1";
            client.AppFilePath      = "c:\\Tmp\\ClientUdp\\cudp.exe";
            client.LogFilePath      = "c:\\Tmp\\ClientUdp\\cudp";
            client.MailEnabled      = true;
            client.LogAttachEnabled = true;
            client.Timeout          = 18;
            client.Port             = 8003;
            client.QueueSize        = 48;
            _dbHandler.ClientConfigDict.Add(client.Name, client);

            // config system
            _dbHandler.SystemConfig.UdpServerPort  = 8888;
            _dbHandler.SystemConfig.ZyanServerName = Constants.ServerName;
            _dbHandler.SystemConfig.ZyanServerPort = Constants.ServerPort;
            _dbHandler.SystemConfig.SMtpServer     = "localhost";

            _dbHandler.SystemConfig.Source              = "*****@*****.**";
            _dbHandler.SystemConfig.Password            = "******";
            _dbHandler.SystemConfig.Destination         = "[email protected], [email protected]";
            _dbHandler.SystemConfig.TimeoutStartRestart = 1;

            //notificando objetos a la base de datos
            _dbHandler.SaveAllData();

            StopDbHandler();

            Console.WriteLine("Configuracion de prueba creada.");
        }
Exemplo n.º 2
0
 private void DoEditFormAcceptNewClient(EditFormAccept req)
 {
     _dbHandler.SaveAllData();
     EndEdit();
     Builder.Output("Cliente registrado.");
 }