private void botonModificar_Click(object sender, EventArgs e) { if (textReserva.Text == "") { showToolTip("Ingrese un número de Reserva.", textReserva, textReserva.Location); return; } Reserva reserva = DAOReserva.obtener(Int32.Parse(textReserva.Text)); if (reserva == null) { showToolTip("Número de Reserva inválido. Ingrese su número nuevamente.", textReserva, textReserva.Location); return; } if (reserva.Estado == 6) { showToolTip("Reserva ya efectivizada. No es posible modificarla.", textReserva, textReserva.Location); return; } if (reserva.Estado > 2) { showToolTip("Reserva cancelada. No es posible modificarla.", textReserva, textReserva.Location); return; } new ModificarReserva(reserva).Show(); this.Dispose(); }
private void botonBuscar_Click(object sender, EventArgs e) { limpiar(); if (textEstadia.Text == "") { showToolTip("Ingrese un número de reserva.", textEstadia, textEstadia.Location); return; } reserva_seleccionada = DAOReserva.obtener(Int32.Parse(textEstadia.Text)); if (reserva_seleccionada == null) { showToolTip("Ingrese un número de reserva válido.", textEstadia, textEstadia.Location); return; } //DAOReserva if (reserva_seleccionada.Estado > 2 && reserva_seleccionada.Estado < 6) { MessageBox.Show("La reserva seleccionada se encuentra cancelada.", "", MessageBoxButtons.OK); return; } datos_huesped = DAOHuesped.obtener(reserva_seleccionada.Huesped); textHuesped.Text = datos_huesped.Nombre + " " + datos_huesped.Apellido; textFecReserva.Text = reserva_seleccionada.Fecha_Reserva_struct.Value.ToShortDateString(); textFecInicio.Text = reserva_seleccionada.Fecha_Inicio_struct.Value.ToShortDateString(); textFecFin.Text = reserva_seleccionada.Fecha_Fin_struct.Value.ToShortDateString(); }
private void reservar(int cantHab, Tipo_Habitacion tipo_seleccionado) { Reserva reserva = new Reserva(); reserva.CodigoRegimen = regimen_elegido.CodRegimen; reserva.Fecha_Inicio_struct = dateTimeEntrada.Value; reserva.Fecha_Fin_struct = dateTimeSalida.Value; reserva.Fecha_Reserva_struct = Globals.getFechaSistema(); reserva.Usr = Globals.infoSesion.User.Usr; reserva.cantHabitaciones = cantHab; reserva.tipo_habitacion = tipo_seleccionado; List <Habitacion> habitaciones_disponibles; habitaciones_disponibles = DAOReserva.habitacionDisponibles(Globals.infoSesion.Hotel.CodHotel, tipo_seleccionado.TipoCodigo, reserva.Fecha_Inicio, reserva.Fecha_Fin); if (habitaciones_disponibles.Count < cantHab) { DialogResult dr = MessageBox.Show("No existen suficientes habitaciones disponibles para efectuar la reserva.", "", MessageBoxButtons.OK); return; } for (int i = 0; i < cantHab; i++) { Detalle_Reserva det = new Detalle_Reserva(); det.CodigoHotel = Globals.infoSesion.Hotel.CodHotel; det.Habitacion = habitaciones_disponibles[i].Id_Habitacion; reserva.detalles_reserva.Add(det); } new ConfirmarReserva(reserva).Show(); Globals.deshabilitarAnterior(this); }
static void Main(string[] args) { Application.Run(new WINFORMS.Login()); // conexion funcionando DAOProfesional daop = new DAOProfesional(); DAOHorario daoh = new DAOHorario(); DAOConsultorio daoc = new DAOConsultorio(); DAOPersona daope = new DAOPersona(); VOPersona vope = new VOPersona(); DAOPaciente vopa = new DAOPaciente(); Fachada f = new Fachada(); DAOReserva daor = new DAOReserva(); Console.ReadLine(); }
private void botonCancelarReserva_Click(object sender, EventArgs e) { if (chequearDatos()) { Reserva reserva = DAOReserva.obtenerReservaCancelable(Int32.Parse(textNroReserva.Text)); if (reserva == null) { showToolTip("Ingrese un número de reserva válido.", textNroReserva, textNroReserva.Location); return; } CancelacionReserva cancelacion = new CancelacionReserva(); //Actualizemos los datos cancelacion.Codigo_Reserva = reserva.CodigoReserva; cancelacion.Fecha_Cancelacion_struct = dateTimeCancelacion.Value; cancelacion.Motivo = comboMotivos.SelectedItem.ToString(); cancelacion.Usr = Globals.infoSesion.User.Usr; reserva.Estado = estadoCancelacion(cancelacion.Motivo); cancelacion.Estado = reserva.Estado; //Actualizamos el estado de la reserva if (!DAOReserva.agregarCancelacion(cancelacion)) { MessageBox.Show("Error al cancelar la reserva. Intente nuevamente.", "Error", MessageBoxButtons.OK); return; } if (!DAOReserva.actualizar(reserva)) { MessageBox.Show("Error al cancelar la reserva. Intente nuevamente.", "Error", MessageBoxButtons.OK); return; } //Creamos la cancelacion MessageBox.Show("Se cancelo la reserva " + " correctamente.", "", MessageBoxButtons.OK); this.Close(); } }
private void botonConfirmar_Click(object sender, EventArgs e) { //Efectuar Reserva if (dataGridClientes.CurrentRow == null) { MessageBox.Show("Seleccione un Cliente para confirmar la reserva.", "", MessageBoxButtons.OK); return; } int codHuesped = Convert.ToInt32(dataGridClientes.CurrentRow.Cells["idHuesped"].Value); datos_Reserva.Huesped = codHuesped; if (!DAOReserva.agregar(datos_Reserva)) { MessageBox.Show("Error al confirmar la reserva.", "", MessageBoxButtons.OK); return; } datos_Reserva.CodigoReserva = DAOReserva.obtener(datos_Reserva).CodigoReserva; //Agregamos los detalles de las habitaciones foreach (Detalle_Reserva detalle in datos_Reserva.detalles_reserva) { detalle.CodigoReserva = datos_Reserva.CodigoReserva; DAOReserva.agregarHabitacion(detalle); } MessageBox.Show("Su número de reserva es: " + datos_Reserva.CodigoReserva.ToString() + ". Recuerde el mismo, ya que identifica su reserva.", "", MessageBoxButtons.OK); Globals.habilitarAnterior(); Globals.VentanaAnterior.Dispose(); this.Close(); }
private void botonBuscar_Click(object sender, EventArgs e) { if (textEstadia.Text == "") { showToolTip("Ingrese un código de estadia.", textEstadia, textEstadia.Location); return; } reserva = DAOReserva.obtener(Int32.Parse(textEstadia.Text)); if (reserva != null) { if (reserva.Estado == 6) { dataGridEstadia.DataSource = DAOConsumible.obtenerTablaByEstadia(reserva.CodigoReserva); dataGridEstadia.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridEstadia.AutoResizeColumns(); dataGridEstadia.AutoResizeRows(); } else if (reserva.Estado <= 2) { showToolTip("Reserva no efectivizada aún. Por favor, ingrese una reserva efectivizada.", textEstadia, textEstadia.Location); } else { showToolTip("Reserva Cancelada. Por favor, ingrese una reserva válida.", textEstadia, textEstadia.Location); } } else { showToolTip("Ingrese un código de estadia válido.", textEstadia, textEstadia.Location); } }
private void botonDisponibilidad_Click(object sender, EventArgs e) { if (!datos_alterados) { showToolTip("Hay disponibilidad ya que no se modificaron los datos.", botonDisponibilidad, botonDisponibilidad.Location); return; } if (chequearDatos()) { nueva_reserva = duplicarReserva(reserva_elegida); nueva_reserva.Fecha_Inicio_struct = dateTimeInicio.Value; nueva_reserva.Fecha_Fin_struct = dateTimeFin.Value; nueva_reserva.tipo_habitacion = tipos_habitacion[comboTipoHab.SelectedIndex]; nueva_reserva.CodigoRegimen = lista_regimenes[comboTipoRegimen.SelectedIndex].CodRegimen; int cantPersonas = Int32.Parse(textCant.Text); //Si se mantiene el tipo de habitacion, entonces solo tenemos que agregar o retirar habitaciones, que no sean las originales if (tipo_elegido.TipoCodigo == nueva_reserva.tipo_habitacion.TipoCodigo) { cantPersonas = cantPersonas - cantPersonas_originales; } List <Habitacion> habitaciones_disponibles; habitaciones_disponibles = DAOReserva.habitacionDisponibles(Globals.infoSesion.Hotel.CodHotel, nueva_reserva.tipo_habitacion.TipoCodigo, nueva_reserva.Fecha_Inicio, nueva_reserva.Fecha_Fin); int cantAreservar = cantPersonas / nueva_reserva.tipo_habitacion.CantPersonas; if (habitaciones_disponibles.Count < cantAreservar) { MessageBox.Show("No existen suficientes habitaciones disponibles para efectuar la reserva.", "", MessageBoxButtons.OK); return; } //Si es que faltan habitaciones (Tanto se mantenga o no el tipo de habitacion) for (int i = 0; i < cantAreservar; i++) { Detalle_Reserva det = new Detalle_Reserva(); det.CodigoHotel = Globals.infoSesion.Hotel.CodHotel; det.CodigoReserva = reserva_elegida.CodigoReserva; det.Habitacion = habitaciones_disponibles[i].Id_Habitacion; nueva_reserva.detalles_reserva.Add(det); } //Si es que sobran habitaciones (Si el tipo de habitacion se cambia, el numero es negativo y no cicla y queda vacio) for (int i = 0; i < -cantAreservar; i++) { Detalle_Reserva det = new Detalle_Reserva(); det.CodigoHotel = Globals.infoSesion.Hotel.CodHotel; det.CodigoReserva = reserva_elegida.CodigoReserva; det.Habitacion = habitaciones_disponibles[i].Id_Habitacion; detallesAremover.Add(det); } textPrecio.Text = Globals.obtenerPrecio(nueva_reserva.CodigoRegimen, cantPersonas + cantPersonas_originales, Globals.infoSesion.Hotel.Recargo).ToString(); //Simamos la cantPersonas_originales para obtener la cantidad total de personas ingresadas y no tener que levantar todo de nuevo MessageBox.Show("Hay disponibilidad para modificar la reserva.", "", MessageBoxButtons.OK); hab_confirmadas = true; } }
private int estadoCancelacion(string motivo) { List <EstadoReservas> estados = DAOReserva.obtenerEstadosReservas(); for (int i = 0; i < estados.Count; i++) { if (estados[i].descripcion.ToUpper() == motivo.ToUpper()) { return(i + 1); } } return(-1); }
//Confirmar reserva public UHotel confirmarReserva(UHotel infoHotel, UReserva infoReserva) { UHotel hotel = new UHotel(); hotel = new DAOhotel().infohotel(infoHotel); var fechasreservadas = new DAOReserva().fechasdisponibles(infoReserva); int cantReservas = new DAOReserva().verificarreserva(infoReserva); string fechaLlegada = (infoReserva.Fecha_llegada).ToString(); string fechaSalida = (infoReserva.Fecha_salida).ToString(); if (fechasreservadas == 1) { //cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('No hay disponibilidad entre estas fechas');</script>"); hotel.Mensaje2 = "No hay disponibilidad entre estas fechas"; hotel.Mensaje = null; } else if (fechasreservadas == 0) { if (cantReservas == 0) { if (infoReserva.Idusuario != 0) { new DAOReserva().insertReserva(infoReserva); hotel.Mensaje = "La reserva ha sido exitosa"; hotel.Mensaje2 = null; //cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('La reserva ha sido exitosa');</script>"); new Mail().mailconfirmarreserva(infoReserva); //correo de confirmacion } else { new DAOReserva().insertReserva(infoReserva); new Mail().mailconfirmarreserva(infoReserva); hotel.Mensaje = "La reserva ha sido exitosa"; hotel.Mensaje2 = "ESTA RESERVA SE ENCUENTRA OCUPADA"; //cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('La reserva ha sido exitosa');</script>"); } } else { hotel.Mensaje2 = "ESTA RESERVA SE ENCUENTRA OCUPADA";//, REVISE SU CORREO PARA MÁS DETALLES hotel.Mensaje = null; //cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('ESTA RESERVA SE ENCUENTRA OCUPADA');</script>"); } } return(hotel); }
private void botonCheckIn_Click(object sender, EventArgs e) { if (textHuesped.Text != "") { if (reserva_seleccionada.Estado == 6) //Osea, ya tiene hecho el checkin { showToolTip("La reserva ya posee realizado el checkIn", botonCheckIn, botonCheckIn.Location); return; } if (!reservaCancelada()) //Y de paso la cancela si no cumple { Estadia nueva_estadia = new Estadia(); nueva_estadia.CodigoReserva = reserva_seleccionada.CodigoReserva; nueva_estadia.Fecha_Ingreso_struct = Globals.getFechaSistema(); nueva_estadia.Usuario_Ingreso = Globals.infoSesion.User; if (!DAOEstadia.ingresarEntrada(nueva_estadia)) { MessageBox.Show("Error al ingresar la reserva", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //Ponemos que se efectivizo la reserva reserva_seleccionada.Estado = 6; if (!DAOReserva.actualizar(reserva_seleccionada)) { MessageBox.Show("Error al ingresar la reserva", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } MessageBox.Show("Check In realizado correctamente. A continuacion, por favor busque los huespedes en el sistema. Si los mismos no existen, registrelos.", "", MessageBoxButtons.OK); //Ingresamos los huespedes a alojarse new IngresoHuespedes().Show(); Globals.deshabilitarAnterior(this); } } else { showToolTip("Debe ingresar un número de reserva para poder hacer el Check In", textEstadia, textEstadia.Location); } }
public UMisReservas accionCalificarComentar(int idreserva, string accion) { UMisReservas mensaje = new UMisReservas(); if (accion == "calificarreserva") { UReserva inforeserva = new UReserva(); inforeserva.Id = idreserva; inforeserva = new DAOReserva().inforeserva(inforeserva); UHotel hotelinfo = new UHotel(); hotelinfo.Idhotel = int.Parse((inforeserva.Idhotel).ToString()); mensaje.Infohotel = hotelinfo; //Session["visitarhotel"] = hotelinfo; mensaje.URL1 = "ComentariosHotel.aspx"; } else if (accion == "cancelarreserva") { UReserva inforeserva = new UReserva(); inforeserva.Id = idreserva; inforeserva = new DAOReserva().inforeserva(inforeserva); if (inforeserva.Fecha_salida <= DateTime.Now) { mensaje.Mensaje = "No es posible eliminar una reserva ya realizada"; //this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('No es posible eliminar una reserva ya realizada');</script>"); } else if (inforeserva.Fecha_llegada > DateTime.Now) { new DAOReserva().deleteReserva(inforeserva); mensaje.Mensaje = "Reserva eliminada con exito"; //this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('Reserva eliminada con exito');</script>"); } else if ((inforeserva.Fecha_llegada <= DateTime.Now) && (inforeserva.Fecha_salida >= DateTime.Now)) { mensaje.Mensaje = "No es posible realizar la eliminación"; //this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('No es posible realizar la eliminación');</script>"); } } return(mensaje); }
private bool reservaCancelada() { int rspta = Globals.esElMismoDia(Globals.getFechaSistema(), (DateTime)reserva_seleccionada.Fecha_Inicio_struct); if (rspta > 0) { MessageBox.Show("La reserva seleccionada se encuentra cancelada debido a que se encuentra vencida.", "", MessageBoxButtons.OK); if (reserva_seleccionada.Estado > 2 && reserva_seleccionada.Estado < 6) { return(true); //Significa que ya esta dada de baja y pulso nuevamente } //Creamos la cancelacion CancelacionReserva cancelacion = new CancelacionReserva(); cancelacion.Codigo_Reserva = reserva_seleccionada.CodigoReserva; cancelacion.Fecha_Cancelacion_struct = Globals.getFechaSistema(); cancelacion.Usr = Globals.infoSesion.User.Usr; //Le ponemos el codigo de No-Show List <EstadoReservas> estados = DAOReserva.obtenerEstadosReservas(); cancelacion.Motivo = Globals.motivosBaja[2]; for (int i = 0; i < estados.Count; i++) { if (estados[i].descripcion == cancelacion.Motivo) { cancelacion.Estado = estados[i].codEstado; } } //Actualizamos la reserva reserva_seleccionada.Estado = cancelacion.Estado; DAOReserva.actualizar(reserva_seleccionada); //Cancelamos la reserva DAOReserva.agregarCancelacion(cancelacion); return(true); } else if (rspta < 0) { MessageBox.Show("La fecha de inicio reserva seleccionada es posterior a la fecha actual. Por favor, efectivize la reserva el día indicado.", "", MessageBoxButtons.OK); return(true); //Significa que ya esta dada de baja y pulso nuevamente } return(false); }
private void botonBuscar_Click(object sender, EventArgs e) { if (textEstadia.Text == "") { showToolTip("Ingrese un número de estadía.", textEstadia, textEstadia.Location); return; } Factura factura = DAOEstadia.obtenerFactura(Int32.Parse(textEstadia.Text)); if (factura != null) { MessageBox.Show("Factura ya generada anteriormente. Por favor, seleccione otra Reserva", "", MessageBoxButtons.OK); return; } estadia = DAOEstadia.obtener(Int32.Parse(textEstadia.Text)); reserva = DAOReserva.obtener(Int32.Parse(textEstadia.Text)); if (estadia != null) { //Buscar y rellenar los valores dataGridFacturaEstadia.DataSource = DAOConsumible.obtenerTablaByEstadia(Int32.Parse(textEstadia.Text)); double precioConsumibles = dataGridFacturaEstadia.Rows.Cast <DataGridViewRow>().Sum(X => Convert.ToInt32(X.Cells[4].Value)); int cantPersonas_originales = DAOHabitacion.obtenerCantHabitacionesByReserva(reserva.CodigoReserva); double precioBase = Globals.obtenerPrecio(reserva.CodigoRegimen, cantPersonas_originales, Globals.infoSesion.Hotel.Recargo); mostrarDatos(precioBase, precioConsumibles); DateTime eIngreso = (DateTime)estadia.Fecha_Ingreso_struct; DateTime eEgreso = (DateTime)estadia.Fecha_Egreso_struct; DateTime rIngreso = (DateTime)reserva.Fecha_Inicio_struct; DateTime rEgreso = (DateTime)reserva.Fecha_Fin_struct; mostrarDatosEstadia(eIngreso, eEgreso, rIngreso, rEgreso); datosMostrados = true; } else { showToolTip("Ingrese un número de estadía válido.", textEstadia, textEstadia.Location); } }
//buscar Disponibilidad de fecha public UDatosUsuario buscarDisponibilidad(UReserva reserva, DateTime fechaMaxima) { UDatosUsuario mensaje = new UDatosUsuario(); if (reserva.Fecha_llegada < DateTime.Now) { mensaje.Mensaje = "Seleccione fechas de llegada despues de " + DateTime.Now.Date; //deshabilitarbotones(); mensaje.Aviso = false; } else { if (reserva.Fecha_salida > fechaMaxima) { mensaje.Mensaje = "Su estadia en el hotel no puede superar los 30 dias."; //cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('Su estadia en el hotel no puede superar los 30 dias.');</script>"); //deshabilitarbotones(); mensaje.Aviso = false; } else { if (reserva.Fecha_llegada == null || reserva.Fecha_salida == null) { mensaje.Mensaje = "Seleccione las fechas correctamente"; //deshabilitarbotones(); mensaje.Aviso = false; } else if (reserva.Fecha_llegada != null || reserva.Fecha_salida != null) { if (reserva.Fecha_llegada > reserva.Fecha_salida) { mensaje.Mensaje = "Seleccione una fecha de salida posterior a\n" + reserva.Fecha_llegada; } else if (reserva.Fecha_llegada <= reserva.Fecha_salida) { var hdisponibles = new DAOReserva().habitacionesdisponibles(reserva);//numero de habitaciones en ese hotel para ese numero maximo de personas var fechasreservadas = new DAOReserva().fechasdisponibles(reserva); //var disponibilidad = hdisponibles - fechasreservadas; if (hdisponibles >= 1) { if (fechasreservadas >= 1) { mensaje.Mensaje = "No hay disponibilidad para las fechas selccionadas"; //deshabilitarbotones(); mensaje.Aviso = false; } else if (fechasreservadas == 0) { mensaje.Mensaje = "habitación disponible para las fechas selccionadas"; //habilitarbotones(); mensaje.Aviso = true; } } else { mensaje.Mensaje = "No hay habitaciones disponibles para ese numero de personas"; //deshabilitarbotones(); mensaje.Aviso = false; } } } } } return(mensaje); }
public int Actualizar(Reserva Reserva) { DAOReserva daUsuario = new DAOReserva(); return(daUsuario.Actualizar(Reserva)); }
public Reserva TraerPorId(int Id) { DAOReserva daUsuario = new DAOReserva(); return(daUsuario.TraerPorId(Id)); }
public List <Reserva> Listar() { DAOReserva daUsuario = new DAOReserva(); return(daUsuario.Listar()); }
private void botonModificar_Click(object sender, EventArgs e) { if (!datos_alterados) { showToolTip("Primero chequee disponibilidad ya que se modificaron los datos.", botonModificar, botonModificar.Location); return; } if (hab_confirmadas) { //Cambiamos el estado de la reserva a modificada List <EstadoReservas> estados = DAOReserva.obtenerEstadosReservas(); foreach (EstadoReservas estado in estados) { if (estado.descripcion == "Reserva modificada") { nueva_reserva.Estado = estado.codEstado; } } //Actualizamos la reserva if (!DAOReserva.actualizar(nueva_reserva)) { MessageBox.Show("Error al modificar la reserva.", "", MessageBoxButtons.OK); return; } if (tipo_elegido.TipoCodigo == nueva_reserva.tipo_habitacion.TipoCodigo) { if (detallesAremover.Count != 0) { foreach (Detalle_Reserva detalle in detallesAremover) { DAOReserva.quitarHabitacion(detalle); } } else { foreach (Detalle_Reserva detalle in nueva_reserva.detalles_reserva) { DAOReserva.agregarHabitacion(detalle); } } } else { //Quitar TODOS los detalles_Reservas ya existentes DAOReserva.quitarTodasHabitaciones(nueva_reserva.CodigoReserva); //Agregar los nuevos de nueva_reserva foreach (Detalle_Reserva detalle in nueva_reserva.detalles_reserva) { DAOReserva.agregarHabitacion(detalle); } } MessageBox.Show("Reserva modificada Correctamente.", "", MessageBoxButtons.OK); this.Close(); } else { showToolTip("No se han modificado ninguno de los valores de la reserva.", botonModificar, botonModificar.Location); } }
public int Insertar(Reserva Reserva) { DAOReserva daUsuario = new DAOReserva(); return(daUsuario.Insertar(Reserva)); }
public List <UReserva> listaMisReservas(URegistro usuario) { List <UReserva> listaMisHoteles = new DAOReserva().mostrarmisreservas(usuario); return(listaMisHoteles); }
public int Eliminar(int Id) { DAOReserva daUsuario = new DAOReserva(); return(daUsuario.Eliminar(Id)); }
public UComentario_CalificacionDatos calificar(URegistro sessionUsuario, UHotel hotelSession, UReserva inforeserva, RadioButton[] arrayRadioButton) { UComentario_CalificacionDatos mensaje = new UComentario_CalificacionDatos(); DateTime fechaparacalificar; if (inforeserva != null) { inforeserva = new DAOReserva().inforeserva(inforeserva); try { fechaparacalificar = inforeserva.Fecha_salida; if (DateTime.Now >= fechaparacalificar.AddDays(1)) { if (inforeserva.Calificacion == null) { if (arrayRadioButton[0].Checked) { inforeserva.Calificacion = 0; } else if (arrayRadioButton[1].Checked) { inforeserva.Calificacion = 1; } else if (arrayRadioButton[2].Checked) { inforeserva.Calificacion = 2; } else if (arrayRadioButton[3].Checked) { inforeserva.Calificacion = 3; } else if (arrayRadioButton[4].Checked) { inforeserva.Calificacion = 4; } else if (arrayRadioButton[5].Checked) { inforeserva.Calificacion = 5; } if (inforeserva.Calificacion != null) { new DAOReserva().actualizarcalificacion(inforeserva); mensaje.Mensaje = "Calificacion realizada con exito"; new DAOReserva().cantidaddereservasconcalificacion(inforeserva); var promediocalificacion = new DAOReserva().cantidaddereservasconcalificacion(inforeserva); UHotel hotel = new UHotel(); hotel.Idhotel = int.Parse((inforeserva.Idhotel).ToString()); hotel.Promediocalificacion = promediocalificacion; new DAOhotel().actualizarcalificacion(hotel); } else { mensaje.Mensaje = "Seleccione una opcion a calificar"; } } else if (inforeserva.Calificacion != null) { mensaje.Mensaje = "Este servicio ha sido calificado antes"; } } else { mensaje.Mensaje = "No es posible realizar aun esta calificación"; } } catch { mensaje.Mensaje = "No es posible realizar aun esta calificación "; } } else if (inforeserva == null) { mensaje.Mensaje = "Todas sus reservas han sido calificadas"; } return(mensaje); }