コード例 #1
0
        private string GetThisMonthsEarnings(string videoId)
        {
            string returnValue = "0";

            if (thisMonthsVideos != null)
            {
                YouTubeVideoAnalytics vidAnalytics = thisMonthsVideos.FirstOrDefault(x => { return(x.Id == videoId); });
                if (vidAnalytics != null)
                {
                    if (vidAnalytics.EstimatedEarning > 0)
                    {
                        returnValue = "$" + ApplyRevenueShare("", vidAnalytics.Id, vidAnalytics.EstimatedEarning).ToString();
                    }
                }
            }

            return(returnValue);
        }
コード例 #2
0
        private string GetLastMonthsEarnings(string videoId)
        {
            string returnValue = "0";

            if (lastMonthsVideos != null)
            {
                YouTubeVideoAnalytics vidAnalytics = lastMonthsVideos.FirstOrDefault(x => { return(x.Id == videoId); });
                if (vidAnalytics != null)
                {
                    if (vidAnalytics.Earning > 0)
                    {
                        //returnValue = "R" + ApplyRevenueShare("", vidAnalytics.Id, vidAnalytics.Earning).ToString();
                        returnValue = "R" + RoundtoTwo(vidAnalytics.Earning).ToString();
                    }
                    else if (vidAnalytics.EstimatedEarning > 0)
                    {
                        returnValue = "$" + ApplyRevenueShare("", vidAnalytics.Id, vidAnalytics.EstimatedEarning).ToString();
                    }
                }
            }

            return(returnValue);
        }