Created
July 2, 2015 21:34
-
-
Save Fhernd/986325a26d5eb9a09441 to your computer and use it in GitHub Desktop.
Diálogo `DialogoDetallesPasajero`.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ===++=== | |
// | |
// OrtizOL - xCSw | |
// | |
// Proyecto: Cupi2.NET | |
// | |
// ===--=== | |
/*============================================================ | |
// | |
// Clase(s): DialogoDetallesPasajero. | |
// | |
// Propósito: Representar diálogo de detalles de un pasajero. | |
// | |
// Original: http://cupi2.uniandes.edu.co/sitio/index.php/cursos/apo1/nivel-3/avion/visualizacion-codigo/ventanadatospasajero | |
// | |
============================================================*/ | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
using ElAvión.Modelo; | |
namespace ElAvión.GUI | |
{ | |
/// <summary> | |
/// Clase que representa el diálogo de detalles de un pasajero. | |
/// </summary> | |
public partial class DialogoDetallesPasajero : Form | |
{ | |
#region Constructors | |
/// <summary> | |
/// Crea un nuevo diálogo de visualización de los detalles de un pasajero. | |
/// </summary> | |
/// <param name="silla">Silla con datos del pasajero.</param> | |
public DialogoDetallesPasajero(Silla silla) | |
{ | |
InitializeComponent(); | |
Pasajero pasajero = silla.Pasajero; | |
// Carga información en los campos: | |
txtCedula.Text = pasajero.Cedula.ToString(); | |
txtNombre.Text = pasajero.Nombre; | |
txtSilla.Text = silla.Numero.ToString(); | |
txtClase.Text = silla.Clase == Clase.Economica ? "Económica" : "Ejecutiva"; | |
txtUbicacion.Text = silla.Ubicacion == UbicacionSilla.Ventana ? "Ventana" : silla.Ubicacion == UbicacionSilla.Pasillo ? "Pasillo" : "Central"; | |
} | |
#endregion | |
#region | |
/// <summary> | |
/// Activa la finalización de la visualización de los detalles del pasajero. | |
/// </summary> | |
/// <param name="sender">Generador del evento.</param> | |
/// <param name="e">Argumentos del evento.</param> | |
private void btnAceptar_Click(object sender, EventArgs e) | |
{ | |
this.DialogResult = System.Windows.Forms.DialogResult.OK; | |
} | |
#endregion | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment