protected async Task ConfirmDelete_Click(bool deleteConfirmed) { if (deleteConfirmed == true) { await ChaseViewModel.DeleteChase(long.Parse(Id)); NavigationManager.NavigateTo("chases"); } }
protected override async Task OnInitializedAsync() { Random random = new Random(); randomNumber = random.Next(0, BackgroundImages.Length); NinjaList = await NinjaViewModel.GetNinjaList(); foreach (Ninja i in NinjaList) { i.Mystery = await MysteryViewModel.GetMystery(i.MysteryId); i.Attack = await AttackViewModel.GetAttack(i.AttackId); if (i.ChaseId1 != null) { i.Chases[0] = await ChaseViewModel.GetChase((long)i.ChaseId1); } if (i.ChaseId2 != null) { i.Chases[1] = await ChaseViewModel.GetChase((long)i.ChaseId2); } if (i.ChaseId3 != null) { i.Chases[2] = await ChaseViewModel.GetChase((long)i.ChaseId3); } if (i.PassiveId1 != null) { i.Passives[0] = await PassiveViewModel.GetPassive((long)i.PassiveId1); } if (i.PassiveId2 != null) { i.Passives[1] = await PassiveViewModel.GetPassive((long)i.PassiveId2); } if (i.PassiveId3 != null) { i.Passives[2] = await PassiveViewModel.GetPassive((long)i.PassiveId3); } } FilteredList = NinjaList; }
protected override async Task OnInitializedAsync() { NinjaList = await NinjaViewModel.GetNinjaList(); foreach (Ninja i in NinjaList) { i.Mystery = await MysteryViewModel.GetMystery(i.MysteryId); i.Attack = await AttackViewModel.GetAttack(i.AttackId); if (i.ChaseId1 != null) { i.Chases[0] = await ChaseViewModel.GetChase((long)i.ChaseId1); } if (i.ChaseId2 != null) { i.Chases[1] = await ChaseViewModel.GetChase((long)i.ChaseId2); } if (i.ChaseId3 != null) { i.Chases[2] = await ChaseViewModel.GetChase((long)i.ChaseId3); } if (i.PassiveId1 != null) { i.Passives[0] = await PassiveViewModel.GetPassive((long)i.PassiveId1); } if (i.PassiveId2 != null) { i.Passives[1] = await PassiveViewModel.GetPassive((long)i.PassiveId2); } if (i.PassiveId3 != null) { i.Passives[2] = await PassiveViewModel.GetPassive((long)i.PassiveId3); } } FilteredList = NinjaList; }
protected override async Task OnInitializedAsync() { EditRoute = $"ninjas/edit/{Id}"; NinjaModel = await NinjaViewModel.GetNinja(Id); NinjaModel.Mystery = await MysteryViewModel.GetMystery(NinjaModel.MysteryId); NinjaModel.Attack = await AttackViewModel.GetAttack(NinjaModel.AttackId); if (NinjaModel.ChaseId1 != null) { NinjaModel.Chases[0] = await ChaseViewModel.GetChase((long)NinjaModel.ChaseId1); } if (NinjaModel.ChaseId2 != null) { NinjaModel.Chases[1] = await ChaseViewModel.GetChase((long)NinjaModel.ChaseId2); } if (NinjaModel.ChaseId3 != null) { NinjaModel.Chases[2] = await ChaseViewModel.GetChase((long)NinjaModel.ChaseId3); } if (NinjaModel.PassiveId1 != null) { NinjaModel.Passives[0] = await PassiveViewModel.GetPassive((long)NinjaModel.PassiveId1); } if (NinjaModel.PassiveId2 != null) { NinjaModel.Passives[1] = await PassiveViewModel.GetPassive((long)NinjaModel.PassiveId2); } if (NinjaModel.PassiveId3 != null) { NinjaModel.Passives[2] = await PassiveViewModel.GetPassive((long)NinjaModel.PassiveId3); } }
protected override async Task OnInitializedAsync() { ChaseList = await ChaseViewModel.GetChaseList(); FilteredList = ChaseList; }
protected override async Task OnInitializedAsync() { StarsList = new List <int> { 1, 2, 3, 4, 5 }; NullOption = "None"; BackRoute = $"ninjas/{Id}"; NinjaModel = await NinjaViewModelService.GetNinja(long.Parse(Id)); Mysteries = await MysteryViewModel.GetMysteryList(); Attacks = await AttackViewModel.GetAttackList(); Chases = await ChaseViewModel.GetChaseList(); Passives = await PassiveViewModel.GetPassiveList(); MysIdString = NinjaModel.MysteryId.ToString(); AttIdString = NinjaModel.AttackId.ToString(); if (NinjaModel.ChaseId1 != null) { ChaseId1S = NinjaModel.ChaseId1.ToString(); } else { ChaseId1S = NullOption; } if (NinjaModel.ChaseId2 != null) { ChaseId2S = NinjaModel.ChaseId2.ToString(); } else { ChaseId2S = NullOption; } if (NinjaModel.ChaseId3 != null) { ChaseId3S = NinjaModel.ChaseId3.ToString(); } else { ChaseId3S = NullOption; } if (NinjaModel.PassiveId1 != null) { PassiveId1S = NinjaModel.PassiveId1.ToString(); } else { PassiveId1S = NullOption; } if (NinjaModel.PassiveId2 != null) { PassiveId2S = NinjaModel.PassiveId2.ToString(); } else { PassiveId2S = NullOption; } if (NinjaModel.PassiveId3 != null) { PassiveId3S = NinjaModel.PassiveId3.ToString(); } else { PassiveId3S = NullOption; } StarsString = NinjaModel.Stars.ToString(); NinjaViewModel = NinjaModel; }
protected override async Task OnInitializedAsync() { EditRoute = $"chases/edit/{Id}"; ChaseModel = await ChaseViewModel.GetChase(long.Parse(Id)); }
protected override async Task OnInitializedAsync() { NullOption = "None"; Mysteries = await MysteryViewModel.GetMysteryList(); Attacks = await AttackViewModel.GetAttackList(); Chases = await ChaseViewModel.GetChaseList(); Passives = await PassiveViewModel.GetPassiveList(); if (NinjaModel.ChaseId1 != null) { ChaseId1S = NinjaModel.ChaseId1.ToString(); } else { ChaseId1S = NullOption; } if (NinjaModel.ChaseId2 != null) { ChaseId2S = NinjaModel.ChaseId2.ToString(); } else { ChaseId2S = NullOption; } if (NinjaModel.ChaseId3 != null) { ChaseId3S = NinjaModel.ChaseId3.ToString(); } else { ChaseId3S = NullOption; } if (NinjaModel.PassiveId1 != null) { PassiveId1S = NinjaModel.PassiveId1.ToString(); } else { PassiveId1S = NullOption; } if (NinjaModel.PassiveId2 != null) { PassiveId2S = NinjaModel.PassiveId2.ToString(); } else { PassiveId2S = NullOption; } if (NinjaModel.PassiveId3 != null) { PassiveId3S = NinjaModel.PassiveId3.ToString(); } else { PassiveId3S = NullOption; } StarsString = NinjaModel.Stars.ToString(); NinjaViewModel = NinjaModel; }