// validation protected async Task HandleValidSubmit() { if (MysteryViewModel.Attribute1 == NullOption) { MysteryViewModel.Attribute1 = null; } if (MysteryViewModel.Attribute2 == NullOption) { MysteryViewModel.Attribute2 = null; } if (MysteryViewModel.Jutsu1 == NullOption) { MysteryViewModel.Jutsu1 = null; } if (MysteryViewModel.Jutsu2 == NullOption) { MysteryViewModel.Jutsu2 = null; } if (MysteryViewModel.Causing == NullOption) { MysteryViewModel.Causing = null; } MysteryViewModel.BfCooldown = int.Parse(stringBFC); MysteryViewModel.Cooldown = int.Parse(stringCD); MysteryViewModel.Chakra = int.Parse(stringChakra); MysteryModel = MysteryViewModel; await MysteryViewModelService.UpdateMystery(long.Parse(Id), MysteryModel); NavigationManager.NavigateTo("mysteries"); }
// validation protected async Task HandleValidCreate() { if (MysteryViewModel.Attribute1 == NullOption) { MysteryViewModel.Attribute1 = null; } if (MysteryViewModel.Attribute2 == NullOption) { MysteryViewModel.Attribute2 = null; } if (MysteryViewModel.Jutsu1 == NullOption) { MysteryViewModel.Jutsu1 = null; } if (MysteryViewModel.Jutsu2 == NullOption) { MysteryViewModel.Jutsu2 = null; } if (MysteryViewModel.Causing == NullOption) { MysteryViewModel.Causing = null; } MysteryViewModel.BfCooldown = int.Parse(stringBFC); MysteryViewModel.Cooldown = int.Parse(stringCD); MysteryViewModel.Chakra = int.Parse(stringChakra); MysteryModel = MysteryViewModel; await MysteryViewModelService.CreateMystery(MysteryModel); Back_Click(); }
protected override async Task OnInitializedAsync() { MysteryModel = await MysteryViewModelService.GetMystery(long.Parse(Id)); stringBFC = Convert.ToString(MysteryViewModel.BfCooldown); stringCD = Convert.ToString(MysteryViewModel.Cooldown); stringChakra = Convert.ToString(MysteryViewModel.Chakra); BackRoute = $"mysteries/{Id}"; MysteryViewModel = MysteryModel; }