public bool Eliminar() { try { EDM.Reserva r = Conector.HotelEntities.Reservas.Find(ID); Conector.HotelEntities.Reservas.Remove(r); return(true); } catch (Exception e) { return(false); } }
public bool Modificar() { try { EDM.Reserva r = Conector.HotelEntities.Reservas.Find(ID); r.fechaIng = FechaIngreso; r.fechaRet = FechaRetiro; r.habitacion = Habitacion.Numero; r.rut = Rut; Conector.HotelEntities.SaveChanges(); return(true); } catch (Exception e) { return(false); } }
public bool Insertar() { try { EDM.Reserva r = new EDM.Reserva(); r.id = ID; r.fechaIng = FechaIngreso; r.fechaRet = FechaRetiro; r.habitacion = Habitacion.Numero; r.rut = Rut; Conector.HotelEntities.Reservas.Add(r); Conector.HotelEntities.SaveChanges(); return(true); } catch (Exception e) { return(false); } }