Exemplo n.º 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            Properties.Settings App = new Properties.Settings();
            // провереям подключение к WebService
            var    client = new EDIWebServiceSoapClient("EDIWebServiceSoap");
            string result = client.Relationships(App.LoginWebService, App.PasswordWebService, 1000).Res;

            client.Close();
            if (!String.IsNullOrEmpty(SoapRequest.ResultWebRequest(result)))
            {
                MessageBox.Show(SoapRequest.ResultWebRequest(result), "Подключения к WebService", MessageBoxButton.OK, MessageBoxImage.Error);
                SettingWebSerice settingForm = new SettingWebSerice();
                settingForm.ShowDialog();
                // перезагружаем приложение
                System.Diagnostics.Process.Start(Application.ResourceAssembly.Location);
                Application.Current.Shutdown();
            }

            // проверяем подключения к бд
            if (!StatusApp.CheckConnection())
            {
                MessageBox.Show("Нет соединение с базой данных , проверьте параметры подключения или обратитесь к системному администратору ", "Cоединение с базой данных", MessageBoxButton.OK, MessageBoxImage.Hand);
                ConnectionDataBase.ChangeConnect();
            }
        }
Exemplo n.º 2
0
        private void menuSettings_Click(object sender, RoutedEventArgs e)
        {
            SettingWebSerice setting = new SettingWebSerice();

            setting.ShowDialog();
            RestartApp();
        }