public static void GetNotification(clsMatchDetails objMatchDetails, out string o_strTitle, out string o_strText) { try { // Local variables string[] arrEvents = { "four", "six", "wicket", "out", "fifty", "hundred" }; o_strTitle = string.Empty; o_strText = string.Empty; if (objMatchDetails.comm_lines != null) { if (arrEvents.Contains(objMatchDetails.comm_lines[0].evt) && Globals.strLastNotificationBallNo != objMatchDetails.comm_lines[0].b_no) { Globals.strLastNotificationBallNo = objMatchDetails.comm_lines[0].b_no; o_strTitle = UppercaseFirst(objMatchDetails.comm_lines[0].evt); o_strText = StripHTML(objMatchDetails.comm_lines[0].comm); } } } catch (Exception) { o_strTitle = string.Empty; o_strText = string.Empty; } }
public static clsMatchDetails GetMatchDetails(string strMatchLink) { try { using (WebClient objWebClient = new WebClient()) { var JSONMatchDetails = objWebClient.DownloadString(strMatchLink); clsMatchDetails objMatchDetails = JsonConvert.DeserializeObject <clsMatchDetails>(JSONMatchDetails); return(objMatchDetails); } } catch (Exception) { return(null); } }
public clsMatchDetailsForUI(clsMatchDetails i_objMatchDetails) { try { _objMatchDetails = i_objMatchDetails; Status = i_objMatchDetails.status; Ground = i_objMatchDetails.venue.location; MatchType = i_objMatchDetails.type; MatchCarrier = MatchType + " Carrier"; MatchDescription = i_objMatchDetails.match_desc; StartTime = i_objMatchDetails.start_time; Venue = i_objMatchDetails.venue.name + ", " + i_objMatchDetails.venue.location; TeamNames = i_objMatchDetails.team1.s_name + " Vs " + i_objMatchDetails.team2.s_name; if (IsNull(i_objMatchDetails.mom) == false) { ManOfMatch = "Player of the Match : " + GetMOMPlayerDetails(i_objMatchDetails.mom[0].ToString()).Name; } if (IsNull(i_objMatchDetails.toss) == false) { Toss = "Toss won by " + i_objMatchDetails.toss.winner + " & choosen " + i_objMatchDetails.toss.decision; } if (IsNull(i_objMatchDetails.series) == false) { SeriesName = i_objMatchDetails.series.short_name; } if (IsNull(i_objMatchDetails.score) == false) { TeamScore = "-" + i_objMatchDetails.score.batting.score; RunRate = "CRR - " + i_objMatchDetails.score.crr; Recent = i_objMatchDetails.score.prev_overs; Patnership = "Partnership " + i_objMatchDetails.score.prtshp; Target = i_objMatchDetails.score.target; Batsman1 = GetBatsmanDetails(0); Batsman2 = GetBatsmanDetails(1); Bowler = GetBowlerDetails(); BattingTeam = GetBattingTeamName(_objMatchDetails.score.batting.id); LastWicket = "Last WK " + GetLastWicket(); } } catch (Exception) { } }