protected void rptrViajes_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "VerViaje")
        {
            try
            {
                int codViaje = Convert.ToInt32(((TextBox)e.Item.Controls[1]).Text);

                Viaje v = ServicioTerminal.BuscarViaje(codViaje);

                Session["ConsultaViaje"] = v;
                Response.Redirect("~/DetalleDeViaje.aspx");
            }
            catch (Exception ex) { lblMsj.Text = ex.Message; }
        }
    }
예제 #2
0
 private void txtNumero_Validating(object sender, CancelEventArgs e)
 {
     try
     {
         lblError.Text = "";
         ServicioTURU Sweb = new ServicioTURU();
         Viaje = Sweb.BuscarViaje(Convert.ToInt32(txtNumero.Text));
         if (Viaje is ViajesNacionales)
         {
             throw new Exception("Ese numero corresponde a un Viaje Nacional.");
         }
         Vinter = (ViajesInternacionales)Viaje;
         if (Vinter == null)
         {
             HabilitarAgregar();
         }
         else
         {
             HabilitarBajaModificar();
             txtAsientos.Text          = Vinter._CantidadAsientos.ToString();
             txtDocumentacion.Text     = Vinter._Documentacion;
             txtHoraArribo.Text        = Vinter._FechaArribo.ToShortTimeString();
             txtHoraPartida.Text       = Vinter._FechaPartida.ToShortTimeString();
             dtFechaArribo.Text        = Vinter._FechaArribo.ToShortDateString();
             dtFechaPartida.Text       = Vinter._FechaPartida.ToShortDateString();
             cbTerminales.Text         = Vinter._Ter._Codigo;
             cbCompanias.Text          = Vinter._Com._Nombre;
             chkServicioaBordo.Checked = Vinter._ServicioBordo;
         }
     }
     catch (System.Web.Services.Protocols.SoapException ex)
     {
         if (ex.Detail.InnerText.Length > 100)
         {
             lblError.Text = ex.Detail.InnerText.Substring(0, 100);
         }
         else
         {
             lblError.Text = ex.Detail.InnerText;
         }
     }
     catch (Exception ex)
     {
         lblError.Text = ex.Message;
     }
 }