Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     gpsCtrl     = new GpsController();
     empresaCtrl = new EmpresaController();
     if (!IsPostBack)
     {
         if (!SitePrincipal.IsIntruso())
         {
             imei = Request.QueryString["imei"];
             if (!String.IsNullOrEmpty(imei))
             {
                 lblimei.Text = imei;
                 GPS g = gpsCtrl.listar(imei);
                 lblid.Text         = g.ID;
                 lblmodelo.Text     = g.Modelo;
                 lbltelefono.Text   = g.NroTelefono.ToString();
                 lblusuarioreg.Text = g.UsuaReg.ToString();
                 lblfechareg.Text   = g.FechaReg.ToString();
             }
             else
             {
                 Response.Redirect("~/Vistas/GPSs/Index");
             }
         }
         else
         {
             Response.Redirect("~/Account/Login");
         }
     }
 }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     control = new GpsController();
     if (!IsPostBack)
     {
         if (!SitePrincipal.IsIntruso())
         {
             if (SitePrincipal.ExisteActiva())
             {
                 string imei = Request.QueryString["imei"];
                 if (!String.IsNullOrEmpty(imei))
                 {
                     txtimei.Text = imei;
                     GPS g = control.listar(imei);
                     if (g.Estado.Value)
                     {
                         txtid.Text = g.ID;
                         cbomodelo.SelectedValue = g.Modelo;
                         txttelefono.Text        = g.NroTelefono.ToString();
                     }
                     else
                     {
                         MensajeAlerta("El GPSs ya ha sido dado de baja");
                         Response.Redirect("~/Vistas/GPSs/Index");
                     }
                 }
                 else
                 {
                     MensajeAlerta("Informacion: Datos Invalidos");
                     Response.Redirect("~/Vistas/GPSs/Index");
                 }
             }
             else
             {
                 SitePrincipal.pagRedireccion = "~/Vistas/GPSs/Edit";
                 Response.Redirect("~/Vistas/Empresas/Panel");
             }
         }
         else
         {
             Response.Redirect("~/Account/Login");
         }
     }
 }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     control  = new GpsController();
     homeCtrl = new HomeController();
     if (!IsPostBack)
     {
         if (!SitePrincipal.IsIntruso())
         {
             if (SitePrincipal.ExisteActiva())
             {
                 imei = Request.QueryString["imei"];
                 if (!String.IsNullOrEmpty(imei))
                 {
                     lblimei.Text = imei;
                     GPS g = control.listar(imei);
                     if (g.Estado.Value)
                     {
                         lblid.Text       = g.ID;
                         lblmodelo.Text   = g.Modelo;
                         lbltelefono.Text = g.NroTelefono.ToString();
                     }
                     else
                     {
                         lblid.Text       = g.ID;
                         lblmodelo.Text   = g.Modelo;
                         lbltelefono.Text = g.NroTelefono.ToString();
                         //MensajeAlerta("El GPSs ya ha sido dado de baja");
                         //Response.Redirect("~/Vistas/GPSs/Index");
                     }
                 }
             }
             else
             {
                 SitePrincipal.pagRedireccion = "~/Vistas/GPSs/Delete";
                 Response.Redirect("~/Vistas/Empresas/Panel");
             }
         }
         else
         {
             Response.Redirect("~/Account/Login");
         }
     }
 }
Exemplo n.º 4
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");
                }
            }
        }