示例#1
0
        private static bool UpdateTransaction(PURPurchaseReturnHeader pURPurchaseReturnHeader, PURPurchaseReturnLineCollection pURPurchaseReturnLineCollection, POS.DataLayer.PURPurchaseReturnHeader _pURPurchaseReturnHeader)
        {
            _pURPurchaseReturnHeader.IsVoid           = false;
            _pURPurchaseReturnHeader.CreatedBy        = GlobalVariables.CurrentUser.UserID;
            _pURPurchaseReturnHeader.CreateDate       = DateTime.Now;
            _pURPurchaseReturnHeader.UpdatedBy        = GlobalVariables.CurrentUser.UserID;
            _pURPurchaseReturnHeader.UpdateDate       = DateTime.Now;
            _pURPurchaseReturnHeader.IsDeleted        = false;
            _pURPurchaseReturnHeader.DeletedBy        = null;
            _pURPurchaseReturnHeader.DeleteDate       = null;
            _pURPurchaseReturnHeader.OriginalHeaderID = pURPurchaseReturnHeader.OriginalHeaderID;
            _pURPurchaseReturnHeader.ReturnDate       = pURPurchaseReturnHeader.ReturnDate;
            _pURPurchaseReturnHeader.PurchaseReturnID = pURPurchaseReturnHeader.PurchaseReturnID;

            POS.DataLayer.PURPurchaseReturnLineCollection _pURPurchaseReturnLineCollection = new DataLayer.PURPurchaseReturnLineCollection();
            foreach (PURPurchaseReturnLine pURPurchaseReturnLine in pURPurchaseReturnLineCollection)
            {
                POS.DataLayer.PURPurchaseReturnLine _pURPurchaseReturnLine = new POS.DataLayer.PURPurchaseReturnLine();

                _pURPurchaseReturnLine.Qty                    = pURPurchaseReturnLine.Qty;
                _pURPurchaseReturnLine.BatchNumber            = pURPurchaseReturnLine.BatchNumber;
                _pURPurchaseReturnLine.ExpiryDate             = pURPurchaseReturnLine.ExpiryDate;
                _pURPurchaseReturnLine.OriginalpurchaseLineID = pURPurchaseReturnLine.OriginalpurchaseLineID;
                _pURPurchaseReturnLine.Reason                 = pURPurchaseReturnLine.Reason;

                _pURPurchaseReturnLineCollection.Add(_pURPurchaseReturnLine);
            }
            POS.DataLayer.PURPurchaseReturnLine pURPurchaseReturnLineObj = new DataLayer.PURPurchaseReturnLine();

            return(pURPurchaseReturnLineObj.UpdateTransaction(_pURPurchaseReturnHeader, _pURPurchaseReturnLineCollection));
        }
        private static bool UpdateTransaction(PURPurchaseReturnHeader pURPurchaseReturnHeader, PURPurchaseReturnLineCollection pURPurchaseReturnLineCollection, POS.DataLayer.PURPurchaseReturnHeader _pURPurchaseReturnHeader)
        {
            _pURPurchaseReturnHeader.IsVoid = false;
            _pURPurchaseReturnHeader.CreatedBy = GlobalVariables.CurrentUser.UserID;
            _pURPurchaseReturnHeader.CreateDate = DateTime.Now;
            _pURPurchaseReturnHeader.UpdatedBy = GlobalVariables.CurrentUser.UserID;
            _pURPurchaseReturnHeader.UpdateDate = DateTime.Now;
            _pURPurchaseReturnHeader.IsDeleted = false;
            _pURPurchaseReturnHeader.DeletedBy = null;
            _pURPurchaseReturnHeader.DeleteDate = null;
            _pURPurchaseReturnHeader.OriginalHeaderID = pURPurchaseReturnHeader.OriginalHeaderID;
            _pURPurchaseReturnHeader.ReturnDate = pURPurchaseReturnHeader.ReturnDate;
            _pURPurchaseReturnHeader.PurchaseReturnID = pURPurchaseReturnHeader.PurchaseReturnID;

            POS.DataLayer.PURPurchaseReturnLineCollection _pURPurchaseReturnLineCollection = new DataLayer.PURPurchaseReturnLineCollection();
            foreach (PURPurchaseReturnLine pURPurchaseReturnLine in pURPurchaseReturnLineCollection)
            {
                POS.DataLayer.PURPurchaseReturnLine _pURPurchaseReturnLine = new POS.DataLayer.PURPurchaseReturnLine();

                _pURPurchaseReturnLine.Qty = pURPurchaseReturnLine.Qty;
                _pURPurchaseReturnLine.BatchNumber = pURPurchaseReturnLine.BatchNumber;
                _pURPurchaseReturnLine.ExpiryDate = pURPurchaseReturnLine.ExpiryDate;
                _pURPurchaseReturnLine.OriginalpurchaseLineID = pURPurchaseReturnLine.OriginalpurchaseLineID;
                _pURPurchaseReturnLine.Reason = pURPurchaseReturnLine.Reason;

                _pURPurchaseReturnLineCollection.Add(_pURPurchaseReturnLine);
            }
            POS.DataLayer.PURPurchaseReturnLine pURPurchaseReturnLineObj = new DataLayer.PURPurchaseReturnLine();

            return pURPurchaseReturnLineObj.UpdateTransaction(_pURPurchaseReturnHeader, _pURPurchaseReturnLineCollection);
        }