예제 #1
0
        public Profile(GameStore.DTOs.PayloadBody input, MyHome home)
        {
            user = input;
            InitializeComponent();
            panel1.BackColor   = Color.FromArgb(42, 46, 51);
            avatar.Image       = Properties.Resources.gta5;
            listGame.BackColor = Color.FromArgb(42, 46, 51);

            listGame.SmallImageList = imageList1;
            LoadPurchased();

            currmoney     = AccountsControllerShould.GetUserByIdController(id).Money;
            SoDuText.Text = "Money: VND" + Math.Round(currmoney, 2).ToString();
            this.myHome   = home;
        }
예제 #2
0
        public void LoadDatabase(string UserId)
        {
            GameResponse     = GameControllerShould.GetAllGamesController();
            User             = AccountsControllerShould.GetUserByIdController(UserId);
            GameSaleResponse = GameControllerShould.GetAllGamesSaleController();


            List <GameDTOs> gameDTOs = GameResponse.Payload;

            foreach (GameDTOs a in gameDTOs)
            {
                GameObject temp1 = toGameObject(a);
                lib_game.Add(temp1);
            }

            foreach (TitleGame a in User.Games)
            {
                Response <GameDTOs> temp    = GameControllerShould.GetGameByIdController(a.Id.ToString());
                GameObject          gameobj = toGameObject(temp.Payload);
                user_game.Add(gameobj);
            }

            //foreach (TitleGame a in User.WishGames)
            //{
            //    Response<GameDTOs> temp = GameControllerShould.GetGameByIdController(a.Id.ToString());
            //    GameObject gameobj = toGameObject(temp.Payload);
            //    user_wishgame.Add(gameobj);
            //}

            foreach (GameDTOs a in GameSaleResponse.Payload)
            {
                GameObject gameobj = toGameObject(a);
                sale_game.Add(gameobj);
            }
            if (sale_game.Count() < 4)
            {
                for (int i = 0; i < 4; i++)
                {
                    sale_game.Add(lib_game.ElementAt(i));
                }
            }
        }
예제 #3
0
 public static void SetUser(GameStore.DTOs.PayloadBody inputUser, string Id)
 {
     user      = inputUser;
     id        = Id;
     currmoney = inputUser.Money;
 }