Esempio n. 1
0
 public Estadia(Model.Session session, Model.Reserva reserva)
 {
     this._session = session;
     this._reserva = reserva;
     InitializeComponent();
     BindReserva();
 }
Esempio n. 2
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtCodigo.Text) || string.IsNullOrWhiteSpace(txtCodigo.Text))
                {
                    throw new ValidateException("El código no puede estar vacío.");
                }

                _result = GetResult();
                if (_result == null)
                {
                    BindReserva();
                    BindHabitaciones();
                }
                else
                {
                    string            message = "El código que ingreso no corresponde con ninguno en nuestro sistema. \n Vuelva a intentar.";
                    string            caption = "Reserva";
                    MessageBoxButtons buttons = MessageBoxButtons.OK;
                    MessageBox.Show(message, caption, buttons);
                }
            }
            catch (Exception ex)
            {
                string            message = ex.Message;
                string            caption = "Error de Validación";
                MessageBoxButtons buttons = MessageBoxButtons.OK;
                MessageBox.Show(message, caption, buttons);
            }
        }
Esempio n. 3
0
 public Reserva(Model.Session _session, Model.Reserva reserva)
 {
     this._session    = _session;
     this._editObject = reserva;
     InitializeComponent();
     InitValues();
     BindReserva();
 }
Esempio n. 4
0
 public Reserva(Session session, List <Pasaje> pasajes, Cliente cliente)
 {
     InitializeComponent();
     _session = session;
     Model.Reserva reserva = new Model.Reserva(0, Tools.GetDate(), false, cliente);
     reserva.Pasajes = pasajes;
     reserva.Codigo  = DAO.DAOFactory.ReservaDAO.CreateOrUpdate(reserva);
     lbCodigo.Text   = reserva.Codigo.ToString();
 }
Esempio n. 5
0
        private void btnReservar_Click(object sender, EventArgs e)
        {
            try
            {
                ValidateForm();
                var regimen = (Model.Regimen)cbRegimenes.SelectedValue;
                var hotel   = (Model.Hotel)cbHoteles.SelectedValue;

                var totalReserva = Decimal.Parse(txtTotalReserva.Text);

                if (_editObject == null || _editObject.Id == 0)
                {
                    _editObject = new Model.Reserva(0, _session.User, hotel, regimen, _cliente, Tools.GetDate(),
                                                    dtInicio.Value, dtFin.Value, totalReserva, null);
                }
                else
                {
                    _editObject.Hotel        = hotel;
                    _editObject.Regimen      = regimen;
                    _editObject.FechaInicio  = dtInicio.Value;
                    _editObject.FechaFin     = dtFin.Value;
                    _editObject.TotalReserva = totalReserva;
                }
                _editObject.Habitaciones = _habitaciones;

                var codigo = DAO.DAOFactory.ReservaDAO.SaveOrUpdate(_editObject, _session.User, Tools.GetDate());

                string message = "Su reserva ha sido guardada con éxito.\n Su código de reserva es : "
                                 + codigo + ". \nGuardelo para realizar el ingreso al hotel y realizar modificaciones.";
                string            caption = "Reserva " + codigo;
                MessageBoxButtons buttons = MessageBoxButtons.OK;
                var result = MessageBox.Show(message, caption, buttons);
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    Close();
                }
            }
            catch (Exception ex)
            {
                string            message = ex.Message;
                string            caption = "Error:";
                MessageBoxButtons buttons = MessageBoxButtons.OK;
                MessageBox.Show(message, caption, buttons);
            }
        }
Esempio n. 6
0
 public CancelarReserva(Model.Session session, Model.Reserva reserva)
 {
     _session = session;
     _reserva = reserva;
     InitializeComponent();
 }
Esempio n. 7
0
 public string GetParam(Model.Reserva param)
 {
     return(param != null && param.Codigo > 0 ? param.Codigo.ToString("0.00", CultureInfo.InvariantCulture) : "null");;
 }