/********************************************* 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(); } }
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(); } }
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(); } }
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_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_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(); } }
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(); } }
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(); } }
// --- 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(); } }
// --- 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_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(); } }
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(); } }