async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Donations.Clear();
                Image   = String.Empty;
                Content = String.Empty;
                DonationTitles.Clear();
                var items = await DonationStore.GetItemsAsync("api/donations", true);

                if (items != null && items.Count() > 0)
                {
                    foreach (var item in items)
                    {
                        Donations.Add(item);
                        DonationTitles.Add(item.Title);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemple #2
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if (info.ButtonID > 0 && info.ButtonID <= 5)
            {
                m_From.CloseGump(typeof(DonationStoreGump));

                long    giftId = m_GiftIDs[info.ButtonID - 1];
                IEntity gift   = DonationStore.RedeemGift(giftId, m_From.Account.Username);
                if (gift != null)
                {
                    m_From.AddToBackpack((Item)gift);
                    m_From.SendMessage("{0} has been placed in your backpack. Thank you for your donation!", ((Item)gift).Name);
                }
            }
        }
Exemple #3
0
        private void generatGiftList(Mobile acct)
        {
            string       username = acct.Account.Username;
            DonationGift giftInfo = null;
            int          offset   = 40;

            ArrayList giftList = DonationStore.GetDonationGiftList(username);

            if (giftList.Count == 0)
            {
                AddHtml(62, 162, 325, 60, @"Thank you for playing! You have no donation gift to claim now. Consider donating to this shard to keep this shard running.", (bool)true, (bool)true);
                return;
            }

            for (int i = 1; (i < 6 && i <= giftList.Count); i++)
            {
                giftInfo         = (DonationGift)giftList[i - 1];
                m_GiftIDs[i - 1] = giftInfo.Id;
                AddGiftOption(giftInfo.Name, i, offset);
            }
        }
Exemple #4
0
        private void generatGiftList(Mobile acct)
        {
            string       username = acct.Account.Username;
            DonationGift giftInfo = null;
            int          offset   = 40;

            ArrayList giftList = DonationStore.GetDonationGiftList(username);

            if (giftList.Count == 0)
            {
                AddHtml(62, 162, 325, 60, @"You currently have no coins. Please consider donating to keep our server running.", (bool)true, (bool)true);
                return;
            }

            for (int i = 1; (i < 6 && i <= giftList.Count); i++)
            {
                giftInfo         = (DonationGift)giftList[i - 1];
                m_GiftIDs[i - 1] = giftInfo.Id;
                AddGiftOption(giftInfo.Name, i, offset);
            }
        }