Esempio n. 1
0
        public bool IsCodeExists(string surveyCode)
        {
            var booking = GiftCardList.FirstOrDefault(x => x.Code == surveyCode.ToUpper());

            if (booking != null)
            {
                return(true);
            }
            return(false);
        }
        public GiftCards GetGiftCardByCode(string code)
        {
            var giftCards = GiftCardList.FirstOrDefault(h => h.Code.ToUpper() == code.ToUpper());

            if (giftCards != null)
            {
                var isGiftForEmail = (from gb in GiftCardBookingList
                                      join gc in GiftCardList on gb.GiftCardId equals gc.Id
                                      where gc.Id == giftCards.Id
                                      select gb).FirstOrDefault();
                if (isGiftForEmail != null)
                {
                    giftCards.EmailAddress = isGiftForEmail.RecipientEmail;
                }
            }

            return(giftCards);
        }