コード例 #1
0
        private void btn62_Click(object sender, EventArgs e)
        {
            var cd = new ConfirmarDespacho
            {
                IdCarros     = new List <int>(),
                IdExpediente = id_expediente,
                IdArea       = id_area,
                Agregando    = true
            };

            cd.ShowDialog();
            ZeusWin.Actualizar();
        }
コード例 #2
0
        private void generarDespachoRanking(int codigoLlamado)
        {
            string sindesp = "";

            Zeus.Data.e_expedientes expediente = new Zeus.Data.e_expedientes();
            int bloque = expediente.recFechaExpediente(this.IdExpediente);

            List <int> id_carros = Zeus.Util.Despacho.rakingParaIncendio(this.IdExpediente, this.IdArea, bloque, codigoLlamado);

            var cd = new ConfirmarDespacho
            {
                IdCarros     = id_carros,
                IdExpediente = this.IdExpediente,
                IdArea       = this.IdArea
            };

            cd.lblSinDesp.Text += "\n" + sindesp;
            cd.Batallon         = 1;
            cd.ShowDialog();
        }
コード例 #3
0
 private void btn4Bat_Click(object sender, EventArgs e)
 {
     try
     {
         string     sindesp;
         List <int> id_carros = Despacho.DespacharBatallon(id_expediente, id_area, 4, out sindesp);
         var        cd        = new ConfirmarDespacho
         {
             IdCarros     = id_carros,
             IdExpediente = id_expediente,
             IdArea       = id_area
         };
         cd.lblSinDesp.Text += "\n" + sindesp;
         cd.Batallon         = 4;
         cd.ShowDialog();
     }
     catch (Exception ex)
     {
         Log.ShowAndLog(ex);
     }
 }
コード例 #4
0
        private void btn2Bat_Click(object sender, EventArgs e)
        {
            try
            {
                string     sindesp;
                List <int> id_carros = Despacho.DespacharBatallon(id_expediente, id_area, 2, out sindesp);
                var        cd        = new ConfirmarDespacho
                {
                    IdCarros     = id_carros,
                    IdExpediente = id_expediente,
                    IdArea       = id_area
                };
                cd.lblSinDesp.Text += "\n" + sindesp;
                cd.Batallon         = 2;
                cd.ShowDialog();

                // verificar cubrir cuarteles
                if (cd.DialogResult == DialogResult.OK)
                {
#if !CBQN
                    int      compania;
                    z_carros carro = Despacho.BuscarCubrirCuartel(id_area, out compania);
                    if (carro.id_carro != 0)
                    {
                        // confirmar
                        if (MessageBox.Show("El carro " + carro.nombre + " puede cubrir cuartel.\n¿Desea activar Cubrir Cuartel?", "Cubrir Cuarteles", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            // cubrir cuartel
                            Carro.CubrirCuartel(carro, compania);
                            BitacoraGestion.NuevoEvento(ZeusWin.IdOperadora, ZeusWin.IdAval, "0-11: Carro " + carro.nombre + " cubre cuartel " + compania + " compañía");
                        }
                    }
#endif
                }
            }
            catch (Exception ex)
            {
                Log.ShowAndLog(ex);
            }
        }
コード例 #5
0
        private void generarDespachoRanking(int codigoLlamado)
        {
            string sindesp = "";

            Zeus.Data.e_expedientes expediente = new Zeus.Data.e_expedientes();
            int bloque = expediente.recFechaExpediente(this.IdExpediente);

            //string NuevoBloque = Convert.ToString(bloque);
            //MessageBox.Show("Estado  VERDADERO...    " + NuevoBloque, "GEObit");

            List <int> id_carros = Zeus.Util.Despacho.rakingParaIncendio(this.IdExpediente, this.IdArea, bloque, codigoLlamado);

            var cd = new ConfirmarDespacho
            {
                IdCarros     = id_carros,
                IdExpediente = this.IdExpediente,
                IdArea       = this.IdArea
            };

            cd.lblSinDesp.Text += "\n" + sindesp;
            cd.Batallon         = 1;
            cd.ShowDialog();
        }
コード例 #6
0
        private void btnDespachar_Click(object sender, EventArgs e)
        {
            DatosLogin.InvokeTwitter = "FT1";
            Cursor.Current           = Cursors.WaitCursor;
            var    exp     = new e_expedientes();
            var    llam    = new z_llamados();
            string sindesp = "";

            try
            {
                exp  = exp.getObjecte_expedientes(id_expediente);
                llam = llam.getObjectz_llamados(exp.codigo_principal);
            }
            catch (Exception ex)
            {
                Log.ShowAndLog(ex);
            }

            bloque_hora = recIDHORA();

            string NuevoBloque = Convert.ToString(bloque_hora);


            // ################################
            // ### Coordenadas para Twitter ###
            // ################################
            string strTw_X    = (Math.Truncate(exp.puntoX)).ToString();
            string strTw_Y    = (Math.Truncate(exp.puntoY)).ToString();
            string strLatLong = exp.Utm_2_LatLong(strTw_X, strTw_Y);
            string strURL     = "https://maps.google.cl/maps?q=";
            string strZOOM    = "&t=m&z=17";
            string strPlano   = strURL + strLatLong + strZOOM;

            // ### Agregar en el expediente el link del Plano
            exp.AgregarPlanoTwitter(id_expediente, strPlano);

            // ### Agregar en el expediente las coordenadas Lat Long
            exp.AgregarLatLongWeb(id_expediente, strLatLong);



            if (exp.id_area != 0)
            {
                // verificar si es despacho normal o despacho de incendio
                List <int> id_carros = Despacho.ranking(id_expediente, id_area, bloque_hora);
                //List<int> id_carros = Despacho.Despachar(id_expediente, id_area);


                //##################################
                //### Módulo Agregar B en 10-3-1 ###
                //##################################
                var DxD  = new DespachoPorDistancia();
                int IdMM = DxD.LlamadoEnRadioDeCia(id_expediente);
                if (IdMM > 0)
                {
                    //### Despachar Carro si esta Disponible
                    int intCarro26 = DespachoPorDistancia.DespachoPorDosSeis(IdMM);
                    if (intCarro26 > 0)
                    {
                        id_carros.Add(intCarro26);
                    }
                }



                // ### Si no hay carros, no se muestra la ventana de preparar despacho.
                // ### Esto ocurre porque para la intersección ingresada, Commander no
                // ### entrego un Ranking valido (todos los carros tienen Ranking = 1).
                if (id_carros.Count > 0)
                {
                    var cd = new ConfirmarDespacho
                    {
                        IdCarros     = id_carros,
                        IdExpediente = id_expediente,
                        IdArea       = id_area
                    };
                    cd.lblSinDesp.Text += "\n" + sindesp;


                    // ******

                    // ******************

                    cd.ShowDialog();
                    btnDespachar.Blink = false;
                    ZeusWin.Actualizar();
                }
            }
            else
            {
                var id_carros = new List <int>();
                var cd        = new CarroDisponible {
                    IdCarros = id_carros
                };
                if (cd.ShowDialog() == DialogResult.OK)
                {
                    Despacho.ConfirmarDespacho(id_carros, id_expediente);
                }
            }
            Cursor.Current = Cursors.Default;
        }