Example #1
0
        private static void Main()
        {
            //// verificar red
            Process mapwindow;

            Config.Load();
            try
            {
                DBNotifyListeners.CheckBD();
            }
            catch (Exception e)
            {
                //MessageBox.Show("Ha ocurrido el siguiente error al intentar conectar con la base de datos:\n"+e.Message+"\nLa aplicación se cerrará.","Error de conexión", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log.ShowAndLog(e);
                return;
            }

            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
            System.Windows.Forms.Application.Run(new MainForm());
            //var fi = new FileInfo(System.Windows.Forms.Application.StartupPath + @"\MapWindow\MapWindow.exe");
            //if (fi.Exists)
            //{
            //ProcessStartInfo pi = new ProcessStartInfo(fi.FullName, fi.DirectoryName + @"\New.mwprj") { WorkingDirectory = fi.DirectoryName };
            //mapwindow = Process.Start(pi);
            //}
        }
        private void button1_Click(object sender, EventArgs e)
        {
            _011_CubrirCuartel cuartel = new _011_CubrirCuartel();

            if (cuartel.ShowDialog() == DialogResult.OK)
            {
                DBNotifyListeners.RegisterListener(panelEstadoCarros1.OnUpdateCarroHandler);
            }
        }
Example #3
0
 private void MainTree_Load(object sender, EventArgs e)
 {
     if (!DesignMode)
     {
         DBNotifyListeners.RegisterListener(OnDataChanged);
         ZeusWin.AddActualizarHandler(OnActualizar);
         CargarComandantesGuardia();
     }
 }
        private void toolModulos3_Click(object sender, EventArgs e)
        {
            _011_CubrirCuartel cuartel = new _011_CubrirCuartel();
            PanelEstadoCarros  pec     = new PanelEstadoCarros();

            if (cuartel.ShowDialog() == DialogResult.OK)
            {
                DBNotifyListeners.RegisterListener(pec.OnUpdateCarroHandler);   //### No Estaba Comentado CBPA
            }
        }
        private void MainTabs_Load(object sender, EventArgs e)
        {
            // expedientes
            if (!DesignMode)
            {
                DBNotifyListeners.RegisterListener(OnExpedienteInsertUpdateHandler);
                DBNotifyListeners.RegisterListener(OnBitacoraChanged);

                CargarExpedientes();
                CargarBitacora();
            }
        }
Example #6
0
 private void SlidePanel_Load(object sender, EventArgs e)
 {
     if (!DesignMode)
     {
         DBNotifyListeners.RegisterListener(OnExpedienteInsertHandler);
         Height    = mainbtn.Height;
         collapsed = true;
         OnStateChanged(true);
         button1.ImageIndex = 0;
         // expedientes
         ContarExp();
         // carros cubriendo
         VerificarCubriendo();
     }
 }
Example #7
0
        private void btnProbar_Click(object sender, EventArgs e)
        {
            if (Validar())
            {
                string preHost = Config.Host, preBD = Config.Database;

                SetValues(textIP.Text, comboBD.Text);
                try
                {
                    DBNotifyListeners.CheckBD();
                    MessageBox.Show("La prueba de conexión fue correcta", "Conexión exitosa");
                }
                catch (Exception ex)
                {
                    SetValues(preHost, preBD);
                    MessageBox.Show(ex.Message, "Ha ocurrido un error");
                }
            }
        }
Example #8
0
        private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            DBNotifyListeners.CloseListeners();
            CerrarPlugins();
            if (mapwindow != null && !mapwindow.HasExited)
            {
                while (!mapwindow.HasExited)
                {
                    // try to close main window and wait 2 seconds
                    mapwindow.CloseMainWindow();
                    mapwindow.WaitForExit(2000);
                    if (!mapwindow.HasExited)
                    {
                        MessageBox.Show(
                            "No se puede cerrar MapWindow. Compruebe que todos los diálogos estén cerrados, y presione aceptar para volver a intentarlo.",
                            "Cerrando MapWindow", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
            }

            Log.Finish();
        }
 private void MaterialMayor_FormClosed(object sender, FormClosedEventArgs e)
 {
     RecursosEstaticos.PrimeraCarga = 1;
     DBNotifyListeners.UnregisterListener(panelEstadoCarros1.OnUpdateCarroHandler);
 }
 private void MaterialMayor_Load(object sender, EventArgs e)
 {
     DBNotifyListeners.RegisterListener(panelEstadoCarros1.OnUpdateCarroHandler);
 }