//任务取消 public virtual bool ManageCancle(int manageId, bool bTrans, out string sResult) { bool bresult = true; sResult = string.Empty; try { //事务管理 mgeMainDao._sessionFactory.BeginTransaction(bTrans); //1.判断任务是否可以取消 首先删除在wcs客户端删除wcs指令 if (ValidateEnum.ExistIoContorl) { bresult = false; return(bresult); } //2.更新起止位置库位状态为可运行 锁定-》解锁 this.UnLockCell(); //3.取消计划数量 _bill.Cancle(); //4.删除任务相关记录 this.DeleteManageAbout(manageId); } catch (Exception ex) { bresult = false; return(bresult); } finally { if (bresult) { mgeMainDao._sessionFactory.CommitTransaction(bTrans); } else { mgeMainDao._sessionFactory.RollBackTransaction(bTrans); } } return(bresult); }