Beispiel #1
0
        public void ClearBillNo(string scheduleNo, string billNo)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                ScheduleDao scheduleDao = new ScheduleDao();
                BillDao billDao = new BillDao();
                ProductStateDao stateDao = new ProductStateDao();
                try
                {
                    pm.BeginTransaction();

                    DataTable billTable = billDao.FindMaster(billNo);
                    if (billTable.Rows.Count != 0)
                    {
                        if (billTable.Rows[0]["STATE"].ToString() == "1")
                        {
                            billDao.DeleteDetail(billNo);
                            billDao.DeleteMaster(billNo);
                            stateDao.Delete(billNo);
                            scheduleDao.UpdateBillNo(scheduleNo, "");
                        }
                        else
                            throw new Exception("����״̬Ϊ'���'�����ܽ����������");
                    }
                    else
                        throw new Exception(string.Format("���ݱ��Ϊ'{0}'�ĵ��ݲ����ڡ�", billNo));

                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
        }
Beispiel #2
0
        public void DeleteBill3(string billNo)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                try
                {
                    BillDao billDao = new BillDao();
                    ProductStateDao stateDao = new ProductStateDao();

                    pm.BeginTransaction();

                    billDao.DeleteMaster(billNo);
                    stateDao.Delete(billNo);

                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
        }
Beispiel #3
0
        public void BackBill(string billNo, string oriBillNo)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                try
                {
                    BillDao billDao = new BillDao();
                    ProductStateDao stateDao = new ProductStateDao();

                    pm.BeginTransaction();

                    billDao.DeleteMaster(billNo);
                    billDao.DeleteDetail(billNo);

                    billDao.DeleteMaster("T" + billNo);
                    billDao.DeleteDetail("T" + billNo);
                    billDao.UpdateMasterState(oriBillNo, "2", "SENDER", "", "SENDDATE", "");

                    stateDao.Delete(billNo);
                    stateDao.Delete("T" + billNo);
                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
        }
Beispiel #4
0
        public void DeleteBill(string scheduleNo, string billNo)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                try
                {
                    BillDao billDao = new BillDao();
                    ProductStateDao stateDao = new ProductStateDao();
                    ScheduleDao scheduleDao = new ScheduleDao();

                    pm.BeginTransaction();

                    billDao.DeleteMaster(billNo);
                    billDao.DeleteDetail(billNo);

                    if (scheduleNo != null)
                    {
                        stateDao.Delete(billNo);
                        scheduleDao.UpdateBillNo(scheduleNo, "");
                    }

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