Exemple #1
0
 public Romanero_Vista()
 {
     InitializeComponent();
     SQLiteManager.CheckFolders();
     _cooperado = new Cooperado_Vista();
     SetearSegundaPantalla();
     SetearFechaHora();
     SetearNombrePlanta();
     _cooperado.PlantaInfo.Text = Nombre_Planta;
     PlantaInfo.Text            = Nombre_Planta;
     WindowState = FormWindowState.Minimized;
     //SetStartUp();
     OracleManager.SetConfiguracionDePuerto(PuertoSerial, _MarcasUsuario.ID_Planta, 2);
     TopMost            = true;
     _cooperado.TopMost = true;
     try
     {
         PuertoSerial.Open();
     }
     catch (Exception _error)
     {
         MessageBox.Show("Configuración del Serial Incorrecta. Error: " + _error.Message, "ERROR FATAL",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     //EscribirEnLog(GetExecutingDirectoryName());
     //PowerModeChangedEventHandler += new SystemEvents_PowerModeChanged();
 }
Exemple #2
0
 public Refracto_Vista()
 {
     if (File.Exists(ConfigPath))
     {
         InitializeComponent();
         FechaInfo.Text = DateTime.Now.ToString("dd-MM-yyyy");
         HoraInfo.Text  = DateTime.Now.ToString("HH:mm:ss");
         SQLiteManager.CheckDataBase();
         ID_Planta = ConfirmarPlanta();
         if (!XML_Valido(PuertoSerial))
         {
             OracleManager.SetConfiguracionDePuerto(PuertoSerial, ID_Planta, 1);
         }
         _cooperado = new Cooperado_Vista();
         SetearSegundaPantalla();
         _cooperado.TopMost = true;
         try
         {
             PuertoSerial.Open();
         }
         catch (Exception _error)
         {
             MessageBox.Show("PuertoSerial mal configurado.Esto se debe a ERROR. " +
                             "Verifique la conexión y vuelva a iniciar la App. Error: " + _error.Message, "ERROR",
                             MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                             MessageBoxOptions.DefaultDesktopOnly);
             Application.Exit();
         }
         TopMost = true;
         _cooperado.PlantaInfo.Text = OracleManager.ObtenerNombrePlanta(ConfirmarPlanta());
         //SetStartUp();
         WindowState = FormWindowState.Minimized;
         EscribirEnLog(GetExecutingDirectoryName());
     }
     else
     {
         MessageBox.Show("NO EXISTE ARCHIVO DE CONFIGURACIONES.", "ERROR",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
         Application.Exit();
     }
 }
Exemple #3
0
 public Trabajador_Vista()
 {
     if (File.Exists(ConfigPath))
     {
         InitializeComponent();
         _observador = new MonitorArchivos(this, Cooperado);
         CheckForIllegalCrossThreadCalls = false;
         SettingUI();
         _observador.Run();
         SQliteManager.CheckDataBase();
         ID_Planta_Revision = ConfirmarPlanta();
         _MarcasUsuario     = new Session();
         _observador.InsertarProceso_Planta(_MarcasUsuario);
         OracleManager.SetConfiguracionDePuerto(PuertoSerial, _MarcasUsuario.Id_Planta, _MarcasUsuario.Tipo_Proceso);
         ConfigurarSerial();
         Cooperado.TopMost = true;
         TopMost           = true;
         //SetAutoRun();
         try
         {
             PuertoSerial.Open();
         }
         catch (Exception _error)
         {
             MessageBox.Show("PuertoSerial mal configurado. Error: " + _error.Message, "Error",
                             MessageBoxButtons.OK, MessageBoxIcon.Error);
             Application.Exit();
         }
         GC.KeepAlive(PuertoSerial);
     }
     else
     {
         MessageBox.Show("NO EXISTE ARCHIVO DE CONFIGURACIONES. GENERAR ARCHIVO .CONFIG", "ERROR",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
         Application.Exit();
     }
 }