private void OkButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (String.IsNullOrEmpty(WebServiceNameTextBox.Text) || String.IsNullOrEmpty(WebServiceURLtextBox.Text))
                {
                    MessageBox.Show("Please, enter at least a webservice name and a webservice URL (including http:// or https://)", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.DialogResult = DialogResult.None;
                    return;
                }


                if (!isValidUrl(WebServiceURLtextBox.Text))
                {
                    MessageBox.Show("The url of the web service is not correct. Please enter a correct URL (including http:// or https://)", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.DialogResult = DialogResult.None;
                    return;
                }


                WebServiceURLtextBox.Text = (WebServiceURLtextBox.Text).Replace('\\', '/');
                _wsInfo = new MainApplicationSettings.WebServiceInfo(WebServiceNameTextBox.Text, WebServiceURLtextBox.Text);
                _wsInfo.WebService_Description  = WebServiceDescriptionTextBox.Text;
                _wsInfo.WebService_UserName     = WebServiceUserNameTextBox.Text;
                _wsInfo.WebService_Password     = WebServicePasswordTextBox.Text;
                _wsInfo.WebService_ReturnDetail = FullRadioButton.Checked ? MainApplicationSettings.WebServiceInfo.RETURN_DETAIL_IMPLEMENTATION.Full : ApplicationSettings.classes.services.ApplicationSettings.WebServiceInfo.RETURN_DETAIL_IMPLEMENTATION.CompleteStub;


                this.Close();
            }
            catch (Exception ex)
            {
                CommonItem.ErrManger.ErrorManagement(ex, false, this);
            }
        }
Пример #2
0
        private void WebServiceRemoveButton_Click_1(object sender, EventArgs e)
        {
            try
            {
                //inizio  this.CurrentWSToolStripLabel.Text

                MainApplicationSettings.WebServiceInfo tmpItem = (MainApplicationSettings.WebServiceInfo)WebServiceNameComboBox.SelectedItem;

                if (tmpItem != null)
                {
                    _tmp_settings.WebServices.Remove(tmpItem);

                    WebServiceDescriptionLabel.Text = "";
                    WebServiceURLLabel.Text         = "";
                    WebServiceUserNameLabel.Text    = "";
                    WebServicePasswordLabel.Text    = "";

                    WebServiceNameComboBox.Items.Remove(WebServiceNameComboBox.SelectedItem);
                    //this.SettingsCancelButton.Enabled = false;
                }
                else
                {
                    MessageBox.Show("Please select a webservice", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                //fine
            }
            catch (Exception ex)
            {
                CommonItem.ErrManger.ErrorManagement(ex, false, this);
            }
        }
Пример #3
0
        private void WebServiceModifyButton_Click_1(object sender, EventArgs e)
        {
            MainApplicationSettings.WebServiceInfo tmp = (MainApplicationSettings.WebServiceInfo)WebServiceNameComboBox.SelectedItem;
            if (tmp != null)
            {
                frmAddWebService frmMod = new frmAddWebService();
                frmMod.DetailImplementationVisible = true;
                frmMod.Modify = true;
                frmMod.WSInfo = tmp;

                if (frmMod.ShowDialog() == DialogResult.OK)
                {
                    _tmp_settings.WebServices.Remove(tmp);
                    _tmp_settings.WebServices.Add(frmMod.WSInfo);
                    WebServiceDescriptionLabel.Text = frmMod.WSInfo.WebService_Description;
                    WebServiceURLLabel.Text         = frmMod.WSInfo.WebService_public_URL;
                    WebServiceUserNameLabel.Text    = frmMod.WSInfo.WebService_UserName;
                    WebServicePasswordLabel.Text    = frmMod.WSInfo.WebService_Password;
                    WebServiceReturnDetailImplementationLabel.Text = frmMod.WSInfo.WebService_ReturnDetail.ToString();
                }
            }
            else
            {
                MessageBox.Show("Please select a webservice.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #4
0
 private void WebServiceNameComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         MainApplicationSettings.WebServiceInfo tmpWs = (MainApplicationSettings.WebServiceInfo)WebServiceNameComboBox.SelectedItem;
         this.WebServiceDescriptionLabel.Text = tmpWs.WebService_Description;
         this.WebServiceURLLabel.Text         = tmpWs.WebService_public_URL;
         this.WebServiceUserNameLabel.Text    = tmpWs.WebService_UserName;
         this.WebServicePasswordLabel.Text    = tmpWs.WebService_Password;
         this.WebServiceReturnDetailImplementationLabel.Text = tmpWs.WebService_ReturnDetail.ToString();
     }
     catch (Exception ex)
     {
         CommonItem.ErrManger.ErrorManagement(ex, false, this);
     }
 }
Пример #5
0
        private void frmSettings_Load(object sender, EventArgs e)
        {
            try
            {
                _tmp_settings             = new MainApplicationSettings();
                _tmp_settings.WebServices = new List <MainApplicationSettings.WebServiceInfo>();

                if (_tmp_settings.LoadSettings(false)[0] == ApplicationSettings.classes.common.CommonConst.Loading_Status.NOT_FOUND)
                {
                    return;
                }

                if (_tmp_settings.WebServices.Count > 0)
                {
                    foreach (MainApplicationSettings.WebServiceInfo wsInfo in _tmp_settings.WebServices)
                    {
                        WebServiceNameComboBox.Items.Add(wsInfo);
                    }

                    WebServiceNameComboBox.SelectedIndex = 0;
                    MainApplicationSettings.WebServiceInfo tmpWs = (MainApplicationSettings.WebServiceInfo)WebServiceNameComboBox.SelectedItem;
                    this.WebServiceDescriptionLabel.Text = tmpWs.WebService_Description;
                    this.WebServiceURLLabel.Text         = tmpWs.WebService_public_URL;
                    this.WebServiceUserNameLabel.Text    = tmpWs.WebService_UserName;
                    this.WebServicePasswordLabel.Text    = tmpWs.WebService_Password;
                    this.WebServiceReturnDetailImplementationLabel.Text = tmpWs.WebService_ReturnDetail.ToString();
                }

                SaveDBConnButton.Enabled   = false;
                RemoveDBConnButton.Enabled = false;
                _newDbConnection           = false;

                if (_tmp_settings.DBConnections != null)
                {
                    if (_tmp_settings.DBConnections.Count > 0)
                    {
                        this.DBConnectionsComboBox.Items.Clear();
                        foreach (MainApplicationSettings.DBInfo dbInfo in _tmp_settings.DBConnections)
                        {
                            this.DBConnectionsComboBox.Items.Add(dbInfo.DBConnectionName);
                        }
                        this.DBConnectionsComboBox.SelectedIndex = 0;
                        this.DBConnectionNameTextBox.Text        = _tmp_settings.DBConnections[0].DBConnectionName;
                        this.DbTypeComboBox.SelectedIndex        = DbTypeComboBox.FindStringExact(_tmp_settings.DBConnections[0].DBType.ToString());
                        this.DBUserNameTextBox.Text = _tmp_settings.DBConnections[0].UserName;
                        this.DBPasswordTextBox.Text = _tmp_settings.DBConnections[0].Pwd;
                        this.OracleTNSTextBox.Text  = _tmp_settings.DBConnections[0].TSNName;
                        RemoveDBConnButton.Enabled  = true;
                    }
                }

                if (_tmp_settings.InteractionWebService != null)
                {
                    this.IntWSlabelName.Text  = _tmp_settings.InteractionWebService.WebService_Name;
                    this.IntWSlabelDescr.Text = _tmp_settings.InteractionWebService.WebService_Description;
                    this.IntWSlabelUrl.Text   = _tmp_settings.InteractionWebService.WebService_public_URL;
                    this.IntWSlabelUser.Text  = _tmp_settings.InteractionWebService.WebService_UserName;
                    this.IntWSlabelPwd.Text   = _tmp_settings.InteractionWebService.WebService_Password;
                }

                if (_tmp_settings.ValidationWebService != null)
                {
                    this.ValWSlabelName.Text        = _tmp_settings.ValidationWebService.WebService_Name;
                    this.ValWSlabelDescription.Text = _tmp_settings.ValidationWebService.WebService_Description;
                    this.ValWSlabelWSUrl.Text       = _tmp_settings.ValidationWebService.WebService_public_URL;
                    this.ValWSlabelUser.Text        = _tmp_settings.ValidationWebService.WebService_UserName;
                    this.ValWSlabelPwd.Text         = _tmp_settings.ValidationWebService.WebService_Password;
                }

                this.TIME_PERIODTextBox.Text = _tmp_settings.TIME_PERIOD_default_valueDomainID;
                this.OBS_VALUEtextBox.Text   = _tmp_settings.OBS_default_valueDomainID;

                //Initialize provider
                //InitializeProviders();
            }
            catch (Exception ex)
            {
                CommonItem.ErrManger.ErrorManagement(ex, false, this);
            }
        }