コード例 #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);
                }
            }
        }
コード例 #2
0
        private void LoadPositions(bool center)
        {
            var par = new Parameters
            {
                Empresa  = Distrito.Get(),
                Linea    = Location.Get(),
                Chofer   = Chofer.Get(),
                Vehiculo = Mobile.Get(),
                Desde    = InitialDate.Get(),
                Hasta    = FinalDate.Get(),
                TiposPoi = PoisTypesIds.Get().ToArray()
            };

            Monitor.ExecuteScript(string.Format("CallForData('{0}', {1});", par.Serialize(), center ? "true" : "false"));
        }
コード例 #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);
                }
            }
        }