private void button1_Click(object sender, EventArgs e) { if (this.curbill != null) { if (this.card == null) { MessageBox.Show("请放好IC卡!"); } else { string billNo = this.curbill.BillNo; int ictype = this.curbill.ISZLK ? 5 : 4; string iD = LocalInfo.Current.user.ID; string code = FrmMain.localinfo.workpoint.Code; if (this.iccardmanageservice.OperCardAssign(this.card.ICNo, ictype, billNo, iD, code) == -1) { MessageBox.Show("数据库操作失败!请重新尝试!"); } else { MessageBox.Show("发卡成功!请取走IC卡!"); this.InitFrm(); this.bills = null; this.curbill = null; this.card = null; this.textBox6.Text = ""; this.textBox8.Text = ""; this.textBox8.Focus(); } } } }
private void textBox8_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { e.Handled = true; string uid = this.textBox8.Text.Trim(); if (uid == string.Empty) { this.curbill = null; this.InitFrm(); this.textBox6.Text = ""; this.textBox8.Text = ""; this.textBox8.Focus(); } else { this.bills = this.iccardmanageservice.QueryBillByUserID(uid); if ((this.bills == null) || (this.bills.Length == 0)) { this.curbill = null; this.InitFrm(); MessageBox.Show("没有查询到相关人员的发卡单!"); this.textBox6.Text = ""; this.textBox8.SelectionStart = this.textBox8.Text.Length; this.textBox8.Focus(); } else { this.curbill = this.bills[0]; this.InitBillView(); } } } }