Esempio n. 1
0
        public async Task <IActionResult> GetAll(int userId, int eventId)
        {
            var allGifts = await _repo.GetAll(userId, eventId);

            if (allGifts == null)
            {
                return(BadRequest());
            }

            var giftToRetrunDTOs = _mapper.Map <ICollection <GiftToRetrunDTO> >(allGifts);

            return(Ok(giftToRetrunDTOs));
        }
Esempio n. 2
0
        public void getGiftByBrandId()
        {
            List <Gift> list             = _gift.GetAll().ToList <Gift>();
            List <Gift> listGetByBrandId = new List <Gift>();

            foreach (Gift gift in list)
            {
                if (gift.BrandId.Equals(HttpContext.Session.GetString("brandId")) && gift.Status != 1)
                {
                    listGetByBrandId.Add(gift);
                }
            }
            ViewBag.listGifts = listGetByBrandId;
            ViewBag.email     = HttpContext.Session.GetString("email");
        }
Esempio n. 3
0
 public async Task <List <Gift> > GetAll()
 {
     return(await _giftDal.GetAll());
 }
Esempio n. 4
0
        public IActionResult GetAll()
        {
            var gifts = _giftRepository.GetAll();

            return(Ok(gifts));
        }