// GET: Inventory/WarehouseIN/Create
        public ActionResult Create()
        {
            var model = new CreateEditViewModel();

            model.InventoryNo   = "NEW";
            model.InventoryDate = System.DateTime.Today;
            model.Direction     = "O";
            InventoryOutDetailSessionWrapper.Initialize();

            return(View("CreateEdit", model));
        }
        public ActionResult Edit(long id)
        {
            var inventoryViewModel       = new CreateEditViewModel();
            var inventoryDetailViewModel = new List <InventoryDetailEntryViewModel>();
            var inventory = inventoryOutProvider.GetInventory(id);

            if (inventory != null)
            {
                var inventoryDetail = inventoryOutProvider.GetInventoryDetail(inventory.Id);
                if (inventoryDetail != null)
                {
                    mapper.Map(inventory, inventoryViewModel);
                    mapper.Map(inventoryDetail, inventoryDetailViewModel);
                    InventoryOutDetailSessionWrapper.Initialize(inventoryDetailViewModel);
                    return(View("CreateEdit", inventoryViewModel));
                }
            }

            return(RedirectToAction("Index"));
        }