예제 #1
0
        public MatchItemModel(Match m) {
            ID = m.id;
            DateTime = m.date;
            Date = m.date.ToString("yyyy. MMMM dd.");
            Home = m.home;
            HomeFlag = m.home_flag;
            Away = m.away;
            AwayFlag = m.away_flag;
            Group = m.group;
            HomeScore = m.final_score?.home ?? -1;
            AwayScore = m.final_score?.away ?? -1;
            IsExpanded = false;

            if (m.user_bet != null || DateTime.Now.AddMinutes(G.MatchBetTimeLimit) > DateTime) {  //van tipp vagy elkezdődött a meccs
                IsBetsHidden = false;

                if (m.final_score != null) { //van eredmény
                    Score = $"{HomeScore} - {AwayScore}";
                }
            }
            else { //nincs tipp
                IsBetsHidden = true;
            }

            Bets = new List<MatchBetItemModel>();
            if (m.bets != null) {
                foreach (var b in m.bets) {
                    Bets.Add(new MatchBetItemModel(b));
                }
            }
        }
예제 #2
0
 public BetItemModel(Match m) : this() {
     ID = m.id;
     DateTime = m.date;
     Date = m.date.ToString("yyyy. MMMM dd. HH:mm");
     Time = "";// m.date.ToString("HH:mm");
     Home = m.home;
     HomeFlag = m.home_flag;
     Away = m.away;
     AwayFlag = m.away_flag;
     Group = m.group;
     IsExpanded = false;
     CanExpand = true;
     if (m.user_bet != null || DateTime.Now.AddMinutes(G.MatchBetTimeLimit) > DateTime) {
         CanExpand = false;
         Time = m.user_bet == null ? "Lejárt" : $"{m.user_bet.home} - {m.user_bet.away}";
     }
 }