Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            homeCtrl    = new HomeController();
            personaCtrl = new PersonaController();
            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    if (SitePrincipal.ExisteActiva())
                    {
                        ci = Request.QueryString["ci"];
                        if (!String.IsNullOrEmpty(ci))
                        {
                            lblCi.Text = ci;
                            Persona p = personaCtrl.listar(ci);

                            if (p.Estado)
                            {
                                lblnombre.Text    = p.Nombre;
                                lblapellidop.Text = p.ApellidoP;
                                lblapellidom.Text = p.ApellidoM;
                                lbldireccion.Text = p.Direccion;
                                lbltelefono.Text  = p.Telefono;
                                lblemail.Text     = p.Email;
                                lblcontacto.Text  = p.Contacto;
                                lbltelefonoc.Text = p.TelfContacto;
                                lbllicencia.Text  = p.CategoriaL;
                            }
                            else
                            {
                                MensajeAlerta("El personal ya ha sido dado de baja");
                                Response.Redirect("~/Vistas/Personas/Index");
                            }
                        }
                        else
                        {
                            Response.Redirect("~/Vistas/Personas/Index");
                        }
                    }
                    else
                    {
                        SitePrincipal.pagRedireccion   = "~/Vistas/Personas/Index";
                        SitePrincipal.countRedireccion = 0;
                        Response.Redirect("~/Vistas/Empresas/Panel");
                    }
                }
                else
                {
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            rolCtrl = new RolController();

            if (!SitePrincipal.IsIntruso())
            {
                CargarNiveles();
            }
            else
            {
                Response.Redirect("~/Account/Login");
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            homeCtrl  = new HomeController();
            zonasCtrl = new ZonasController();

            if (!IsPostBack)
            {
                if (SitePrincipal.IsIntruso())
                {
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!SitePrincipal.IsIntruso())
         {
         }
         else
         {
             Response.Redirect("~/Account/Login");
         }
     }
 }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vehiculoCtrl = new VehiculoController();
            empresaCtrl  = new EmpresaController();

            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    placa = Request.QueryString["placa"];
                    if (!String.IsNullOrEmpty(placa))
                    {
                        var ve = vehiculoCtrl.listar(placa);
                        lblplaca.Text      = ve.NroPlaca;
                        lblanio.Text       = ve.Año.ToString();
                        lblpatente.Text    = ve.Patente.ToString();
                        lblchasis.Text     = ve.NroChasis.ToString();
                        lblfechareg.Text   = ve.FechaReg.ToShortDateString();
                        lblmodelo.Text     = ve.Modelo;
                        lblmotor.Text      = ve.NroMotor;
                        lblusuarioreg.Text = ve.UsuaReg;
                        //string idempresa = ve.idempresa;
                        //if (!String.IsNullOrEmpty(idempresa))
                        //{
                        //    var empresa = empresaCtrl.listar(idempresa);
                        //    lblnite.Text = empresa.NIT;
                        //    lblrazonse.Text = empresa.RazonSocial;
                        //    lblemaile.Text = empresa.email;
                        //}
                        string nroplaca = ve.NroPlaca;
                        if (!String.IsNullOrEmpty(nroplaca))
                        {
                            //var empresa = empresaCtrl.listar(idempresa);
                            var empresa = empresaCtrl.getEmpresaXNroPlaca(nroplaca);
                            lblnite.Text    = empresa.NIT;
                            lblrazonse.Text = empresa.RazonSocial;
                            lblemaile.Text  = empresa.email;
                        }
                    }
                    else
                    {
                        Response.Redirect("~/Vistas/Vehiculos/Index");
                    }
                }
                else
                {
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Beispiel #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!SitePrincipal.IsIntruso())
         {
             //       listarEmpresa();
         }
         else
         {
             this.Session.Remove("AllBehaviorsDS");
             Response.Redirect("~/Account/Login");
         }
     }
 }
Beispiel #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     zonasCtrl = new ZonasController();
     homeCtrl  = new HomeController();
     if (!IsPostBack)
     {
         if (!SitePrincipal.IsIntruso())
         {
             ListarGeocercaxEmpresa(txtsearchgeocerca.Text);
         }
         else
         {
             Response.Redirect("~/Account/Login");
         }
     }
 }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            privilegioCtrl = new PrivilegioController();

            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    CargarPrivilegio();
                }
                else
                {
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            personaCtrl = new PersonaController();
            rolCtrl     = new RolController();
            usuarioCtrl = new UsuarioController();

            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    if (SitePrincipal.ExisteActiva())
                    {
                        string ci = Request.QueryString["ci"];
                        if (!String.IsNullOrEmpty(ci))
                        {
                            var resultd = personaCtrl.listar(ci);
                            if (resultd.Estado)
                            {
                                cargarTipoPersona();
                                CargarPersona();
                                CargarRoles();
                            }
                            else
                            {
                                MensajeAlerta("El personal ya ha sido dado de baja");
                                Response.Redirect("~/Vistas/Personas/Index");
                            }
                        }
                        else
                        {
                            Response.Redirect("~/Vistas/Personas/Index");
                        }
                    }
                    else
                    {
                        SitePrincipal.pagRedireccion   = "~/Vistas/Personas/Edit";
                        SitePrincipal.countRedireccion = 0;
                        Response.Redirect("~/Vistas/Empresas/Panel");
                    }
                }
                else
                {
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Beispiel #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            alarmaCtrl = new AlarmaController();
            homeCtrl   = new HomeController();

            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    //cargar
                }
                else
                {
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Beispiel #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            empresaCtrl = new EmpresaController();

            if (!SitePrincipal.IsIntruso())
            {
                if (!User.IsInRole("SA"))
                {
                    Response.Redirect("~/Vistas/Empresas/Index");
                }
                //else
                //    listarEmpresa();
            }
            else
            {
                Response.Redirect("~/Account/Login");
            }
        }
Beispiel #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vehiculoCtrl = new VehiculoController();
            homeCtrl     = new HomeController();
            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    if (SitePrincipal.ExisteActiva())
                    {
                        cargarTipoVehiculo();
                        cargarMarca();

                        string placa = Request.QueryString["placa"];
                        if (!String.IsNullOrEmpty(placa))
                        {
                            txtplaca.Text = placa;
                            var ve = vehiculoCtrl.listar(placa);
                            txtplaca.Text          = ve.NroPlaca;
                            txtpatente.Text        = ve.Patente;
                            txtmotor.Text          = ve.NroMotor;
                            txtmodelo.Text         = ve.Modelo;
                            txtchasis.Text         = ve.NroChasis;
                            txtanio.Text           = Convert.ToString(ve.Año);
                            cbomarca.SelectedValue = ve.CodMarca.ToString();
                            cbotipov.Text          = ve.CodTipoV.ToString();
                        }
                        else
                        {
                            Response.Redirect("~/Vistas/Vehiculos/Index");
                        }
                    }
                    else
                    {
                        SitePrincipal.pagRedireccion = "~/Vistas/Vehiculos/Edit";
                        Response.Redirect("~/Vistas/Empresas/Panel");
                    }
                }
                else
                {
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Beispiel #13
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");
         }
     }
 }
Beispiel #14
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");
         }
     }
 }
Beispiel #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            usuarioCtrl = new UsuarioController();
            rolCtrl     = new RolController();

            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    CargarUsuario();
                    CargarPersonas();
                    CargarRoles();
                }
                else
                {
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Beispiel #16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!SitePrincipal.IsIntruso())
         {
             if (SitePrincipal.ExisteActiva())
             {
             }
             else
             {
                 Response.Redirect("~/Vistas/Empresas/Panel");
             }
         }
         else
         {
             Response.Redirect("~/Account/Login");
         }
     }
 }
Beispiel #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     negocio  = new GpsController();
     homeCtrl = new HomeController();
     if (!IsPostBack)
     {
         if (!SitePrincipal.IsIntruso())
         {
             if (!SitePrincipal.ExisteActiva())
             {
                 SitePrincipal.pagRedireccion = "~/Vistas/GPSs/Create";
                 Response.Redirect("~/Vistas/Empresas/Panel");
             }
         }
         else
         {
             Response.Redirect("~/Account/Login");
         }
     }
 }
Beispiel #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            rolCtrl = new RolController();
            string userName = HttpContext.Current.User.Identity.Name;

            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    dpdRoles.DataValueField = "Id";
                    dpdRoles.DataTextField  = "Name";
                    dpdRoles.DataSource     = rolCtrl.GetAll(userName);
                    dpdRoles.DataBind();
                }
                else
                {
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Beispiel #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            usuarioCtrl = new UsuarioController();
            homeCtrl    = new HomeController();

            //((WebScriptManager)ScriptManager.GetCurrent(this.Page)).InfragisticsCDN.EnableCDN = DefaultableBoolean.True;
            //this.WebDataGrid1.DataSource = this.GetDataSource();

            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    //CargardetalleUsuario();
                }
                else
                {
                    this.Session.Remove("AllBehaviorsDS");
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Beispiel #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     vehiculoCtrl = new VehiculoController();
     if (!IsPostBack)
     {
         if (!SitePrincipal.IsIntruso())
         {
             if (SitePrincipal.ExisteActiva())
             {
                 CargarVehiculo();
                 CargarConductores();
             }
             else
             {
                 SitePrincipal.pagRedireccion = "~/Vistas/Vehiculos/AsignConductor";
                 Response.Redirect("~/Vistas/Empresas/Panel");
             }
         }
         else
         {
             Response.Redirect("~/Vistas/Account/Login");
         }
     }
 }
Beispiel #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            homeCtrl  = new HomeController();
            zonasCtrl = new ZonasController();

            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    if (SitePrincipal.ExisteActiva())
                    {
                        string CodTipoGEO = Request.QueryString["CodTipoGEO"];
                        if (!String.IsNullOrEmpty(CodTipoGEO))
                        {
                            int cod = Convert.ToInt32(CodTipoGEO);
                            txtID.Text = CodTipoGEO;
                            var tipogeocerca = zonasCtrl.ObtenerTipoGeocercaID(cod);
                            Descripcion.Text = tipogeocerca.Descripcion;
                        }
                        else
                        {
                            Response.Redirect("~/Vistas/TipoGeocerca/Index");
                        }
                    }
                    else
                    {
                        SitePrincipal.pagRedireccion = "~/Vistas/TipoGeocerca/Index";
                        Response.Redirect("~/Vistas/Empresas/Panel");
                    }
                }
                else
                {
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Beispiel #22
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");
                }
            }
        }