Example #1
0
        static void Main(string[] args)
        {
            // The code provided will print ‘Hello World’ to the console.
            // Press Ctrl+F5 (or go to Debug > Start Without Debugging) to run your app.
            Console.WriteLine("Hello World!");
            Console.WriteLine(BackendData.get_Current_Player().FirstName.ToString());



            Console.ReadKey();

            // Go to http://aka.ms/dotnet-get-started-console to continue learning how to build a console app!
        }
Example #2
0
        private void Update_Screen()
        {
            Element currentPlayer = BackendData.get_Current_Player();

            //string playerImage = @"C:\Home\dropbox\fantasyfootball\Photos\" + BackendData.get_Current_Player_Code() + ".png";
            try
            {
                Image       screenImage = new Image();
                BitmapImage playerImage = new BitmapImage();
                string      picfile     = @"C:\Home\dropbox\fantasyfootball\Photos\" + BackendData.get_Current_Player_Code() + ".png";
                lblPhotoFile.Content = picfile;

                playerImage.BeginInit();
                playerImage.UriSource = new Uri(picfile, UriKind.Absolute);
                playerImage.EndInit();
                imgPlayer.Source = playerImage;
            }
            catch (Exception imageException)
            {
                Image       screenImage = new Image();
                BitmapImage playerImage = new BitmapImage();
                string      picfile     = noPicFile;
                lblPhotoFile.Content = picfile;

                playerImage.BeginInit();
                playerImage.UriSource = new Uri(picfile, UriKind.Absolute);
                playerImage.EndInit();
                imgPlayer.Source = playerImage;;
            };

            lblPlayerCount.Content = BackendData.numberOfCurrentPlayer.ToString() + " Of " + BackendData.numberOfPlayers.ToString();

            var temp = Encoding.UTF8.GetBytes(currentPlayer.FirstName.ToString());

            lblFirstName.Content   = (currentPlayer.FirstName);
            lblSecondName.Content  = currentPlayer.SecondName;
            lblTeam.Content        = BackendData.Get_Team_Name();
            lblTotalPoints.Content = "Total Points: " + currentPlayer.TotalPoints;

            if (currentPlayer.TotalPoints > 0)
            {
                lblAverageMinutes.Content = "Avg. Minutes : " + (currentPlayer.Minutes / Convert.ToDecimal(BackendData.Get_Games_Played())).ToString("0");
            }
            else
            {
                lblAverageMinutes.Content = "Avg. minutes : 0";
            }
            lblPosition.Content = BackendData.Get_Player_Position();
            lblValue.Content    = "Value: " + (currentPlayer.NowCost);
            lblPPG.Content      = "Points Per Game: " + currentPlayer.PointsPerGame.ToString();

            DateTimeOffset?date1 = (currentPlayer.NewsAdded);

            lblChanceOfPlaying.Content = (String.Format("{0:dd/MMM/yyyy}", date1) + " - " + currentPlayer.News);



            lblPPPM.Content = "PPPM(PTP): " + ((BackendData.Calculate_PPPM()).ToString("0.##") + "(" + BackendData.Calculate_PTP().ToString("0")) + ")";

            if (currentPlayer.TotalPoints > 0)
            {
                lblGamesPlayed.Content = "No Of Games: " + BackendData.Get_Games_Played().ToString("0");
            }
            else
            {
                lblGamesPlayed.Content = "No Of Games: N/A";
            }

            lblPPW.Content = "Points Per Week: " + ((currentPlayer.TotalPoints) / Convert.ToDecimal(BackendData.fantasyPlayer.Game_Week)).ToString("0.#");
        }