Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            gpsCtrl         = new GpsController();
            vehiculoCtrl    = new VehiculoController();
            seguimientoCtrl = new SeguimientoController();
            homeCtrl        = new HomeController();

            if (!SitePrincipal.IsIntruso())
            {
                ListarIMEI();
                ListarPlaca();

                id = Request.QueryString["id"];
                var seg = seguimientoCtrl.listar(id);
                txtid.Text             = seg.CodSeguimiento.ToString();
                txtFechaI.Text         = seg.FechaInicio.ToShortDateString().ToString();
                chkestado.Checked      = seg.estado.Value;
                cboplaca.SelectedValue = seg.NroPlaca;
                cboimei.SelectedValue  = seg.IMEI;
            }
            else
            {
                Response.Redirect("~/Account/Login");
            }
        }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     seguimientoCtrl = new SeguimientoController();
     if (!IsPostBack)
     {
         if (!SitePrincipal.IsIntruso())
         {
             if (SitePrincipal.ExisteActiva())
             {
                 id = Request.QueryString["id"];
                 var se = seguimientoCtrl.listar(id);
                 lblid.Text     = se.CodSeguimiento.ToString();
                 lblestado.Text = (se.estado.Value) ? "Activo" : "Inactivo";
                 lblfechai.Text = se.FechaInicio.ToString();
                 lblfechaf.Text = se.FechaFin.ToString();
                 lblgps.Text    = se.IMEI.ToString();
                 lblplaca.Text  = se.NroPlaca.ToString();
             }
             else
             {
                 SitePrincipal.pagRedireccion   = "~/Vistas/Seguimiento/Index";
                 SitePrincipal.countRedireccion = 0;
                 Response.Redirect("~/Vistas/Empresas/Panel");
             }
         }
         else
         {
             Response.Redirect("~/Account/Login");
         }
     }
 }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            gpsCtrl         = new GpsController();
            vehiculoCtrl    = new VehiculoController();
            empresaCtrl     = new EmpresaController();
            seguimientoCtrl = new SeguimientoController();

            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    id = Request.QueryString["id"];
                    if (!String.IsNullOrEmpty(id))
                    {
                        lblid.Text = id;
                        var seg = seguimientoCtrl.listar(id);
                        lblfechai.Text = seg.FechaInicio.ToString();
                        lblfechaf.Text = seg.FechaFin.ToString();
                        lblestado.Text = seg.estado.ToString();
                        if (seg.estado == true)
                        {
                            lblestado.Text = "Activo";
                        }
                        else
                        {
                            lblestado.Text = "Inactivo";
                        }
                        lblfechareg.Text = seg.FechaReg.ToString();
                        lblusuareg.Text  = seg.UsuaReg;
                        if (!String.IsNullOrEmpty(seg.NIT))
                        {
                            var emp = empresaCtrl.listar(seg.NIT);
                            if (!String.IsNullOrEmpty(emp.NIT))
                            {
                                lblnite.Text    = emp.NIT;
                                lblrazonse.Text = emp.RazonSocial;
                                lblemaile.Text  = emp.email;
                            }
                        }
                        if (!String.IsNullOrEmpty(seg.IMEI))
                        {
                            var gp = gpsCtrl.listar(seg.IMEI);
                            if (!String.IsNullOrEmpty(gp.IMEI))
                            {
                                lblimeig.Text   = gp.IMEI;
                                lblidg.Text     = gp.ID;
                                lblmodelog.Text = gp.Modelo;
                            }
                        }
                        if (!String.IsNullOrEmpty(seg.NroPlaca))
                        {
                            var veh = vehiculoCtrl.listar(seg.NroPlaca);
                            if (!String.IsNullOrEmpty(veh.NroPlaca))
                            {
                                lblmodelov.Text = veh.Modelo;
                                lblplacav.Text  = veh.NroPlaca;
                                lblaniov.Text   = veh.Año.ToString();
                            }
                        }
                    }
                    else
                    {
                        Response.Redirect("~/Vistas/Seguimientos/Index");
                    }
                }
                else
                {
                    Response.Redirect("~/Account/Login");
                }
            }
        }