public void Update(AddOrUpdateWmsInboundOrderDtblReq obj)
        {
            var user = _auth.GetCurrentUser().User;

            UnitWork.Update <WmsInboundOrderDtbl>(u => u.Id == obj.Id, u => new WmsInboundOrderDtbl
            {
                Price          = obj.Price,
                PriceNoTax     = obj.PriceNoTax,
                InStockStatus  = obj.InStockStatus,
                AsnStatus      = obj.AsnStatus,
                GoodsId        = obj.GoodsId,
                GoodsBatch     = obj.GoodsBatch,
                QualityFlg     = obj.QualityFlg,
                OrderNum       = obj.OrderNum,
                InNum          = obj.InNum,
                LeaveNum       = obj.LeaveNum,
                HoldNum        = obj.HoldNum,
                ProdDate       = obj.ProdDate,
                ExpireDate     = obj.ExpireDate,
                TaxRate        = obj.TaxRate,
                OwnerId        = obj.OwnerId,
                Remark         = obj.Remark,
                UpdateTime     = DateTime.Now,
                UpdateUserId   = user.Id,
                UpdateUserName = user.Name
                                 //todo:补充或调整自己需要的字段
            });
        }
        public void AddNoSave(AddOrUpdateWmsInboundOrderDtblReq req)
        {
            var obj = req.MapTo <WmsInboundOrderDtbl>();

            //todo:补充或调整自己需要的字段
            obj.CreateTime = DateTime.Now;
            var user = _auth.GetCurrentUser().User;

            obj.CreateUserId   = user.Id;
            obj.CreateUserName = user.Name;
            UnitWork.Add(obj);
        }
Exemplo n.º 3
0
        public Response Update(AddOrUpdateWmsInboundOrderDtblReq obj)
        {
            var result = new Response();

            try
            {
                _app.Update(obj);
            }
            catch (Exception ex)
            {
                result.Code    = 500;
                result.Message = ex.InnerException?.Message ?? ex.Message;
            }

            return(result);
        }
 public void Add(AddOrUpdateWmsInboundOrderDtblReq req)
 {
     AddNoSave(req);
     UnitWork.Save();
 }