Пример #1
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (!IsPostBack)
     {
         if (!SetCenterLinea())
         {
             EditLine1.SetCenter(-34.6134981326759, -58.4255323559046);
         }
     }
 }
Пример #2
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);
            txtCodigo.Text = EditObject.Codigo;
            txtNombre.Text = EditObject.Nombre;
            txtDesvio.Text = EditObject.Desvio.ToString(CultureInfo.InvariantCulture);

            var points = EditObject.Detalles.Select(detalle => new PointF((float)detalle.Longitud, (float)detalle.Latitud)).ToList();

            EditLine1.SetLine(points);

            if (points.Count > 0)
            {
                EditLine1.SetCenter(points[0].Y, points[0].X);
            }
        }
Пример #3
0
        protected bool SetCenterLinea()
        {
            if (cbLinea.Selected <= 0)
            {
                return(false);
            }
            var l = DAOFactory.LineaDAO.FindById(cbLinea.Selected);

            if (l.ReferenciaGeografica == null || (l.ReferenciaGeografica.Direccion == null && l.ReferenciaGeografica.Poligono == null))
            {
                return(false);
            }

            var lat = l.ReferenciaGeografica.Direccion != null ? l.ReferenciaGeografica.Direccion.Latitud : l.ReferenciaGeografica.Poligono.Centro.Y;
            var lon = l.ReferenciaGeografica.Direccion != null ? l.ReferenciaGeografica.Direccion.Longitud : l.ReferenciaGeografica.Poligono.Centro.X;

            EditLine1.SetCenter(lat, lon);
            return(true);
        }
Пример #4
0
 protected void btLimpiar_Click(object sender, EventArgs e)
 {
     EditLine1.Clear();
 }
Пример #5
0
 protected void btInvertir_Click(object sender, EventArgs e)
 {
     EditLine1.Invertir();
 }
Пример #6
0
 protected void cbViajeProgSelectedIndexChanged(object sender, EventArgs e)
 {
     EditLine1.DrawViajeProgramado(cbViajeProg.Selected);
 }