Пример #1
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;
        }
Пример #2
0
        void wc_ws_TestDBConnectionCompleted(object sender, WS_Link.ws_TestDBConnectionCompletedEventArgs e)
        {
            SolidColorBrush brush1 = new SolidColorBrush(Colors.Gray);

            if (e.Result != 0)
            {
                txt_result.Text           = e.OpStatus.ToString();
                brush1.Color              = Colors.Green;
                txt_AuthResult.Foreground = brush1;
            }
            else
            {
                brush1.Color          = Colors.Red;
                txt_result.Foreground = brush1;
                Views.InfoWindow iw = new Views.InfoWindow("Ошибка связи", e.OpStatus.ToString());
                iw.Show();
            }
        }
Пример #3
0
        void wc_ws_TestAuthConnectionCompleted(object sender, WS_Link.ws_TestAuthConnectionCompletedEventArgs e)
        {
            SolidColorBrush brush1 = new SolidColorBrush(Colors.Gray);
            
            if (e.Result != 0)
            {
                txt_AuthResult.Text = e.OpStatus.ToString();
                brush1.Color = Colors.Green;
                txt_AuthResult.Foreground = brush1;
            }
            else
            {
                brush1.Color = Colors.Red;
                txt_AuthResult.Foreground = brush1;
                Views.InfoWindow iw = new Views.InfoWindow("Ошибка связи", e.OpStatus.ToString());
                iw.Show();
            }


        }
Пример #4
0
 private void btn_deleteProducer_Click(object sender, RoutedEventArgs e)
 {
     producerType = list_Catalogs.SelectedItem as wsProducerType;
     if (producerType != null)
     {
         wc.ws_checkProducerAsync((int)producerType.ProducerID);
     }
     else
     {
         InfoWindow iw = new InfoWindow(Messages.m_Message,"Не выбран элемент для удаления");
         iw.Show();
     }
 }
Пример #5
0
/********************************************* 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();
            }
        }
Пример #6
0
//*************** ОБРАБОТКА КНОПОК ******************************************

        //---- Button shows InsertDevice Form
        private void btn_show_insertForm_Click(object sender, RoutedEventArgs e)
        {
            
            if (tree_Devices.SelectedItem != null)
            {
                string s;
                int typeID;

                if (SN.IsType)
                {
                    s = SN.name;
                    typeID = SN.id;
                }
                else
                {
                    s = SN.parentName;
                    typeID = SN.parentID;
                }

                show_InsertForm();
                show_Passport('W', typeID);
                tab_InsertDevice.Header = "Добавить в раздел \"" + s + "\"";
            }
            else
            {
                InfoWindow iw = new InfoWindow(Messages.m_Warning, Messages.m_treeItemIsNotSelected);
                iw.Show();
            }
        }