示例#1
0
 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();
     }
 }
示例#2
0
        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();
        }
示例#3
0
 private void listBox1_DoubleClick(object sender, EventArgs e)
 {
     CheckedInfo = (AccountInfo)listBox1.SelectedItem;
     DialogResult = DialogResult.OK;
 }
示例#4
0
 public void RemoveAccountInfo(AccountInfo account)
 {
     _accounts.Remove(account);
 }
示例#5
0
 public void AddAccountInfo(AccountInfo account)
 {
     _accounts.Add(account);
 }
示例#6
0
 public Account(AccountInfo info)
 {
     _info = info;
     InitializeComponent();
 }