private async void NotificationGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (NotificationGridView.CurrentRow?.DataBoundItem is NotificationModel currentNumber) { if (!currentNumber.IsRead) { await Task.Run(() => { currentNumber.IsRead = _notificationService.UpdateReadNotification(currentNumber.Id); Principal?.UpdatedUnreadNotification(); }); NotificationGridView.Refresh(); } if (currentNumber.IsSuccess || (currentNumber.Message?.ToLower().Contains(ApplicationConstant.NotificationError) ?? false)) { DownloadWeightBtn.Enabled = true; if (currentNumber.Message?.ToLower().Contains(ApplicationConstant.NotificationError) ?? false) { DownloadWeightBtn.Text = "Download Log"; } else { DownloadWeightBtn.Text = "Download Model"; } } else { DownloadWeightBtn.Enabled = false; } } }
private async void NotificationGridView_RowLeave(object sender, DataGridViewCellEventArgs e) { if (NotificationGridView.CurrentRow?.DataBoundItem is NotificationModel currentNumber) { if (!currentNumber.IsRead) { await Task.Run(() => { currentNumber.IsRead = _notificationService.UpdateReadNotification(currentNumber.Id); Principal?.UpdatedUnreadNotification(); }); NotificationGridView.Refresh(); } } }