private static MoveOrderDetail GetEntityByModel(MoveOrderDetailModel model, int count)
        {
            if (model == null) return null;

            MoveOrderDetail entity = new MoveOrderDetail();
            if (count == 0)
            {
                entity.CreateBy = AuthenticationHelper.UserId;
                entity.CreateDate = DateTime.Now;
            }
            else
            {
                entity.CreateBy = model.CreateBy;
                entity.CreateDate = model.CreateDate;
            }

            entity.DateRequired = model.DateRequired;
            entity.Id = model.Id;
            entity.ItemId = model.ItemId;
            entity.LocatorId = model.LocatorId;
            entity.LotNo = model.LotNo;
            entity.MoveOrderId = model.MoveOrderId;
            entity.Quantity = model.Quantity;
            entity.SerialNo = model.SerialNo;
            entity.UpdateBy = AuthenticationHelper.UserId;
            entity.UpdateDate = DateTime.Now;
            entity.WarehouseId = model.WarehouseId;
            return entity;
        }
 public long Update(MoveOrderDetail entity)
 {
     var originalEntity = this.Context.MoveOrderDetails.Find(entity.Id);
     this.Context.Entry(originalEntity).CurrentValues.SetValues(entity);
     this.Context.Entry(originalEntity).State = EntityState.Modified;
     this.Commit();
     return entity.Id;
 }
Пример #3
0
 public MoveOrderDetailModel(MoveOrderDetail entity)
 {
     this.CreateBy = entity.CreateBy;
     this.CreateDate = entity.CreateDate;
     this.DateRequired = entity.DateRequired;
     this.Id = entity.Id;
     this.ItemId = entity.ItemId;
     this.LocatorId = entity.LocatorId;
     this.LotNo = entity.LotNo;
     this.MoveOrderId = entity.MoveOrderId;
     this.Quantity = entity.Quantity;
     this.SerialNo = entity.SerialNo;
     this.UpdateBy = entity.UpdateBy;
     this.UpdateDate = entity.UpdateDate;
     this.WarehouseId = entity.WarehouseId;
 }
 public long Insert(MoveOrderDetail entity)
 {
     this.Context.MoveOrderDetails.Add(entity);
     this.Commit();
     return entity.Id;
 }
 public long Update(MoveOrderDetail entity)
 {
     return this.repository.Update(entity);
 }
 public long Insert(MoveOrderDetail entity)
 {
     return this.repository.Insert(entity);
 }