Exemplo n.º 1
0
        public IActionResult Orders()
        {
            var          idUser  = aartistRepository.GetIdUserByUsurName(User.Identity.Name);
            var          client  = aartistRepository.GetClient(idUser);
            var          orders  = aartistRepository.GetOrdersByClent(client.Id);
            List <Order> orders1 = orders.Select(o => new Order
            {
                City          = aartistRepository.GetCityById(o.IdCity),
                Price         = o.Price,
                DateTimeEvent = o.DateEvent,
            }).ToList();

            return(View(orders1));
        }
        public IActionResult Orders()
        {
            var artist = aartistRepository.GetArtitByUserNmae(User.Identity.Name);

            if (artist != null)
            {
                var ors = aartistRepository.GetOrdersByArtsist(artist.Id);
                List <OrderForArtist> orders = ors.Select(o => new OrderForArtist
                {
                    City            = aartistRepository.GetCityById(o.IdCity),
                    Price           = o.Price,
                    IfPaid          = o.IfPaid,
                    IfApprovedOrder = o.IfApprovedOrder,
                    DateTimeEvent   = o.DateEvent,
                    OrderDate       = o.OrderDate,
                }).ToList();

                return(View(orders));
            }
            else
            {
                return(RedirectToAction("ArtistCard"));
            }
        }