private void attach_Reservas(Reserva entity)
		{
			this.SendPropertyChanging();
			entity.Anuncio = this;
		}
		private void detach_Reservas(Reserva entity)
		{
			this.SendPropertyChanging();
			entity.Anuncio = null;
		}
 partial void UpdateReserva(Reserva instance);
 partial void DeleteReserva(Reserva instance);
Example #5
0
 public Anuncio GetAnuncio(Reserva r)
 {
     return OperacionesBDController.GetAnuncioByReserva(r);
 }
 partial void InsertReserva(Reserva instance);
Example #7
0
 private bool GrabaReserva(Reserva r)
 {
     return OperacionesBDController.GrabaReserva(r);
 }
 private static bool existeReserva(Reserva r)
 {
     using (MiDataBaseDataContext db = new MiDataBaseDataContext())
     {
         bool existe = (from res in db.Reservas
                        where res.Id_Huesped == r.Id_Huesped &&
                       res.Id_Anuncio == r.Id_Anuncio
                        select true).SingleOrDefault();
         return existe;
     }
 }
 public static bool GrabaReserva(Reserva r)
 {
     using (MiDataBaseDataContext db = new MiDataBaseDataContext())
     {
         if (existeReserva(r))
         {
             return false;
         }
         db.Reservas.InsertOnSubmit(r);
         db.SubmitChanges();
         return true;
     }
 }
        public static Anuncio GetAnuncioByReserva(Reserva r)
        {
            using (MiDataBaseDataContext db = new MiDataBaseDataContext())
            {
                return db.Anuncios.Where(a => a.Id_Anuncio == r.Id_Anuncio).Single();
            }

        }
Example #11
0
        public ActionResult PagarReserva(int id, int idReserva, string remitente, string destinatario)
        {
            __anfitrion = control.GetUserById(remitente);           Session["anfitrion"] = __anfitrion;
            __r = GetReserva(idReserva);                            Session["reserva"] = __r;
            __huesped = control.GetUserById(destinatario);          Session["huesped"] = __huesped; //--> Session para leerlo al generar factura
            __a = getAnuncioById(__r.Id_Anuncio);                   Session["anuncio"] = __a;

            ViewBag.Anfitrion = __anfitrion;                // |----> No Funciona :((((
            ViewBag.Huesped = __huesped;
            ViewBag.Reserva = __r;
            ViewBag.Anuncio = __a;
            ViewBag.IdMensaje = id;

            return View();

        }