Example #1
0
 private void btn_update_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("确实要撤销此作业单吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.Cancel)
     {
         try
         {
             string code = FrmMain.localinfo.workpoint.Code;
             string iD   = LocalInfo.Current.user.ID;
             VehIC_WF.ICCardManageService.Result result2 = this.IC.RFVehCardCancel(this.card.ICNo, this.fyd.billno, code, iD, this.chbox_fixveh.Checked);
             if (result2.Flag)
             {
                 MessageBox.Show("操作成功!");
                 base.DialogResult = DialogResult.OK;
             }
             else
             {
                 MessageBox.Show("操作失败\n" + result2.Desc + "\n请重试!");
             }
         }
         catch (Exception exception)
         {
             MessageBox.Show("操作失败\n" + exception.ToString());
         }
     }
 }
Example #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         string sourbillno = this.txt_billno.Text.Trim();
         string cph        = this.txt_vehno.Text.Trim();
         string vehtype    = this.cb_vehtype.Text.Trim();
         string vendor     = this.txt_vendor.Text.Trim();
         bool   isfix      = this.chbox_fixveh.Checked;
         string iCNo       = this.card.ICNo;
         string code       = FrmMain.localinfo.workpoint.Code;
         string iD         = LocalInfo.Current.user.ID;
         AvailableBillInfo[] availableBillInfos = this.IC.GetAvailableBillInfos(cph);
         if (availableBillInfos == null)
         {
             MessageBox.Show("数据处理错误,请重试!");
         }
         else
         {
             if (availableBillInfos.Length > 0)
             {
                 if (availableBillInfos[0].Type == -2)
                 {
                     MessageBox.Show("存在此车辆对应的未完成RF发运作业单,不允许再生成新作业单!");
                     return;
                 }
                 if (availableBillInfos[0].Type == -1)
                 {
                     MessageBox.Show("存在此车辆对应的可用作业单,不允许再生成新作业单!");
                     return;
                 }
             }
             if (sourbillno == "")
             {
                 MessageBox.Show("单据号不能为空!");
             }
             else if (vendor == "")
             {
                 MessageBox.Show("客户不能为空!");
             }
             else if ((cph == "") || (vehtype == ""))
             {
                 MessageBox.Show("请先输入车号并选择车型!");
             }
             else if (this.card == null)
             {
                 MessageBox.Show("请放刷IC卡!");
             }
             else
             {
                 try
                 {
                     Vehic vehicInfo = this.IC.GetVehicInfo(cph);
                     if ((vehicInfo != null) && vehicInfo.InDoor)
                     {
                         MessageBox.Show("车辆状态显示为在厂内,禁止发卡!", "提示");
                         return;
                     }
                 }
                 catch (Exception exception)
                 {
                     MessageBox.Show(exception.ToString());
                     return;
                 }
                 VehIC_WF.ICCardManageService.Result result = this.IC.RFVehCardAssign(iCNo, code, iD, sourbillno, vendor, cph, vehtype, isfix);
                 if (!result.Flag)
                 {
                     MessageBox.Show(result.Desc);
                 }
                 else
                 {
                     this.InitView();
                     this.Cards.Add(new Card(iCNo, DateTime.Now.Ticks));
                     MessageBox.Show("发卡成功,请取走卡!");
                     this.axWebBrowser1.Focus();
                 }
             }
         }
     }
     catch (Exception exception2)
     {
         MessageBox.Show("数据处理异常!" + exception2.ToString());
     }
 }