public void SearchBill() { string vehid = this.txt_vehno.Text.Trim(); if (vehid == string.Empty) { this.InitView(); } else { this.bills = this.iccardmanageservice.GetFixVehCardBill(vehid); if ((this.bills == null) || (this.bills.Length == 0)) { this.InitView(); this.textBox18.Focus(); MessageBox.Show("没有查询到相关车辆的发卡单!"); } else if (this.bills.Length > 1) { this.InitView(); MessageBox.Show("存在相关车辆的多个发卡单!"); } else { this.curbill = this.bills[0]; this.InitBillView(); } } }
private void button1_Click(object sender, EventArgs e) { try { if (this.curbill != null) { if (this.card == null) { MessageBox.Show("请放好IC卡!"); } else { string iCNo = this.card.ICNo; string vehID = this.curbill.VehID; bool flag = this.iccardmanageservice.ISExistTaskOfVehNo(vehID) > 0; string[] vehinfo = new string[] { this.curbill.VehID, this.curbill.VehType, this.curbill.ISMulti ? "1" : "0" }; int ictype = this.curbill.ISMulti ? 2 : 3; string iD = LocalInfo.Current.user.ID; string billNo = this.curbill.BillNo; string dept = this.curbill.Dept; string code = FrmMain.localinfo.workpoint.Code; if (this.iccardmanageservice.FixVehCardAssign(iCNo, ictype, iD, billNo, vehinfo, dept, code) == -1) { MessageBox.Show("数据库操作失败!请重新尝试!"); } else { if (this.curbill.ISMulti && flag) { MessageBox.Show("发卡成功,请取走卡!\r\n已经将未执行作业单完成绑定!"); } else { MessageBox.Show("发卡成功,请取走卡!"); } this.curbill = null; this.card = null; this.textBox18.Text = string.Empty; this.InitView(); this.txt_vehno.Text = ""; this.txt_vehno.Focus(); } } } } catch (Exception exception) { MessageBox.Show("数据处理异常!" + exception.ToString()); } }
public void HandleCardMessage(Device.CardReader device, string cardid) { if (this.CheckCardID(cardid) && this.Cards.CheckCard(cardid)) { string str = this.txt_vehno.Text.Trim(); if (str == string.Empty) { MessageBox.Show("车号为空,请先选发运单,后刷卡!"); } else { this.card = null; ICCard tempCard = this.IC.GetCard(cardid); if (tempCard.CardNo == string.Empty) { MessageBox.Show("此卡还没有注册!"); } else { RFFYD rFFYDByICID = this.cs.GetRFFYDByICID(cardid); if (((rFFYDByICID != null) && (rFFYDByICID.billno != string.Empty)) && (rFFYDByICID.status == "0")) { FrmRFCancel cancel = new FrmRFCancel(rFFYDByICID, tempCard); if (cancel.ShowDialog() == DialogResult.OK) { this.Cards.DeleteCard(cardid); } } else { if (this.chbox_fixveh.Checked) { if (tempCard.Ictype != 2) { MessageBox.Show("当前是固定车辆发运单,请刷多次车辆卡进行确认!"); return; } Bill_FixVehCard fixVehCardBillEx = this.IC.GetFixVehCardBillEx(tempCard.DJH.Trim()); if (fixVehCardBillEx == null) { MessageBox.Show("获取多次车辆发卡单失败!\r\nIC卡号:" + tempCard.CardNo); return; } if (fixVehCardBillEx.VehID != str) { MessageBox.Show("多次卡的车牌号与单据的车牌号不一致!"); return; } } else if (tempCard.Status != 0) { MessageBox.Show("卡" + tempCard.CardNo + "当前状态不允许发卡!"); return; } this.card = tempCard; this.txt_icno.Text = tempCard.CardNo; } } } } }