Esempio n. 1
0
        public GoodsItem Update(GoodsItem item)
        {
            var dalItem = FindById(item.Id);

            dalItem.Name           = item.Name;
            dalItem.AreaId         = item.AreaId;
            dalItem.Status         = item.Status;
            dalItem.Shipper        = item.Shipper;
            dalItem.LastTransition = item.LastTransition;
            _context.GoodsItems.Update(item);
            _context.SaveChanges();
            return(item);
        }
Esempio n. 2
0
 public GoodsItem Add(GoodsItem item)
 {
     if (item.Characteristics.HumidityLow > item.Characteristics.HumidityHigh)
     {
         throw new ArgumentException("Incorrect humidity");
     }
     if (item.Characteristics.TemperatureLow > item.Characteristics.TemperatureHigh)
     {
         throw new ArgumentException("Incorrect temperature");
     }
     _context.Add(item);
     _context.SaveChanges();
     return(item);
 }
 public GoodsItem Create(GoodsItem item)
 {
     return(_repository.Add(item));
 }
Esempio n. 4
0
 private GoodsItem InsertTransitionState(GoodsItem item)
 {
     item.TransitionState = GoodsStateFactory.Instance.FromGoods(item);
     return(item);
 }