Exemple #1
0
        protected override void OnInit(EventArgs e)
        {
            if (Request.QueryString["color"] != null)
            {
                CreateImage();
                return;
            }
            base.OnInit(e);

            if (!IsPostBack)
            {
                var googleMapsEnabled = true;
                var usuario           = DAOFactory.UsuarioDAO.FindById(WebSecurity.AuthenticatedUser.Id);
                if (usuario != null && usuario.PorEmpresa && usuario.Empresas.Count == 1)
                {
                    var empresa = usuario.Empresas.First() as Empresa;
                    if (empresa != null)
                    {
                        googleMapsEnabled = empresa.GoogleMapsEnabled;
                    }
                }

                Monitor1.EnableTimer = false;
                Monitor1.Initialize(googleMapsEnabled);
                Monitor1.AddLayers(LayerFactory.GetVector(LayerRecorrido, true),
                                   LayerFactory.GetMarkers(LayerEntregas, true));
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var googleMapsEnabled = true;
                var usuario           = DAOFactory.UsuarioDAO.FindById(WebSecurity.AuthenticatedUser.Id);
                if (usuario != null && usuario.PorEmpresa && usuario.Empresas.Count == 1)
                {
                    var empresa = usuario.Empresas.First() as Empresa;
                    if (empresa != null)
                    {
                        googleMapsEnabled = empresa.GoogleMapsEnabled;
                    }
                }

                Monitor1.Initialize(googleMapsEnabled);
                Monitor1.AddLayers(LayerFactory.GetMarkers("Posicion", true));
            }
        }