Esempio n. 1
0
        private List <KeyValuePair <int, string> > CargarGeocercas()
        {
            ZonasController       zonasCtrl = new ZonasController();
            List <GeocercaCboDet> geocercas = new List <GeocercaCboDet>();

            if (!User.IsInRole("SA") || SitePrincipal.ExisteActiva())
            {
                var userName = User.Identity.Name;
                var nit      = homeCtrl.obtenerNit(userName);

                geocercas = zonasCtrl.GetAll(nit);
            }
            else
            {
                geocercas = zonasCtrl.GetAll();
            }


            List <KeyValuePair <int, string> > datos = new List <KeyValuePair <int, string> >();

            foreach (var geo in geocercas)
            {
                datos.Add(new KeyValuePair <int, string>(geo.CodigoGEO, geo.Descripcion));
            }
            return(datos);
        }
Esempio n. 2
0
        private void CargarGeocercas()
        {
            if (!User.IsInRole("SA") || SitePrincipal.ExisteActiva())
            {
                userName = User.Identity.Name;
                nit      = homeCtrl.obtenerNit(userName);

                geocercas = zonasCtrl.GetAll(nit);
            }
            else
            {
                geocercas = zonasCtrl.GetAll();
            }

            //geocercas.Insert(0, new GeocercaCboDet { CodigoGEO = 0, Descripcion = "Todas" });

            gdvGeocercas.DataSource = geocercas;
            gdvGeocercas.DataBind();
        }