コード例 #1
0
        public void GetNotifications()
        {
            lbl_Status.Content = "";
            dgNotificationsDetails.ItemsSource = null;
            List <rsp_N_GetNotificationsResult> lstNotifications = Notifications.CreateInstance().GetNotifications();

            dgNotificationsDetails.ItemsSource = lstNotifications;
            dgNotificationsDetails.Tag         = lstNotifications;
            this.DataContext = lstNotifications;
        }
コード例 #2
0
        private void btn_Clear_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string sNotificationId = string.Empty;

                List <rsp_N_GetNotificationsResult> lstReadLiquidation = dgNotificationsDetails.SelectedItems.Cast <rsp_N_GetNotificationsResult>().ToList();

                if (lstReadLiquidation != null)
                {
                    foreach (var v in lstReadLiquidation)
                    {
                        sNotificationId += "," + v.NotificationID.ToString();
                    }

                    if (!String.IsNullOrEmpty(sNotificationId))
                    {
                        sNotificationId = sNotificationId.Remove(0, 1);
                    }

                    if (!String.IsNullOrEmpty(sNotificationId))
                    {
                        int result = Notifications.CreateInstance().UpdateNotifications(sNotificationId, Security.SecurityHelper.CurrentUser.SecurityUserID);
                        cb_SelectAll.IsChecked = false;
                        GetNotifications();
                    }
                    else
                    {
                        lbl_Status.Content = "Select notifications to clear.";
                        return;
                    }
                }
                else
                {
                    lbl_Status.Content = "Select notifications to clear.";
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
        }