Example #1
0
        public PushGame(MyHome input)
        {
            myHome = input;
            InitializeComponent();
            this.BackColor = Color.FromArgb(42, 46, 51);
            PublisherControllerShould publisherController = new PublisherControllerShould();

            getPublisherCallBack += _getPublisherCallBack;
            publisherResponse     = publisherController.GetAllPublishersController(getPublisherCallBack);
            comboBox1.Text        = "Choose Publisher";
        }
Example #2
0
        public void LoadGamePanel(GameObject gameobject)
        {
            this.GameIcon.Image       = gameobject.Logo.Image;
            this.GameNameLabel.Text   = gameobject.Name;
            this.GameDescription.Text = gameobject.Content;
            this.ReleaseDate.Text     = "Release Date: " + gameobject.PurchaseDate;
            this.Publisher.Text       = "Publisher: " + PublisherControllerShould.GetPublisherByIdController(gameobject.PublisherId.ToString()).Payload.Name;
            this.Rating.Text          = "Rating: " + gameobject.Rating.ToString();
            if (gameobject.Price == 0)
            {
                this.PriceLabel.Text = "FREE";
            }
            else
            {
                this.PriceLabel.Text = "Price: " + gameobject.Price.ToString() + " VND";
            }
            try
            {
                this.GameDetailPicBox1.Image = GetImagebyURI(gameobject.GameImages.ElementAt(0));
                this.GameDetailPicBox2.Image = GetImagebyURI(gameobject.GameImages.ElementAt(1));
                this.GameDetailPicBox3.Image = GetImagebyURI(gameobject.GameImages.ElementAt(2));
                this.GameDetailPicBox4.Image = GetImagebyURI(gameobject.GameImages.ElementAt(3));
                this.GameDetailPicBox5.Image = GetImagebyURI(gameobject.GameImages.ElementAt(0));
                this.GameDetailPicBox6.Image = GetImagebyURI(gameobject.GameImages.ElementAt(1));
            }
            catch (Exception e)
            {
                this.GameDetailPicBox1.Image = GetImagebyURI(gameobject.GameImages.ElementAt(0));
                this.GameDetailPicBox2.Image = GetImagebyURI(gameobject.GameImages.ElementAt(0));
                this.GameDetailPicBox3.Image = GetImagebyURI(gameobject.GameImages.ElementAt(0));
                this.GameDetailPicBox4.Image = GetImagebyURI(gameobject.GameImages.ElementAt(0));
                this.GameDetailPicBox5.Image = GetImagebyURI(gameobject.GameImages.ElementAt(0));
                this.GameDetailPicBox6.Image = GetImagebyURI(gameobject.GameImages.ElementAt(0));
            }

            var embed = "<html><head>" +
                        "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\"/>" +
                        "</head><body>" +
                        "<iframe width=\"1026\" height=\"250\" src=\"{0}\"" +
                        "frameborder = \"0\" allow = \"autoplay; encrypted-media\" allowfullscreen></iframe>" +
                        "</body></html>";
            var url = "https://www.youtube.com/embed/3Q6U3BSbrlY";

            this.GameVid.DocumentText = string.Format(embed, url);

            //xu ly neu game co sale:
            if (gameobject.Sale != 0)
            {
                this.PriceLabel.Font         = new Font("Microsoft Sans Serif", 20, FontStyle.Strikeout);
                this.saledPriceLabel.Visible = true;
                float saledprice = gameobject.Price - (gameobject.Price * gameobject.Sale / (float)100);
                if (saledprice < 0)
                {
                    saledprice = 0;
                }
                if (saledprice == 0)
                {
                    this.saledPriceLabel.Text = "FREE";
                }
                else
                {
                    this.saledPriceLabel.Text = "Price: " + saledprice.ToString() + " VND";
                }
            }
            else
            {
                this.PriceLabel.Font         = new Font("Microsoft Sans Serif", 20, FontStyle.Regular);
                this.saledPriceLabel.Visible = false;
            }
        }