Exemplo n.º 1
0
        public string RecoverBill(string outBillNo, string sysDate)
        {
            string billNo = "";
            using (PersistentManager pm = new PersistentManager())
            {
                try
                {
                    BillDao billDao = new BillDao();
                    ProductStateDao stateDao = new ProductStateDao();
                    ScheduleDao scheduleDao = new ScheduleDao();

                    pm.BeginTransaction();

                    billNo = billDao.FindNewBillNo("P", sysDate);

                    billDao.UpdateMasterBillNo(billNo, outBillNo, sysDate);
                    billDao.UpdateDetailBillNo(billNo, outBillNo);
                    stateDao.UpdateBillNo(billNo, outBillNo);
                    scheduleDao.UpdateIsOut(billNo);
                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
            return billNo;
        }