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();
            }   
        }
Beispiel #2
0
        void wc_ws_selectDBTreeCompleted(object sender, WS_Link.ws_selectDBTreeCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                DBTree DBTREE = new DBTree();
                DBTREE.DBDATA = e.Result.DBDATA;

                Node NNODE = new Node(DBTREE.GetAnyNodeinDB);

                tree_Models.ItemsSource = NNODE.chldlist;

                tree_Models.UpdateLayout();
                if (tree_Models.Items.Count > 0)
                {
                    TreeViewItem item = tree_Models.ItemContainerGenerator.ContainerFromItem(tree_Models.Items[0]) as TreeViewItem;
                    if (item != null)
                    {
                        item.IsSelected = true;
                    }
                }
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }
        void wc_ws_selectDeviceCalibrationsCompleted(object sender, ws_selectDeviceCalibrationsCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                if (e.Result.Count > 0)
                {
                    dg_Calibration.Visibility = Visibility.Visible;
                    no_Calibration.Visibility = Visibility.Collapsed;

                    PagedCollectionView collection = new PagedCollectionView(e.Result);

                    dg_Calibration.ItemsSource = collection;

                }
                else
                {
                    dg_Calibration.Visibility = Visibility.Collapsed;
                    no_Calibration.Visibility = Visibility.Visible;
                }
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }
        void wc_ws_selectDeviceWorkStatesCompleted(object sender, ws_selectDeviceWorkStatesCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                WSt = e.Result;

                WSt.Description = this.uc_descripton;

                if (WSt.list_SCADAMessages.Count <= 0)
                {
                    dg_Root.Visibility = Visibility.Collapsed;
                    panel_NoInfo.Visibility = Visibility.Visible;
                }
                else
                {
                    dg_Root.Visibility = Visibility.Visible;
                    panel_NoInfo.Visibility = Visibility.Collapsed;
                }

                LayoutRoot.DataContext = WSt;

                if (box_ed.Items.Count >0)
                    box_ed.SelectedIndex = 0;
                
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }         
        }
Beispiel #5
0
 //---- Удаление элемента(ов)
 void wc_ws_deleteTreeItemCompleted(object sender, WS_Link.ws_deleteTreeItemCompletedEventArgs e)
 {
     if (e.Result != 0)
     {
         wc.ws_selectTreeItemsListAsync((int)(tree_Devices.SelectedItem as Node).bi.ID);
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_DELETE, e.OpStatus.ToString());
         w.Show();
     }
 }
 void wc_ws_ins_upd_PeriodCompleted(object sender, ws_ins_upd_PeriodCompletedEventArgs e)
 {
     if (e.Result != 0)
     {
         wc.ws_selectModelsAsync();
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_UPDATE, e.OpStatus.ToString());
         w.Show();
     }
 }
 void wc_ws_insertCalibrationCompleted(object sender, ws_insertCalibrationCompletedEventArgs e)
 {
     if (e.Result != 0)
     {
         this.DialogResult = true;
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_INSERT, e.OpStatus.ToString());
         w.Show();
     }
 }
Beispiel #8
0
 // Вставить Place
 void wc_ws_insertPlaceCompleted(object sender, WS_Link.ws_insertPlaceCompletedEventArgs e)
 {
     if (e.Result == 1)
     {
         wc.ws_selectDBTreeAsync(1);
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_INSERT, e.OpStatus.ToString());
         w.Show();
     }
 }
Beispiel #9
0
 void wc_ws_insertCalibrationCompleted(object sender, ws_insertCalibrationCompletedEventArgs e)
 {
     if (e.Result != 0)
     {
         this.DialogResult = true;
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_INSERT, e.OpStatus.ToString());
         w.Show();
     }
 }
Beispiel #10
0
 void wc_ws_deleteProducerCompleted(object sender, WS_Link.ws_deleteProducerCompletedEventArgs e)
 {
     if (e.Result == 1)
     {
         wc.ws_selectProducersListAsync();
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_DELETE, e.OpStatus.ToString());
         w.Show();
     }
 }
Beispiel #11
0
 void wc_ws_selectCalibrationTypesCompleted(object sender, ws_selectCalibrationTypesCompletedEventArgs e)
 {
     if (e.Result != null)
     {
         cbox_type.ItemsSource   = e.Result;
         cbox_type.SelectedIndex = 0;
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
         w.Show();
     }
 }
 void wc_ws_selectCalibrationTypesCompleted(object sender, ws_selectCalibrationTypesCompletedEventArgs e)
 {
     if (e.Result != null)
     {
         cbox_type.ItemsSource = e.Result;
         cbox_type.SelectedIndex = 0;
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
         w.Show();
     }
 }
 void wc_ws_updateNodeCompleted(object sender, WS_Link.ws_updateNodeCompletedEventArgs e)
 {
     if (e.Result == 1)
     {
         w.txt_Message.Text = "Раздел обновлен";
         w.Show();
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_UPDATE, e.OpStatus.ToString());
         w.Show();
     }
 }
Beispiel #14
0
 void wc_ws_helperTypesListCompleted(object sender, ws_helperTypesListCompletedEventArgs e)
 {
     if (e.Result != null)
     {
         helperTypes            = e.Result;
         auto_types.ItemsSource = helperTypes;
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
         w.Show();
     }
 }
Beispiel #15
0
 void wc_ws_selectModelsListCompleted(object sender, WS_Link.ws_selectModelsListCompletedEventArgs e)
 {
     if (e.Result != null)
     {
         DataTemplate dt = Resources["listSimpleItemTemplate"] as DataTemplate;
         list_Catalogs.ItemTemplate = dt;
         list_Catalogs.ItemsSource  = e.Result;
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
         w.Show();
     }
 }
Beispiel #16
0
        void wc_ws_selectModelsCompleted(object sender, ws_selectModelsCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                collection = new PagedCollectionView(e.Result);

                dg_Models.ItemsSource = collection;
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_UPDATE, e.OpStatus.ToString());
                w.Show();
            }
        }
 void wc_ws_selectDBTreeCompleted(object sender, ws_selectDBTreeCompletedEventArgs e)
 {
     if (e.Result != null)
     {
         DBTree DBTREE = new DBTree();
         DBTREE.DBDATA = e.Result.DBDATA;
         Node NNODE = new Node(DBTREE.GetAnyNodeinDB);
         tree_chooseType.ItemsSource = NNODE.chldlist;
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
         w.Show();
     }  
 }
Beispiel #18
0
        void wc_ws_updateProducerCompleted(object sender, ws_updateProducerCompletedEventArgs e)
        {
            if (e.Result == 1)
            {
                InfoWindow iw = new InfoWindow(Messages.m_Message, Messages.m_ProduserUpdated);
                iw.Show();
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_UPDATE, e.OpStatus.ToString());
                w.Show();
            }

            this.DialogResult = true;
        }
        void wc_ws_updateProducerCompleted(object sender, ws_updateProducerCompletedEventArgs e)
        {

            if (e.Result == 1)
            {
                InfoWindow iw = new InfoWindow(Messages.m_Message, Messages.m_ProduserUpdated);
                iw.Show();
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_UPDATE, e.OpStatus.ToString());
                w.Show();
            }

            this.DialogResult = true;
        }
Beispiel #20
0
 void wc_ws_checkProducerCompleted(object sender, WS_Link.ws_checkProducerCompletedEventArgs e)
 {
     if (e.Result != null)
     {
         int r = e.OpValue;
         ObservableCollection <wsSimpleItem> slist = e.Result;
         cwnd_ResultToDBGrid cw = new cwnd_ResultToDBGrid(e.OpStatus, slist);
         cw.Show();
         cw.Closed += new EventHandler(cw_Closed);
     }
     else if (e.Result == null)
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_DB, e.OpStatus.ToString());
         w.Show();
     }
 }
Beispiel #21
0
        //---- Список элементов по месту
        void wc_ws_selectDevListByPlaceCompleted(object sender, ws_selectDevListByPlaceCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                ItemsByPlace           = new PagedCollectionView(e.Result);
                ItemsByPlace.PageSize  = DevList_PageSize;
                dp_Pager.Source        = ItemsByPlace;
                dg_DevList.ItemsSource = ItemsByPlace;

                txt_NodeName.Text = e.Path;
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }
        void wc_ws_insertProducerCompleted(object sender, ws_insertProducerCompletedEventArgs e)
        {
            if (e.Result != 0)
            {
                ucResult = 2;
                ucPID = globalProducer.ProducerID;
                resultChildWindow.init(Messages.m_Message, Messages.m_ProducerInserted);
                resultChildWindow.Show();
                resultChildWindow.Closed += new EventHandler(resultChildWindowW_Closed);
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_UPDATE, e.OpStatus.ToString());
                w.Show();
            }

        }
Beispiel #23
0
        void wc_ws_selectPassportsListCompleted(object sender, ws_selectPassportsListCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                devicesCollection = new PagedCollectionView(e.Result);

                devicesCollection.PageSize = 20;

                dg_Devices.ItemsSource = devicesCollection;
                dp_Pager.Source        = devicesCollection;
                //txt_ItemsCount.Text = "Всего устройств в базе: " + devicesCollection.Count.ToString();
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }
Beispiel #24
0
        void wc_ws_selectPassportsListCompleted(object sender, ws_selectPassportsListCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                devicesCollection = new PagedCollectionView(e.Result);
              
                devicesCollection.PageSize = 20;

                dg_Devices.ItemsSource = devicesCollection;
                dp_Pager.Source = devicesCollection;
                //txt_ItemsCount.Text = "Всего устройств в базе: " + devicesCollection.Count.ToString();
                
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }
Beispiel #25
0
        //---- Список элементов по типу
        void wc_ws_selectTreeItemsListCompleted(object sender, ws_selectTreeItemsListCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                ItemsByType            = new PagedCollectionView(e.Result);
                ItemsByType.PageSize   = DevList_PageSize;
                dp_Pager.Source        = ItemsByType;
                dg_DevList.ItemsSource = ItemsByType;


                tabControl_Device.SelectedIndex = tabControl_Device.Items.IndexOf(tab_DevList);

                txt_NodeName.Text = e.Path;
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }
Beispiel #26
0
        void wc_ws_selectDBTreeCompleted(object sender, WS_Link.ws_selectDBTreeCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                DBTree DBTREE = new DBTree();
                DBTREE.DBDATA = e.Result.DBDATA;

                Node NNODE = new Node(DBTREE.GetAnyNodeinDB);

                tree_Models.ItemsSource = NNODE.chldlist;

                tree_Models.UpdateLayout();
                if (tree_Models.Items.Count > 0)
                {
                    TreeViewItem item = tree_Models.ItemContainerGenerator.ContainerFromItem(tree_Models.Items[0]) as TreeViewItem;
                    if (item != null)
                    {
                        item.IsSelected = true;
                    }
                }
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }
Beispiel #27
0
 void wc_ws_selectModelsListCompleted(object sender, WS_Link.ws_selectModelsListCompletedEventArgs e)
 {
     if (e.Result != null)
     {
         DataTemplate dt = Resources["listSimpleItemTemplate"] as DataTemplate;
         list_Catalogs.ItemTemplate = dt;
         list_Catalogs.ItemsSource = e.Result;
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
         w.Show();
     }
 }
Beispiel #28
0
 void wc_ws_deleteProducerCompleted(object sender, WS_Link.ws_deleteProducerCompletedEventArgs e)
 {
     if (e.Result == 1)
     {
         wc.ws_selectProducersListAsync();
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_DELETE, e.OpStatus.ToString());
         w.Show();
     }
 }
Beispiel #29
0
        void wc_ws_checkProducerCompleted(object sender, WS_Link.ws_checkProducerCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                int r = e.OpValue;
                ObservableCollection<wsSimpleItem> slist = e.Result;
                cwnd_ResultToDBGrid cw = new cwnd_ResultToDBGrid(e.OpStatus,slist);
                cw.Show();
                cw.Closed += new EventHandler(cw_Closed);
 
            }
            else if (e.Result == null)
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_DB, e.OpStatus.ToString());
                w.Show();
            }
        }
Beispiel #30
0
 //---- Удаление элемента(ов)
 void wc_ws_deleteTreeItemCompleted(object sender, WS_Link.ws_deleteTreeItemCompletedEventArgs e)
 {
     if (e.Result != 0)
     {
         wc.ws_selectTreeItemsListAsync((int)(tree_Devices.SelectedItem as Node).bi.ID);
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_DELETE, e.OpStatus.ToString());
         w.Show();
     }
 }
Beispiel #31
0
 void wc_ws_helperTypesListCompleted(object sender, ws_helperTypesListCompletedEventArgs e)
 {
     if (e.Result != null)
     {
         helperTypes = e.Result;
         auto_types.ItemsSource = helperTypes;
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
         w.Show();
     }
 }
        void wc_ws_selectPassport_EXCompleted(object sender, ws_selectPassport_EXCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                Ex_Pass = e.Result;

                grid_Passport_EX.DataContext = Ex_Pass;

                DBTree DBTREEmodels = new DBTree();

                DBTREEmodels.DBDATA = e.Result.tbl_Models;

                Node treeModels = new Node(DBTREEmodels.GetAnyNodeinDB);

                globalTreeModels = treeModels;
                globalListModels = globalTreeModels.getListByLevel(1, null);
                cbox_ModelsList.ItemsSource = globalListModels;

                //cbox_ProducersList.ItemsSource = Ex_Pass.list_Producers;
                //auto_DevDescrRU.ItemsSource = Ex_Pass.helper_DevDescr;

                if (cbox_ModelsList.Items.Count > 0)
                {
                    cbox_ModelsList.SelectedIndex = ScoDe.SetBoxIndex_wsSimpleItem(cbox_ModelsList, Ex_Pass.DevModelID);
                }

                if (cbox_ProducersList.Items.Count > 0)
                {
                    cbox_ProducersList.SelectedIndex = ScoDe.SetBoxIndex_wsProducerType(cbox_ProducersList, Ex_Pass.ProducerID);
                }
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }            
        }
Beispiel #33
0
        //---- Список элементов по типу
        void wc_ws_selectTreeItemsListCompleted(object sender, ws_selectTreeItemsListCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                ItemsByType = new PagedCollectionView(e.Result);
                ItemsByType.PageSize = DevList_PageSize;
                dp_Pager.Source = ItemsByType;
                dg_DevList.ItemsSource = ItemsByType;


                tabControl_Device.SelectedIndex = tabControl_Device.Items.IndexOf(tab_DevList);

                txt_NodeName.Text = e.Path;
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }
Beispiel #34
0
        //---- Список элементов по месту
        void wc_ws_selectDevListByPlaceCompleted(object sender, ws_selectDevListByPlaceCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                ItemsByPlace = new PagedCollectionView(e.Result);
                ItemsByPlace.PageSize = DevList_PageSize;
                dp_Pager.Source = ItemsByPlace;
                dg_DevList.ItemsSource = ItemsByPlace;

                txt_NodeName.Text = e.Path;
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }
Beispiel #35
0
 // Вставить Place
 void wc_ws_insertPlaceCompleted(object sender, WS_Link.ws_insertPlaceCompletedEventArgs e)
 {
     if (e.Result == 1)
     {
         wc.ws_selectDBTreeAsync(1);
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_INSERT, e.OpStatus.ToString());
         w.Show();
     }
 }
 // --- Update Passport
 void wc_ws_updatePassportCompleted(object sender, ws_updatePassportCompletedEventArgs e)
 {
     if (e.Result == 1)
     {
         ucResult = 1;
         ucPID = Ex_Pass.DevID;
         resultChildWindow.init(Messages.m_Message, Messages.m_PassportUpdated);
         resultChildWindow.Show();
         resultChildWindow.Closed += new EventHandler(resultChildWindow_Closed);
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_UPDATE, e.OpStatus.ToString());
         w.Show();
     }
 }
        void wc_ws_selectProducersDataCompleted(object sender, ws_selectProducersDataCompletedEventArgs e)
        {
            if (e.Result != null)
            {

                globalProducer = e.Result;
                grid_ProducerType.DataContext = globalProducer;

            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }
 // --- Insert Passport
 void wc_ws_insertPassportCompleted(object sender, ws_insertPassportCompletedEventArgs e)
 {
     if (e.Result == 1)
     {
         ucResult = 2;
         resultChildWindow.init(Messages.m_Message, Messages.m_PassportInserted);
         resultChildWindow.Show();
         //resultChildWindow.Closed +=new EventHandler(resultChildWindow_Closed);
     }
     else
     {
         cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_INSERT, e.OpStatus.ToString());
         w.Show();
     }
 }
/********************************************* HANDLERS *******************************************************************/ 

        // --- Check ProducerType data before insert/update Passport
        void wc_ws_checkPassportProducerCompleted(object sender, ws_checkPassportProducerCompletedEventArgs e)
        {
            int i = e.OpValue;
            string s = e.OpStatus;

            if (e.Result == 1)
            {
                switch (ucMode)
                {
                    case 'U': // mode_U
                        wc.ws_updatePassportAsync(Ex_Pass);
                        break;
                    case 'W': // mode_W
                        wc.ws_insertPassportAsync(Ex_Pass, (int)ucPID);
                        break;
                }
            }
            else if (e.OpValue == 50017)
            {
                InfoWindow w = new InfoWindow(Messages.m_Warning, e.OpStatus.ToString());
                w.Show();
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_DB, e.OpStatus.ToString());
                w.Show();
            }
        }