private void button4_Click(object sender, EventArgs e) { if (this.dbIpTextBox.Text == "" || this.dbIpTextBox.Text == null) { MessageBox.Show("请输入账套服务器地址!"); return; } if (this.dbUserTextBox.Text == "" || this.dbUserTextBox.Text == null) { MessageBox.Show("请输入账套数据库用户名!"); return; } if (this.dbPasswordTextBox.Text == null) { this.dbPasswordTextBox.Text = ""; } Sd3000Factory sdfactory = new Sd3000Factory(); try { List <Sd3000Accset> accsetList = sdfactory.queryAccset(this.dbUserTextBox.Text, this.dbPasswordTextBox.Text, this.dbIpTextBox.Text, "SD11001N_"); this.accset = CommonManager.selectAccset(accsetList); if (this.accset != null) { this.accsetNameTextBox.Text = this.accset.Corpname + "[" + this.accset.DbName + "]"; } } catch (Exception e1) { Console.WriteLine(e1.StackTrace); MessageBox.Show(e1.Message); } }
private void select() { if (this.accsetDataGridView.SelectedRows.Count <= 0) { MessageBox.Show("请先选择账套!"); return; } Sd3000Accset accset = this.findAccset(this.accsetDataGridView.CurrentRow.Cells[0].Value.ToString()); if (accset != null) { this.Accset = accset; this.DialogResult = DialogResult.OK; } else { this.DialogResult = DialogResult.Abort; } this.Close(); }
private void resetAccset() { this.accset = null; this.accsetNameTextBox.Text = ""; }