void wc_ws_selectNextCalibrationsCompleted(object sender, ws_selectNextCalibrationsCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                c_collection_next = new PagedCollectionView(e.Result);

                IEnumerable<wsCalibration> next = from item in e.Result where item.plannedDate > DateTime.Now select item;
                IEnumerable<wsCalibration> missed = from item in e.Result where item.plannedDate <= DateTime.Now select item;
                IEnumerable<wsCalibration> not = from item in e.Result where item.plannedDate == null select item;

                c_collection_next = new PagedCollectionView(next);
                c_collection_missed = new PagedCollectionView(missed);
                c_collection_not = new PagedCollectionView(not);

                dg_NextWeek.ItemsSource = c_collection_next;
                dg_Missed.ItemsSource = c_collection_missed;
                dg_Not.ItemsSource = c_collection_not;

                txt_nextCaption.Text = "Период поверки устройств истекает в ближайшую неделю (список на дату: "+ DateTime.Now.Date + ")";
                txt_missedCaption.Text = "Поверка просрочена (список на дату: " + DateTime.Now.Date + ")";
                txt_notCaption.Text = "Отсутствуют сведения  поверке (список на дату: " + DateTime.Now.Date + ")"; 
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }   
        }
Exemple #2
0
        void wc_ws_selectNextCalibrationsCompleted(object sender, ws_selectNextCalibrationsCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                c_collection_next = new PagedCollectionView(e.Result);

                IEnumerable <wsCalibration> next   = from item in e.Result where item.plannedDate > DateTime.Now select item;
                IEnumerable <wsCalibration> missed = from item in e.Result where item.plannedDate <= DateTime.Now select item;
                IEnumerable <wsCalibration> not    = from item in e.Result where item.plannedDate == null select item;

                c_collection_next   = new PagedCollectionView(next);
                c_collection_missed = new PagedCollectionView(missed);
                c_collection_not    = new PagedCollectionView(not);

                dg_NextWeek.ItemsSource = c_collection_next;
                dg_Missed.ItemsSource   = c_collection_missed;
                dg_Not.ItemsSource      = c_collection_not;

                txt_nextCaption.Text   = "Период поверки устройств истекает в ближайшую неделю (список на дату: " + DateTime.Now.Date + ")";
                txt_missedCaption.Text = "Поверка просрочена (список на дату: " + DateTime.Now.Date + ")";
                txt_notCaption.Text    = "Отсутствуют сведения  поверке (список на дату: " + DateTime.Now.Date + ")";
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }