Beispiel #1
0
        public void SendBill(string oriBillNo, string sysDate, string userID, string status)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                try
                {
                    BillDao billDao = new BillDao();
                    ProductStateDao stateDao = new ProductStateDao();

                    pm.BeginTransaction();

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

                    billDao.UpdateMasterState(oriBillNo, "5", "SENDER", userID, "SENDDATE", sysDate);
                    billDao.SendMaster(billNo, sysDate, oriBillNo, userID, status);

                    DataTable detailTable = stateDao.Find(oriBillNo);
                    billDao.InsertDetail(billNo, detailTable);

                    if (status == "1")//���ⵥ
                    {
                        billDao.InsertDetail("T" + billNo, detailTable);
                        stateDao.Send("T" + billNo, oriBillNo);
                    }

                    //DataTable cigaretteTable = stateDao.FindCigarette(oriBillNo);
                    //stateDao.UpdateCigarette(oriBillNo, cigaretteTable);

                    stateDao.UpdateBarcode2(oriBillNo);
                    stateDao.Send(billNo, oriBillNo);

                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
        }