Example #1
0
        public DataSet GetReturnGoodsDetail(int pintReturnedGoodsID)
        {
            SO_ReturnedGoodsDetailDS objSO_ReturnedGoodsDetailDS = new SO_ReturnedGoodsDetailDS();

            DataSet dsData = objSO_ReturnedGoodsDetailDS.ListReturnedGoodsDetail(pintReturnedGoodsID);

            return(dsData);
        }
Example #2
0
        public void DeleteReturnedGoods(int pintReturnedGoodsMasterID)
        {
            //1. Variable
            int enm_InspStatus     = 8;
            int constOldTranTypeID = (new MST_TranTypeDS()).GetTranTypeID(TransactionType.RETURN_GOODS_RECEIVE);

            SO_ReturnedGoodsDetailDS objSO_ReturnedGoodsDetailDS = new SO_ReturnedGoodsDetailDS();
            SO_ReturnedGoodsMasterDS objSO_ReturnedGoodsMasterDS = new SO_ReturnedGoodsMasterDS();

            //2. Get ReturnedGoodsMaster
            SO_ReturnedGoodsMasterVO voRuturnGoodsMaster = new SO_ReturnedGoodsMasterVO();

            voRuturnGoodsMaster = (SO_ReturnedGoodsMasterVO)objSO_ReturnedGoodsMasterDS.GetObjectVO(pintReturnedGoodsMasterID);

            //Get List ReturnGoodsDetail by ReturnGoodsMasterID
            DataSet dsRGD = objSO_ReturnedGoodsDetailDS.ListReturnedGoodsDetail(pintReturnedGoodsMasterID);

            foreach (DataRow row in dsRGD.Tables[0].Rows)
            {
                //Update Inventory
                int     MaslocID           = (int)row[SO_ReturnedGoodsDetailTable.MASTERLOCATIONID_FLD];
                int     locID              = (int)row[SO_ReturnedGoodsDetailTable.LOCATIONID_FLD];
                int     BinID              = (int)row[SO_ReturnedGoodsDetailTable.BINID_FLD];
                int     ProductID          = (int)row[SO_ReturnedGoodsDetailTable.PRODUCTID_FLD];
                decimal decQuantityReceipt = (decimal)row[SO_ReturnedGoodsDetailTable.RECEIVEQUANTITY_FLD];

                new InventoryUtilsBO().UpdateSubtractOHQuantity(voRuturnGoodsMaster.CCNID,
                                                                MaslocID,
                                                                locID,
                                                                BinID,
                                                                ProductID,
                                                                decQuantityReceipt,
                                                                string.Empty,
                                                                string.Empty);
            }

            // Update TransactionHistory
            new MST_TransactionHistoryDS().UpdateTranType(voRuturnGoodsMaster.ReturnedGoodsMasterID, constOldTranTypeID, (int)TransactionTypeEnum.DeleteTransaction, enm_InspStatus);

            //delete the detail first
            objSO_ReturnedGoodsDetailDS.DeleteAllReturnedGoodsDetail(pintReturnedGoodsMasterID);

            //delete the master later
            objSO_ReturnedGoodsMasterDS.Delete(pintReturnedGoodsMasterID);
        }