Exemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            Monitor.ContextMenuPostback += Monitor_ContextMenuPostback;
            chkQtree.Visible             = WebSecurity.IsSecuredAllowed(Securables.ViewQtree);

            base.OnLoad(e);

            if (!IsPostBack)
            {
                this.RegisterCss(ResolveUrl("~/App_Styles/openlayers.css"));
                RegisterExtJsStyleSheet();

                dtDesde.SelectedDate = InitialDate.Get().ToDisplayDateTime();
                dtHasta.SelectedDate = FinalDate.Get().ToDisplayDateTime();
                WestPanel.Enabled    = !LockFilters.Get();
                dtDesde.Enabled      = !LockFilters.Get();
                dtHasta.Enabled      = !LockFilters.Get();
                if (Distrito.Get() > 0)
                {
                    ddlDistrito.SetSelectedValue(Distrito.Get());
                }
                if (Location.Get() > 0)
                {
                    ddlPlanta.SetSelectedValue(Location.Get());
                }
                if (Chofer.Get() > 0)
                {
                    ddlEmpleado.SetSelectedValue(Chofer.Get());
                }
                if (TypeMobile.Get() > 0)
                {
                    ddlTipoVehiculo.SetSelectedValue(TypeMobile.Get());
                }
                if (Mobile.Get() > 0)
                {
                    ddlMovil.SetSelectedValue(Mobile.Get());
                }

                foreach (var id in PoisTypesIds.Get())
                {
                    var it = lbPuntosDeInteres.Items.FindByValue(id.ToString());
                    if (it != null)
                    {
                        it.Selected = true;
                    }
                }
                PoisTypesIds.Set(lbPuntosDeInteres.SelectedValues);

                InitializeMap();
                if (Mobile.Get() > 0)
                {
                    LoadPositions(true);
                }
            }
        }
Exemplo n.º 2
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Distrito.Set(ddlDistrito.Selected);
            Location.Set(ddlPlanta.Selected);
            Chofer.Set(ddlEmpleado.Selected);
            Mobile.Set(ddlMovil.Selected);
            InitialDate.Set(SecurityExtensions.ToDataBaseDateTime(dtDesde.SelectedDate.Value));
            FinalDate.Set(SecurityExtensions.ToDataBaseDateTime(dtHasta.SelectedDate.Value));
            PoisTypesIds.Set(lbPuntosDeInteres.SelectedValues);

            var deltaTime = FinalDate.Get().Subtract(InitialDate.Get());

            if (deltaTime > dtvalidator.MaxRange)
            {
                ShowError("El rango de tiempo debe ser menor o igual a " + dtvalidator.MaxRange.ToString());
                return;
            }
            LoadPositions(true);
        }
Exemplo n.º 3
0
        protected override void OnLoad(EventArgs e)
        {
            Monitor.ContextMenuPostback += Monitor_ContextMenuPostback;

            LoadQtreeInfo();

            base.OnLoad(e);

            var empresa  = DAOFactory.EmpresaDAO.FindById(ddlDistrito.Selected);
            var maxHours = empresa != null && empresa.Id > 0 ? empresa.MaxHorasMonitor : 24;

            dtvalidator.MaxRange = new TimeSpan(maxHours, 0, 0);

            if (!IsPostBack)
            {
                this.RegisterCss(ResolveUrl("~/App_Styles/openlayers.css"));
                RegisterExtJsStyleSheet();

                dtDesde.SelectedDate = InitialDate.Get().ToDisplayDateTime();
                dtHasta.SelectedDate = FinalDate.Get().ToDisplayDateTime();
                WestPanel.Enabled    = !LockFilters.Get();
                dtDesde.Enabled      = !LockFilters.Get();
                dtHasta.Enabled      = !LockFilters.Get();
                if (Distrito.Get() > 0)
                {
                    ddlDistrito.SetSelectedValue(Distrito.Get());
                }
                if (Location.Get() > 0)
                {
                    ddlPlanta.SetSelectedValue(Location.Get());
                }
                if (Chofer.Get() > 0)
                {
                    ddlEmpleado.SetSelectedValue(Chofer.Get());
                }
                if (TypeMobile.Get() > 0)
                {
                    ddlTipoVehiculo.SetSelectedValue(TypeMobile.Get());
                }
                if (Mobile.Get() > 0)
                {
                    ddlMovil.SetSelectedValue(Mobile.Get());
                }

                foreach (var id in PoisTypesIds.Get())
                {
                    var it = lbPuntosDeInteres.Items.FindByValue(id.ToString());
                    if (it != null)
                    {
                        it.Selected = true;
                    }
                }
                PoisTypesIds.Set(lbPuntosDeInteres.SelectedValues);

                InitializeMap();
                if (Mobile.Get() > 0)
                {
                    LoadPositions(true);
                }
            }
        }