private void toolStripButton2_Click(object sender, EventArgs e) { var sl = new AccountSelectForm(new SysConfigManager().Get().Accounts); if (sl.ShowDialog() == DialogResult.OK && sl.CheckedInfo != null) { _from = sl.CheckedInfo; var partner = textBox1.Text; var sd = dateTimePicker1.Value.ToString("yyyy-MM-dd 00:00:00"); var ed = dateTimePicker2.Value.ToString("yyyy-MM-dd 23:59:59"); var data = new DataAccess(new SqlHelper(_from.GetConnectionString())).GetPurchaseOrder(partner, sd, ed); dataGridView1.Columns.Clear(); dataGridView1.Columns.Add(new DataGridViewCheckBoxColumn { ReadOnly = false, Width = 30 }); foreach (DataColumn cln in data.Columns) { dataGridView1.Columns.Add(new DataGridViewTextBoxColumn { Name = cln.ColumnName, ReadOnly = true }); } dataGridView1.Columns[1].Visible = false; foreach (DataRow row in data.Rows) { dataGridView1.Rows.Add( false, row["id"], row["单据日期"], row["单据编号"], row["供应商"], row["业务员"], row["预计到货日期"], row["付款方式"], row["订金金额"], row["预付款百分比"] ); } textBox1.Focus(); } }
private void toolStripButton1_Click(object sender, EventArgs e) { var info = new AccountInfo(); var accForm = new Account(info); if (accForm.ShowDialog() != DialogResult.OK) return; _config.AddAccountInfo(info); new SysConfigManager().Set(_config); Init(); }
private void listBox1_DoubleClick(object sender, EventArgs e) { CheckedInfo = (AccountInfo)listBox1.SelectedItem; DialogResult = DialogResult.OK; }
public void RemoveAccountInfo(AccountInfo account) { _accounts.Remove(account); }
public void AddAccountInfo(AccountInfo account) { _accounts.Add(account); }
public Account(AccountInfo info) { _info = info; InitializeComponent(); }