Пример #1
0
        private void SaveLots(TranDetail entityDetail, TranHead entityTranHead)
        {
            //get in_material
            Material entityMaterial = new Material()
            {
                material_id = entityDetail.material_id
            };

            entityMaterial = ServiceProvider.MaterialService.FindByKeys(entityMaterial, false);

            //update into in_phy_lot
            PhyLot entityPhyLot = ServiceProvider.PhyLotService.GetPhyLot(entityDetail.material_id, entityDetail.warehouse_id_dest, entityDetail.lot_no.Value);

            entityPhyLot.bal_qty = (entityPhyLot.bal_qty - entityDetail.quantity.Value);
            ServiceProvider.PhyLotService.Update(entityPhyLot);

            //update into in_log_lot
            LogLot entityLogLot = ServiceProvider.LogLotService.GetLogLot(entityDetail.material_id, entityDetail.warehouse_id_dest);

            entityLogLot.bal_qty = (entityLogLot.bal_qty - entityDetail.quantity.Value);
            ServiceProvider.LogLotService.Update(entityLogLot);
        }
Пример #2
0
        private void SaveLots(StockDetail entityDetail, StockHead entityStockHead)
        {
            //update into in_phy_lot
            PhyLot entityPhyLot = ServiceProvider.PhyLotService.GetPhyLot(entityDetail.material_id, entityStockHead.warehouse_id, entityDetail.lot_no, false);

            entityPhyLot.bal_qty = entityDetail.bal_qty;
            entityPhyLot.bf_qty  = entityDetail.bf_qty;
            entityPhyLot.bf_date = entityDetail.bf_date;
            ServiceProvider.PhyLotService.Update(entityPhyLot);

            //update into in_log_lot
            LogLot entityLogLot = ServiceProvider.LogLotService.GetLogLot(entityDetail.material_id, entityStockHead.warehouse_id);

            entityLogLot.bal_qty = entityDetail.bal_qty;
            entityLogLot.bf_qty  = entityDetail.bf_qty;
            entityLogLot.bf_date = entityDetail.bf_date;
            ServiceProvider.LogLotService.Update(entityLogLot);

            //Insert
            BFLogical bfLogical = new BFLogical();

            bfLogical.period_id    = entityStockHead.period_id;
            bfLogical.warehouse_id = entityStockHead.warehouse_id;
            bfLogical.material_id  = entityDetail.material_id;
            bfLogical.bf_qty       = entityDetail.bf_qty;
            bfLogical.bal_qty      = entityDetail.bal_qty;
            ServiceProvider.BFLogicalService.Insert(bfLogical);

            BFPhysical bfPhysical = new BFPhysical();

            bfPhysical.period_id    = entityStockHead.period_id;
            bfPhysical.warehouse_id = entityStockHead.warehouse_id;
            bfPhysical.material_id  = entityDetail.material_id;
            bfPhysical.bf_qty       = entityDetail.bf_qty;
            bfPhysical.bal_qty      = entityDetail.bal_qty;
            bfPhysical.lot_no       = entityDetail.lot_no;
            ServiceProvider.BFPhysicalService.Insert(bfPhysical);
        }