// GET: Space/Details/5 public ActionResult Details(int id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } space space = service.GetById(id); if (space == null) { return(HttpNotFound()); } return(View(space)); }
// GET: Exposure/Details/5 public ActionResult Details(int id) { if (id == 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } IEnumerable <artwork> ListArtworkById = serviceA.ArtworkByIdArtwork(id); List <ArtworkForExposureModel> ArtById = new List <ArtworkForExposureModel>(); ShowroomdbContext ctx = new ShowroomdbContext(); //user Artist = ServiceU.GetById(u.fk_artist.Value); //ExpositionArtwork ExpositionArtwork = ServicExpositionArtwork.GetOneExpoByIdExpo(id); //space space = ServiceS.GetById(ExpositionArtwork.fk_space); //exposure exposure = service.GetById(id); //int? FkOwner = space.fk_owner; //user Owner = ServiceU.GetById(FkOwner.Value); if (ListArtworkById == null) { return(HttpNotFound()); } foreach (var x in ListArtworkById) { ArtworkForExposureModel ar = new ArtworkForExposureModel(); user Artist = ServiceU.GetById((int)x.artist_id); ExpositionArtwork ExpositionArtwork = ServicExpositionArtwork.GetOneExpoByIdExpo(id); space space = ServiceS.GetById(ExpositionArtwork.fk_space); exposure exposure = service.GetById(id); int? FkOwner = space.owner_id; user Owner = ServiceU.GetById(FkOwner.Value); ar.id = x.id; ar.name = x.name; ar.photo = x.phot; ar.ArtistName = Artist.firstName + Artist.lastName; ar.StartDate = exposure.SDate.Value; ar.EndDate = exposure.EDate.Value; ar.SpaceName = space.name; ar.SpaceAddress = space.adress; ar.OwnerName = Owner.firstName + Owner.lastName; ar.Priority = ServicExpositionArtwork.GetByIdArtworkAndIdExposure(id, x.id); ArtById.Add(ar); } return(View(ArtById.OrderBy(a => a.Priority).ToList())); }
public ActionResult louer(int id) { space prod = sp.GetById(id); space a = new space { id = prod.id, name = prod.name, description = prod.description, adress = prod.description, rentalPrice = prod.rentalPrice, pic = prod.pic, user = us.GetById((int)prod.owner_id) }; return(View(prod)); }