示例#1
0
        private async Task LoadContestData()
        {
            try
            {
                var col = await ContestsDefinition.LoadContest();

                if (col != null && col.Count > 0)
                {
                    foreach (Finalist f in col)
                    {
                        f.Vote = await ContestsDefinition.GetContestVoteForContact(f.ContestId.ToString());

                        if (f.Vote != null)
                        {
                            if (f.Vote.FinalistId != f.Id)
                            {
                                f.Vote.FinalistId = "";
                            }
                        }
                    }
                }

                ContestCollection = col;

                IsBusy = false;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
        public async Task <Finalist> VoteForFinalist(Finalist f)
        {
            IsBusy            = true;
            f.Vote.FinalistId = f.Id;
            var x = await ContestsDefinition.SaveContestVote(f.Vote);

            await LoadContestData();

            return(f);
        }