protected void cbTipoReferenciaGeografica_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbTipoReferenciaGeografica.Selected <= 0)
            {
                return;
            }

            var tipo = DAOFactory.TipoReferenciaGeograficaDAO.FindById(cbTipoReferenciaGeografica.Selected);

            if (tipo.Icono != null)
            {
                SelectIcon2.Selected = tipo.Icono.Id;
                EditGeoRef1.SetIcono(Config.Directory.IconDir + tipo.Icono.PathIcono, tipo.Icono.Width, tipo.Icono.Height, tipo.Icono.OffsetX, tipo.Icono.OffsetY);
            }
            else
            {
                SelectIcon2.Selected = -1;
                EditGeoRef1.ClearIcono();
            }
            if (tipo.Color != null)
            {
                cpColor.Color     = tipo.Color.HexValue;
                EditGeoRef1.Color = tipo.Color.Color;
            }
            updColor.Update();
            updTipoGeoRef.Update();
            updSelectIcon.Update();
        }
        protected void Bind(ReferenciaGeografica georef)
        {
            IdGeoRef = georef != null ? georef.Id : -1;

            if (georef != null && georef.Icono != null)
            {
                SelectIcon2.Selected = georef.Icono.Id;
                EditGeoRef1.SetIcono(Config.Directory.IconDir + georef.Icono.PathIcono, georef.Icono.Width, georef.Icono.Height, georef.Icono.OffsetX, georef.Icono.OffsetY);
            }
            else
            {
                SelectIcon2.Selected = -1;
            }
            if (georef != null && georef.Color != null)
            {
                cpColor.Color     = georef.Color.HexValue;
                EditGeoRef1.Color = georef.Color.Color;
            }
            EditGeoRef1.Poligono  = georef != null ? georef.Poligono : null;
            EditGeoRef1.Direccion = georef != null ? georef.Direccion : null;

            if (georef != null)
            {
                cbTipoReferenciaGeografica.SetSelectedValue(georef.TipoReferenciaGeografica.Id);
            }
        }
 public void SetLinea(int idLinea)
 {
     if (!IsPostBack && idLinea > 0)
     {
         var linea = DAOFactory.LineaDAO.FindById(idLinea);
         if (linea.ReferenciaGeografica != null && linea.ReferenciaGeografica.Direccion != null)
         {
             EditGeoRef1.SetCenter(linea.ReferenciaGeografica.Direccion.Latitud,
                                   linea.ReferenciaGeografica.Direccion.Longitud);
         }
     }
 }
Exemple #4
0
        protected override void Bind()
        {
            cbEmpresa.SetSelectedValue(EditObject.Empresa != null ? EditObject.Empresa.Id:cbEmpresa.AllValue);
            cbLinea.SetSelectedValue(EditObject.Linea != null ? EditObject.Linea.Id : cbLinea.AllValue);
            cbTipoReferenciaGeografica.SetSelectedValue(EditObject.TipoReferenciaGeografica != null ? EditObject.TipoReferenciaGeografica.Id : cbTipoReferenciaGeografica.AllValue);
            txtCodigo.Text        = EditObject.Codigo;
            txtDescripcion.Text   = EditObject.Descripcion;
            txtObservaciones.Text = EditObject.Observaciones;

            if (EditObject.Icono != null)
            {
                SelectIcon2.Selected = EditObject.Icono.Id;
                EditGeoRef1.SetIcono(Config.Directory.IconDir + EditObject.Icono.PathIcono, EditObject.Icono.Width, EditObject.Icono.Height, EditObject.Icono.OffsetX, EditObject.Icono.OffsetY);
            }

            if (EditObject.Color != null)
            {
                cpColor.Color     = EditObject.Color.HexValue;
                EditGeoRef1.Color = EditObject.Color.Color;
            }

            chkIgnoraLogiclink.Checked   = EditObject.IgnoraLogiclink;
            chkControlaVelocidad.Checked = EditObject.TipoReferenciaGeografica.ControlaVelocidad;
            chkControlaES.Checked        = EditObject.TipoReferenciaGeografica.ControlaEntradaSalida;
            chkZonaRiesgo.Checked        = EditObject.TipoReferenciaGeografica.EsZonaDeRiesgo;
            chkInhibeAlarma.Checked      = EditObject.InhibeAlarma;
            chkInicio.Checked            = EditObject.EsInicio;
            chkIntermedio.Checked        = EditObject.EsIntermedio;
            chkFin.Checked        = EditObject.EsFin;
            EditGeoRef1.Poligono  = EditObject.Poligono;
            EditGeoRef1.Direccion = EditObject.Direccion;

            if (EditObject.Vigencia != null)
            {
                if (EditObject.Vigencia.Inicio.HasValue)
                {
                    txtFechaDesde.SelectedDate = EditObject.Vigencia.Inicio.Value.ToDisplayDateTime();
                }

                if (EditObject.Vigencia.Fin.HasValue)
                {
                    txtFechaHasta.SelectedDate = EditObject.Vigencia.Fin.Value.ToDisplayDateTime();
                }
            }

            BindVelocidades();

            panelVelocidades.Visible = EditObject.TipoReferenciaGeografica.ControlaVelocidad;
        }
Exemple #5
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (IsPostBack || cbLinea.Selected <= 0)
            {
                return;
            }

            var linea = DAOFactory.LineaDAO.FindById(cbLinea.Selected);

            if (linea.ReferenciaGeografica != null && linea.ReferenciaGeografica.Direccion != null)
            {
                EditGeoRef1.SetCenter(linea.ReferenciaGeografica.Direccion.Latitud, linea.ReferenciaGeografica.Direccion.Longitud);
            }
        }
Exemple #6
0
        protected void cbTipoReferenciaGeografica_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbTipoReferenciaGeografica.Selected <= 0)
            {
                return;
            }

            var tipo = DAOFactory.TipoReferenciaGeograficaDAO.FindById(cbTipoReferenciaGeografica.Selected);

            if (tipo.Icono != null)
            {
                SelectIcon2.Selected = tipo.Icono.Id;
                EditGeoRef1.SetIcono(Config.Directory.IconDir + tipo.Icono.PathIcono, tipo.Icono.Width, tipo.Icono.Height, tipo.Icono.OffsetX, tipo.Icono.OffsetY);
            }
            else
            {
                SelectIcon2.Selected = -1;
                EditGeoRef1.ClearIcono();
            }

            if (tipo.Color != null)
            {
                cpColor.Color     = tipo.Color.HexValue;
                EditGeoRef1.Color = tipo.Color.Color;
            }

            chkControlaVelocidad.Checked = tipo.ControlaVelocidad;
            chkControlaES.Checked        = tipo.ControlaEntradaSalida;
            chkZonaRiesgo.Checked        = tipo.EsZonaDeRiesgo;
            chkInhibeAlarma.Checked      = tipo.InhibeAlarma;
            chkInicio.Checked            = tipo.EsInicio;
            chkIntermedio.Checked        = tipo.EsIntermedio;
            chkFin.Checked = tipo.EsFin;

            panelVelocidades.Visible = chkControlaVelocidad.Checked;
            BindTiposVehiculo();
            GetVelocidadesParent();

            updComportamiento.Update();
        }
 protected void btBorrarPunto_Click(object sender, EventArgs e)
 {
     EditGeoRef1.BorrarDireccion();
 }
 protected void btBorrarPoly_Click(object sender, EventArgs e)
 {
     EditGeoRef1.BorrarGeocerca();
 }
        protected void SelectIcon2_SelectedIconChange(object sender, EventArgs e)
        {
            var icono = DAOFactory.IconoDAO.FindById(SelectIcon2.Selected);

            EditGeoRef1.SetIcono(Config.Directory.IconDir + icono.PathIcono, icono.Width, icono.Height, icono.OffsetX, icono.OffsetY);
        }
Exemple #10
0
 protected void SelectIcon2_SelectedIconChange(object sender, EventArgs e)
 {
     EditGeoRef1.SetIcono(SelectIcon2.Selected);
 }