示例#1
0
        private void cmbDatabase_DropDown(object sender, EventArgs e)
        {
            try
            {
                if (txtUrl.Text != _lastDatabaseUrl)
                {
                    var selected = (cmbDatabase.Items.Count > 0 ? cmbDatabase.SelectedItem : null);

                    _lastDatabaseUrl = txtUrl.Text;
                    cmbDatabase.Items.Clear();

                    //get dbs from test connection
                    try
                    {
                        foreach (var db in Iom.GetFactory(null).AvailableDatabases(txtUrl.Text))
                        {
                            cmbDatabase.Items.Add(db);
                        }

                        if (selected != null)
                        {
                            cmbDatabase.SelectedItem = selected;
                        }
                    }
                    catch (Exception err)
                    {
                        Utils.HandleError(err);
                    }
                }
            }
            catch (Exception ex)
            {
                Utils.HandleError(ex);
            }
        }
示例#2
0
        public static IArasConnection Login(ConnectionData credentials, out string messageText)
        {
            messageText = "";
            if (string.IsNullOrEmpty(credentials.Url))
            {
                messageText = resources.Messages.UrlNotSpecified;
                return(null);
            }

            return(Iom.GetFactory(credentials.IomVersion).Login(credentials.Url, credentials.Database, credentials.UserName, credentials.Password, out messageText));
        }
示例#3
0
        public ConnectionEditor()
        {
            InitializeComponent();
            this.MultiSelect    = false;
            _bs.CurrentChanged += _bs_CurrentChanged;

            cboIomVersion.Items.Add(string.Empty);
            foreach (var version in Iom.Versions())
            {
                cboIomVersion.Items.Add(version);
            }
        }