Exemplo n.º 1
0
        protected override async Task OnInitializedAsync()
        {
            Console.WriteLine(CultureInfo.CurrentCulture);
            Users  = UserManager.Users.ToList();
            Armies = await ArmyRepository.GetList();

            GameTables = await GameTableRepository.GetList();

            Scenarios = await ScenarioRepository.GetList();

            if (!string.IsNullOrEmpty(Player1) && !string.IsNullOrEmpty(Player2) && !string.IsNullOrEmpty(Date))
            {
                User1Id = Player1;
                User2Id = Player2;
                //            game.Date = DateTime.ParseExact(date, "dd-MM-yyyy",null);
            }
        }
Exemplo n.º 2
0
 protected override async Task OnInitializedAsync()
 {
     GameTables = await GameTableRepository.GetList();
 }
Exemplo n.º 3
0
        protected override async Task OnInitializedAsync()
        {
            Users = await Task.FromResult(UserManager.Users.ToList());

            Armies = await ArmyRepository.GetList();

            Game = await GameRepository.GetById(Id);

            GameTables = await GameTableRepository.GetList();

            Scenarios = await ScenarioRepository.GetList();

            if (Game.Player1 != null)
            {
                User1Id = Game.Player1.Id;
            }
            else
            {
                User1Id = string.Empty;;
            }
            if (Game.Player2 != null)
            {
                User2Id = Game.Player2.Id;
            }
            else
            {
                User2Id = string.Empty;;
            }
            if (Game.ArmyPlayer1 != null)
            {
                ArmyPlayer1Id = Game.ArmyPlayer1.Id.ToString();
            }
            else
            {
                ArmyPlayer1Id = string.Empty;;
            }
            if (Game.ArmyPlayer2 != null)
            {
                ArmyPlayer2Id = Game.ArmyPlayer2.Id.ToString();
            }
            else
            {
                ArmyPlayer2Id = string.Empty;;
            }
            if (Game.GameTable != null)
            {
                GameTable = Game.GameTable.Id.ToString();
            }
            else
            {
                GameTable = string.Empty;;
            }
            if (Game.Scenario != null)
            {
                Scenario = Game.Scenario.Id.ToString();
            }
            else
            {
                Scenario = string.Empty;;
            }
        }