public InventoryIndexViewModel ToViewModel(List <Inventory> models) { var lsInventoryViewModels = _inventoryViewModelBinder.ToViewModel(models); var viewModel = new InventoryIndexViewModel(lsInventoryViewModels); return(viewModel); }
// GET: Inventory public ActionResult Index() { var vm = new InventoryIndexViewModel(); vm.LoadItems(this.Context, this.UserContext, this.UserContext.Territory.CivilianPopulation); return(View(vm)); }
public IActionResult ViewProducts(int?id) { IEnumerable <Inventory> adds = _inventoryService.GetAll(); if (id == null) { InventoryIndexViewModel vb = new InventoryIndexViewModel { Inventories = adds }; return(View(vb)); } Inventory p = _inventoryService.GetSingle(x => x.ProductId == id.Value); if (p == null) { return(NotFound()); } InventoryIndexViewModel vm = new InventoryIndexViewModel { Inventories = adds, InvenDetail = p }; return(View(vm)); }
public IActionResult Index() { IEnumerable <Inventory> adds = _inventoryService.GetAll(); InventoryIndexViewModel vm = new InventoryIndexViewModel { Inventories = adds }; return(View(adds)); }
public ActionResult Index() { List <Flavor> flavors = _db.Flavors.OrderBy(f => f.Name).ToList(); List <Treat> treats = _db.Treats.OrderBy(t => t.Name).ToList(); List <FlavorTreat> combos = _db.FlavorTreats.OrderBy(ft => ft.TreatId).ToList(); InventoryIndexViewModel model = new InventoryIndexViewModel() { AllFlavors = flavors, AllTreats = treats, AllCombinations = combos }; return(View(model)); }
public async Task <IActionResult> Index(string search, string filter, int page = 1, int ipp = 10) { ViewData["FilterValue"] = !String.IsNullOrWhiteSpace(filter) ? filter : String.Empty; ViewData["SearchValue"] = !String.IsNullOrWhiteSpace(search) ? search : String.Empty; ViewData["PageValue"] = page; ViewData["IppValue"] = ipp; var parts = await _partsService.GetPaginatedPartsBySearchParams(search, filter, page, ipp); var viewModel = new InventoryIndexViewModel() { PaginatedParts = _pListMapper.MapToViewModelList <PartViewModel, Part>(parts) }; return(View(viewModel)); }
public IActionResult Index(InventoryIndexViewModel model, DrugService service, long fac = 0) { CoreService core = new CoreService(HttpContext); model.Facilities = core.GetFacilitiesIEnumerable(); if (fac.Equals(0)) { model.Active = core.GetFacility(Convert.ToInt64(model.Facilities[0].Value)); } else { model.Active = core.GetFacility(fac); } model.InventoryDrugs = service.GetInventoryDrugs(model.Active, null); return(View(model)); }