public ActionResult Desponibility(int id) { int a = (int)sp.GetById(id).owner_id; user uss = us.GetById(a); List <rentspace> pvm = new List <rentspace>(); IEnumerable <rentspace> prod = rs.SpaceDisponibility(id); foreach (var u in prod) { rentspace r = new rentspace { fk_artist = u.fk_artist, fk_space = u.fk_space, rentDate = u.rentDate, price = u.price, user = us.GetById(u.fk_artist), user1 = uss, space = sp.GetById(id) }; pvm.Add(r); } return(View(pvm)); }
public ActionResult confirmlouer(int id, space s) { space prod = sp.GetById(id); if (prod != null) { rentspace r = new rentspace { fk_artist = (int)Session["LogedUserid"], fk_space = prod.id, rentDate = (DateTime)s.rentdate, price = prod.rentalPrice }; prod.disponibility = false; rs.Add(r); rs.Commit(); sp.Update(prod); sp.Commit(); return(RedirectToAction("Index", "Paypal", new { ids = id })); } return(View()); }