//添加 private void btAdd_Click(object sender, EventArgs e) { if (this.txtTicketNo.Text.Trim() == "") { MessageBox.Show("发票号不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); return; } zyCostMaster.AddBadTicket(this.txtTicketNo.Text.Trim(), EmpCode); this.tabControl1.SelectedIndex = 0; this.dgvNow.AutoGenerateColumns = false; this.dgvNow.DataSource = zyCostMaster.GetBadTicket(false, EmpCode, null, null); this.txtTicketNo.Text = ""; MessageBox.Show("添加成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); }
public FrmBadTicketManager(string empcode) { InitializeComponent(); EmpCode = empcode; zyCostMaster = new ZY_CostMaster(); this.dgvNow.AutoGenerateColumns = false; this.dgvHistroy.AutoGenerateColumns = false; this.dgvNow.DataSource = zyCostMaster.GetBadTicket(false, EmpCode, null, null); this.dgvHistroy.DataSource = zyCostMaster.GetBadTicket(true, EmpCode, this.dtBdate.Value, this.dteDate.Value); this.tabControl1.SelectedIndex = 0; }