public void CancelTaskIn(string billNo) { using (PersistentManager pm = new PersistentManager()) { TaskDao taskDao = new TaskDao(); BillDao billDao = new BillDao(); CellDao cellDao = new CellDao(); ScheduleDao scheduleDao = new ScheduleDao(); ProductStateDao productStateDao = new ProductStateDao(); try { pm.BeginTransaction(); int count = taskDao.FindExecutingTask(billNo); if (count != 0) throw new Exception("����δִ�л�ִ���е���ҵ��"); taskDao.Backup(billNo); taskDao.Delete(billNo); billDao.UpdateMasterState(billNo, "6");//����Ϊȡ�� productStateDao.Delete(billNo); //�������ⵥ���̰����������������ƻ�ISOUTΪ����� scheduleDao.UpdateIsIn(billNo); pm.Commit(); } catch (Exception e) { pm.Rollback(); throw new Exception(e.Message); } } }
public void CancelTask(string billNo) { using (PersistentManager pm = new PersistentManager()) { TaskDao taskDao = new TaskDao(); BillDao billDao = new BillDao(); CellDao cellDao = new CellDao(); try { pm.BeginTransaction(); int count = taskDao.FindExecutingTask(billNo); if (count != 0) throw new Exception("����δִ�л�ִ���е���ҵ��"); if (cellDao.Update(billNo) > 0) { taskDao.Backup(billNo); taskDao.Delete(billNo); billDao.UpdateMasterState(billNo, "6");//����Ϊȡ�� } else throw new Exception("�õ���ȫ����ҵ�����"); pm.Commit(); } catch (Exception e) { pm.Rollback(); throw new Exception(e.Message); } } }