Ejemplo n.º 1
0
        private void btn_finalizarCliente_Click(object sender, EventArgs e)
        {
            var cliente = new src.Tools.Objects.Cliente
            {
                ID   = _clientes.ElementAt(_index).ID,
                Curp = _clientes.ElementAt(_index).Curp
            };
            var          habitacion = DataBase.getHabitacion(_clientes.ElementAt(_index).Habitacion);
            ClienteFecha fecha      = new ClienteFecha(cliente, habitacion, this);

            fecha.Show();
        }
Ejemplo n.º 2
0
 private void btn_registrarCliente_Click(object sender, EventArgs e)
 {
     try
     {
         src.Tools.Objects.Cliente cliente = new src.Tools.Objects.Cliente
         {
             Nombre = txt_nombre.Text,
             Apepat = txt_apepat.Text,
             Apemat = txt_apemat.Text,
             Curp   = txt_curp.Text,
         };
         if (DataBase.InsertCliente(cliente))
         {
             cliente = DataBase.getCliente(cliente);
             var fecha = DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day;
             src.Tools.Objects.Historial historial = new src.Tools.Objects.Historial
             {
                 Cliente     = cliente.ID,
                 Personal    = UsuarioCache.ID,
                 Habiacion   = _habitaciones.ElementAt(cb_hsbitacion.SelectedIndex).ID,
                 PagoDia     = _habitaciones.ElementAt(cb_hsbitacion.SelectedIndex).Precio,
                 MontoTotal  = 0,
                 FechaInicio = DateTime.Today
             };
             if (DataBase.InsertHistorial(historial))
             {
                 _habitaciones.ElementAt(cb_hsbitacion.SelectedIndex).Estatus = Cadenas.OCUPADO;
                 if (DataBase.updateHabitaciones(_habitaciones.ElementAt(cb_hsbitacion.SelectedIndex)))
                 {
                     MessageBox.Show("El cliente ha sido registrado");
                 }
                 llenarHabitaciones();
                 llenarTablaClientes();
             }
         }
     }
     catch (HoteleraException ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }