Пример #1
0
        public override bool Approve()
        {
            if (m_PoOrigin == null)
            {
                return(false);
            }
            if (m_PoOrigin.ApproveStatusId == (int)ApproveStatus.Approved)
            {
                return(true);
            }
            ApproveLog log = new ApproveLog();

            log.ApproveCode     = m_PoOrigin.PoCode;
            log.ApproveStatusId = (int)ApproveStatus.Approved;
            try
            {
                using (IUnitOfWork uow = new UnitOfWork())
                {
                    uow.ObjectCoverRepositroy.Approve(m_PoOrigin, ColPrimaryKeyName, (int)ApproveStatus.Approved);
                    Debt.CreateDebt(m_PoOrigin, uow);
                    LogUtility.WriteLog(log, uow);
                    uow.Commit();
                }
                m_PoOrigin.ApproveStatusId = (int)ApproveStatus.Approved;
                UpdateRow <Po>(m_Selectedrow, m_PoOrigin);
                return(true);
            }
            catch
            {
                return(false);
            }
        }