コード例 #1
0
 public void UpdateInventory(InventoryBusinessModel inventoryModel)
 {
     var mapper = new InventoryMapper();
     Inventory inv = mapper.Map(inventoryModel);
     this.uow.Inventories.Update(inv);
     this.uow.Commit();
 }
コード例 #2
0
        public ActionResult Edit(InventoryBusinessModel viewModel)
        {
            if (ModelState.IsValid)
            {
                this.inventoryManager.UpdateInventory(viewModel);
                return RedirectToAction("Details", new { id = viewModel.InventoryId });
            }

            return View(viewModel);
        }
コード例 #3
0
        public ReaderHistoryMapperTest()
        {
            this.readerHistoryMapper = new ReaderHistoryMapper();

            this.readerEntityToMap = new Reader { FirstName = "Bob", LastName = "Hopkins" };

            this.readerModelToMap = new ReaderBusinessModel { FirstName = "Bob", LastName = "Hopkins" };

            this.inventoryEntityToMap = new Inventory { Number = "0000000001-001" };

            this.inventoryModelToMap = new InventoryBusinessModel { Number = "0000000001-001" };

            this.readerHistoryEntityToMap = new ReaderHistory
            {
                ReaderHistoryId = 1,
                StartDate = Convert.ToDateTime("2013.12.12"),
                ReturnDate = Convert.ToDateTime("2013.12.20"),
                FinishDate = Convert.ToDateTime("2013.12.28"),
                Reader = this.readerEntityToMap,
                Inventory = this.inventoryEntityToMap
            };

            this.readerHistoryEntityToCompareWith = new ReaderHistory
            {
                ReaderHistoryId = 1,
                StartDate = Convert.ToDateTime("2013.12.12"),
                ReturnDate = Convert.ToDateTime("2013.12.20"),
                FinishDate = Convert.ToDateTime("2013.12.28"),
                Reader = this.readerEntityToMap,
                Inventory = this.inventoryEntityToMap
            };
            this.ReaderHistoryModelToMap = new ReaderHistoryBusinessModel
            {
                Id = 1,
                StartDate = Convert.ToDateTime("2013.12.12"),
                ReturnDate = Convert.ToDateTime("2013.12.20"),
                FinishDate = Convert.ToDateTime("2013.12.28"),
                ReaderBusiness = this.readerModelToMap,
                InventoryBusiness = this.inventoryModelToMap
            };
            this.ReaderHistoryModelToCompareWith = new ReaderHistoryBusinessModel
            {
                Id = 1,
                StartDate = Convert.ToDateTime("2013.12.12"),
                ReturnDate = Convert.ToDateTime("2013.12.20"),
                FinishDate = Convert.ToDateTime("2013.12.28"),
                ReaderBusiness = this.readerModelToMap,
                InventoryBusiness = this.inventoryModelToMap
            };
        }
コード例 #4
0
 public void CreateInventory(InventoryBusinessModel inventory)
 {
     this.inventoryFacade.CreateInventory(inventory);
 }
コード例 #5
0
 public void CreateInventory(InventoryBusinessModel inventoryModel)
 {
     var mapper = new InventoryMapper();
     this.uow.Inventories.Add(mapper.Map(inventoryModel));
     this.uow.Commit();
 }