protected async override Task OnInitializedAsync() { NotificationValues = await SessionStorageService.GetItemAsync <NotificationNames>(Id); DefaultSelectedNotificationType = "Select Notification Type"; DefaultSelectedNotificationChannel = "Select Notification Channel"; if (!string.IsNullOrEmpty(Id)) { var id = int.Parse(Id); if (id > 0) { notificationTemplateCrtVM = await NotificationTemplateService.FetchByIdAsync(id); NotificationId = notificationTemplateCrtVM.Id; DefaultSelectedNotificationType = NotificationValues.NotificationTypeName == null ? DefaultSelectedNotificationType = "Select Notification Type" : NotificationValues.NotificationTypeName; DefaultSelectedNotificationChannel = NotificationValues.NotificationChannelName == null ? DefaultSelectedNotificationChannel = "Select Notification Channel" : NotificationValues.NotificationChannelName; } notificationTypeVMs = await NotificationTypeService.FetchAllAsync(); notificationChannelVMs = await NotificationChannelService.FetchAllAsync(); } }
protected async Task CrtOrUptNotificationChannel() { if (NotificationId > 0) { await NotificationChannelService.UpdateAsync(NotificationChannelCrtVM); } else { await NotificationChannelService.CreateAsync(NotificationChannelCrtVM); } navigationManager.NavigateTo("/notificationchannel"); }
protected async override Task OnInitializedAsync() { if (!string.IsNullOrEmpty(Id)) { var id = int.Parse(Id); if (id > 0) { NotificationChannelCrtVM = await NotificationChannelService.FetchByIdAsync(id); NotificationId = NotificationChannelCrtVM.Id; } } }
protected async Task DeleteNotificationChannel(int id) { bool?result = await DialogService.Confirm("Are you sure?", "DELETE NOTIFICATION CHANNEL", new ConfirmOptions() { OkButtonText = "Yes", CancelButtonText = "No", ShowClose = false }); if (result.Value == true) { var deletedNotification = await NotificationChannelService.DeleteAsync(id); if (deletedNotification > 0) { } else { } } }
protected async override Task OnInitializedAsync() { notificationChannelVM = await NotificationChannelService.FetchAllAsync(); }