Exemplo n.º 1
0
 public IActionResult GalleryView(string id)
 {
     Gallery                 = _galleries.FindObject(id);
     Gallery.Paintings       = _paintings.GetOwnerPaintings(id);
     Gallery.Representatives = _users.Users.FindAll(us => us.GalleryId == Gallery.Id);
     return(View(Gallery));
 }
        public IActionResult Index()
        {
            User user = _users.FindUser(User.Identity.Name);

            user.Paintings = _paintings.GetOwnerPaintings(user.Id);
            return(View(user));
        }
        public IActionResult CollectorView(string id)
        {
            User user = _users.Users.Find(us => us.Id == id);

            if (user.IsRepresentative)
            {
                user.Gallery = _galleries.FindObject(user.GalleryId).Title;
            }
            else
            {
                user.Paintings = _paintings.GetOwnerPaintings(user.Id);
            }

            return(View(user));
        }