Example #1
0
        private void TomarGPS()
        {
            var list = (from r in Rutas.GetRutas()
                        where r.Selected
                        select r).ToList();

            if (list.Count() > 0)
            {
                var det = new Detalle(list);
                det.TomarGps(false);
            }



/*            var rowIndex = gridServicios.RowSel - 1;
 *
 *          if (rowIndex < 0) return;
 *
 *          var servicio = new BindingSource(gridServicios.DataSource, "");
 *          var obj = servicio[rowIndex] as ServicioView;
 *
 *          if (obj == null) return;
 *
 *          var serv = (from o in Rutas.GetRutas() where o.Id == obj.Id select o).FirstOrDefault();
 *
 *          if (serv.Motivo != null)
 *          {
 *              var form = new Detalle(serv, true);
 *              form.TomarGPS(false);
 *              serv.CalcularEstados();
 *          }*/
        }
Example #2
0
        private void menuItem2_Click(object sender, EventArgs e)
        {
            bool hizo = false;

/*                MessageBox.Show(@"Debe seleccionar servicios pendientes",
 *              string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Question,
 *              MessageBoxDefaultButton.Button1);*/


            var list = (from r in Rutas.GetRutas()
                        where r.Selected && (r.LlevaLaterales || r.LlevaReferencia)
                        select r).ToList();

            if (list.Count() > 0)
            {
                var det = new Detalle(list);
                det.TomarLateralesReferencia(false, true, true);
                hizo = true;
            }


            list = (from r in Rutas.GetRutas()
                    where r.Selected && (r.LlevaGPS)
                    select r).ToList();

            if (list.Count() > 0)
            {
                var det = new Detalle(list);
                det.TomarGps(false);
                hizo = true;
            }

            list = (from r in Rutas.GetRutas()
                    where r.Selected && (r.LlevaFoto)
                    select r).ToList();

            if (list.Count() > 0)
            {
                var det = new Detalle(list);
                det.TomarFoto(false);
                hizo = true;
            }


            if (!hizo)
            {
                MessageBox.Show(@"Debe seleccionar servicios pendientes",
                                string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);
            }

            Focus();
            return;

            //hacer
        }