コード例 #1
0
ファイル: Reserva.cs プロジェクト: fantaxmax/Hotelera
 public bool Eliminar()
 {
     try
     {
         EDM.Reserva r = Conector.HotelEntities.Reservas.Find(ID);
         Conector.HotelEntities.Reservas.Remove(r);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
コード例 #2
0
ファイル: Reserva.cs プロジェクト: fantaxmax/Hotelera
 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);
     }
 }
コード例 #3
0
ファイル: Reserva.cs プロジェクト: fantaxmax/Hotelera
 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);
     }
 }