Esempio n. 1
0
        public void Run(int id, Provider provider, int count, DateTime dateTime, float allPurchasePrice, float allSalesPrice, Department department, Seller seller)
        {
            ArrivedGoods arrivedGoods = null;

            arrivedGoodsRepository.GetNewAll();
            foreach (ArrivedGoods curArrivedGoods in arrivedGoodsRepository.GetAll())
            {
                if (id.Equals(curArrivedGoods.Id))
                {
                    arrivedGoods = new ArrivedGoods()
                    {
                        Id               = id,
                        Provider         = provider,
                        Count            = count,
                        DateTime         = dateTime,
                        AllPurchasePrice = allPurchasePrice,
                        AllSalesPrice    = allPurchasePrice,
                        Department       = department,
                        Seller           = seller
                    };
                    arrivedGoodsRepository.Update(arrivedGoods);
                    break;
                }
            }

            if (arrivedGoods == null)
            {
                throw new Exception("The product is not updated and not found!");
            }
            ;
        }