示例#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);
        }
示例#2
0
        public void ListarIMEI()
        {
            var user = HttpContext.Current.User.Identity.Name;
            var nit  = homeCtrl.obtenerNit(user);

            cboimei.DataSource     = gpsCtrl.listarGps(nit);
            cboimei.DataTextField  = "IMEI";
            cboimei.DataValueField = "IMEI";
            cboimei.DataBind();
        }