コード例 #1
0
		private void attach_Reservas(Reserva entity)
		{
			this.SendPropertyChanging();
			entity.Anuncio = this;
		}
コード例 #2
0
		private void detach_Reservas(Reserva entity)
		{
			this.SendPropertyChanging();
			entity.Anuncio = null;
		}
コード例 #3
0
 partial void UpdateReserva(Reserva instance);
コード例 #4
0
 partial void DeleteReserva(Reserva instance);
コード例 #5
0
 public Anuncio GetAnuncio(Reserva r)
 {
     return OperacionesBDController.GetAnuncioByReserva(r);
 }
コード例 #6
0
 partial void InsertReserva(Reserva instance);
コード例 #7
0
 private bool GrabaReserva(Reserva r)
 {
     return OperacionesBDController.GrabaReserva(r);
 }
コード例 #8
0
 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;
     }
 }
コード例 #9
0
 public static bool GrabaReserva(Reserva r)
 {
     using (MiDataBaseDataContext db = new MiDataBaseDataContext())
     {
         if (existeReserva(r))
         {
             return false;
         }
         db.Reservas.InsertOnSubmit(r);
         db.SubmitChanges();
         return true;
     }
 }
コード例 #10
0
        public static Anuncio GetAnuncioByReserva(Reserva r)
        {
            using (MiDataBaseDataContext db = new MiDataBaseDataContext())
            {
                return db.Anuncios.Where(a => a.Id_Anuncio == r.Id_Anuncio).Single();
            }

        }
コード例 #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();

        }