Exemple #1
0
        public static string getDatos(string data = "")
        {
            string              result   = String.Empty;
            GpsController       gpsCtrl  = new GpsController();
            HomeController      homeCtrl = new HomeController();
            List <ListarAbmGPS> lista    = new List <ListarAbmGPS>();

            if (SitePrincipal.ExisteActiva())
            {
                var userName = HttpContext.Current.User.Identity.Name;
                var nit      = homeCtrl.obtenerNit(userName);

                lista = gpsCtrl.listarGps(nit);
            }
            else
            {
                if (HttpContext.Current.User.IsInRole("SA"))
                {
                    lista = gpsCtrl.listarGps();
                }
            }

            result = JsonConvert.SerializeObject(lista, Formatting.Indented);
            return(result);
        }
Exemple #2
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");
            }
        }
Exemple #3
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");
         }
     }
 }
    private void OnTriggerEnter(Collider other)
    {
        GpsController c = other.GetComponentInChildren <GpsController>();

        if (c != null)
        {
            c.SetDirection(setDirection);
        }
    }
Exemple #5
0
        public static string listarGpsPlaca(string data = "")
        {
            string                result   = String.Empty;
            GpsController         gpsCtrl  = new GpsController();
            HomeController        homeCtrl = new HomeController();
            List <ListarGPSPlaca> lista    = new List <ListarGPSPlaca>();

            var userName = HttpContext.Current.User.Identity.Name;
            var nit      = homeCtrl.obtenerNit(userName);

            lista = gpsCtrl.listarGpsPlaca(nit);

            result = JsonConvert.SerializeObject(lista, Formatting.Indented);
            return(result);
        }
Exemple #6
0
        public static string getIDButtonXId(int id = 0)
        {
            string         result   = String.Empty;
            GpsController  gpsCtrl  = new GpsController();
            HomeController homeCtrl = new HomeController();

            var userName = HttpContext.Current.User.Identity.Name;
            var nit      = homeCtrl.obtenerNit(userName);

            IDButtonController button = new IDButtonController();

            result = button.getIDButonXID(id);


            //result = JsonConvert.SerializeObject(data, Formatting.Indented);
            return(result);
        }
Exemple #7
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");
         }
     }
 }
Exemple #8
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");
         }
     }
 }
Exemple #9
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");
         }
     }
 }
//
//        /// <summary>
//        /// Gets the list of filters from settings
//        /// </summary>
//        /// <returns>The list of last use filters</returns>
//        public static Filter[] GetFilterList()
//        {
//            if(string.IsNullOrEmpty(Settings.Default.lastFilters)) return new Filter[0];
//            //The format is:
//            //<filterExpr>|<filterExpr>|<filterExpr>|etc.
//
//            try
//            {
//                string[] parts = Settings.Default.lastFilters.Split('|');
//                List<Filter> filters = new List<Filter>();
//                foreach (string s in parts)
//                {
//                    filters.Add(new Filter(s));
//                }
//                return filters.ToArray();
//            }
//            catch
//            {
//                return new Filter[0];
//            }
//        }
//
//        /// <summary>
//        /// Saves a list of filters to the last filters list
//        /// </summary>
//        /// <param name="filters">The filters to save</param>
//        public static void SaveFilterList(Filter[] filters)
//        {
//            if (filters != null && filters.Length > 0)
//            {
//                StringBuilder sbOut = new StringBuilder();
//                //The format is:
//                //<filterExpr>|<filterExpr>|<filterExpr>|etc.
//                try
//                {
//                    string pipe = "";
//                    foreach (Filter f in filters)
//                    {
//                        sbOut.Append(pipe);
//                        sbOut.Append(f.ToString());
//                        pipe = "|";
//                    }
//                }
//                catch (Exception)
//                {
//                    //No nothing.
//                }
//                Settings.Default.lastFilters = sbOut.ToString();
//            }
//            else
//            {
//                //Clear the last filters
//                Settings.Default.lastFilters = string.Empty;
//            }
//        }

        /// <summary>
        /// Saves settings from GPS Controller
        /// </summary>
        /// <param name="gps">The GPS Controler save settings for</param>
        public static void SaveGpsSettings(GpsController gps)
        {
            try
            {
                Settings.Default.gpsEnabled = gps.Enabled;
                if (!string.IsNullOrEmpty(gps.PortName))
                {
                    Settings.Default.gpsSerialPort = gps.PortName;
                }
                Settings.Default.gpsBaud      = gps.PortBaudrate;
                Settings.Default.gpsParity    = gps.PortParity;
                Settings.Default.gpsHandshake = gps.PortHandshake;
                Settings.Default.gpsDataBits  = gps.PortDataBits;
                Settings.Default.gpsStopBits  = gps.PortStopBits;
                Settings.Default.Save();
            }
            catch (Exception)
            {
                //Something went wrong saving settings, ignore
            }
        }
        /// <summary>
        /// Applies stored settings to the GPS Controller
        /// </summary>
        /// <param name="gps">The GPS Controler to apply settings to</param>
        public static void ApplyGpsSettings(GpsController gps)
        {
            try
            {
                gps.PortName      = Settings.Default.gpsSerialPort;
                gps.PortBaudrate  = Settings.Default.gpsBaud;
                gps.PortParity    = Settings.Default.gpsParity;
                gps.PortHandshake = Settings.Default.gpsHandshake;
                gps.PortDataBits  = Settings.Default.gpsDataBits;
                gps.PortStopBits  = Settings.Default.gpsStopBits;

                //Start GPS if it was last time
                if (Settings.Default.gpsEnabled && !string.IsNullOrEmpty(gps.PortName))
                {
                    gps.Start();
                }
            }
            catch (Exception)
            {
                //Something went wrong applying settings, ignore
            }
        }
Exemple #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            gps         = new GpsController();
            homeCtrl    = new HomeController();
            empresaCtrl = new EmpresaController();

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

            if (!IsPostBack)
            {
                if (!SitePrincipal.IsIntruso())
                {
                    //       listarEmpresa();
                }
                else
                {
                    this.Session.Remove("AllBehaviorsDS");
                    Response.Redirect("~/Account/Login");
                }
            }
        }
Exemple #13
0
        public bool Initialize(out Exception error)
        {
            error          = null;
            NetworkScanner = new NetworkScannerN();

            //Set new data handler
            NetworkScanner.NewNetworkDataEvent += NetworkScannerNewNetworkDataEvent;


            //GPS
            GpsControl = new GpsController();

            Logger = new GpxDataLogger {
                AutoSave = true, AutoSaveInterval = TimeSpan.FromSeconds(10)
            };

            //Null scanning
            _tNullScan.Elapsed += TNullScanElapsed;

            //Init the interface manager
            InterfaceManager.Instance.Init(out error);

            return(true);
        }
Exemple #14
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");
                }
            }
        }
Exemple #15
0
 public FormGpsCfg(GpsController control)
 {
     InitializeComponent();
     _gpsC = control;
 }