/// <summary> /// Initializes the view model. /// </summary> public void Init(InventoriesRepository inventoriesRepository, UnitsRepository unitsRepository) { InventoriesSelectListItems = new SelectList( inventoriesRepository.GetAll(), "ProductCode", "ProductCode"); UnitsSelectListItems = new SelectList( unitsRepository.GetList(), "Id", "Name"); }
public ActionResult Index() { IList <Unit> units = _unitsRepository.GetList(); var viewModel = new UnitsBaseViewModel() { Units = units }; return(View(viewModel)); }
/// <summary> /// Initializes the view model. /// </summary> public void Init(ProductTypesRepository productTypesRepository, SuppliersRepository suppliersRepository, UnitsRepository unitsRepository, string userId) { ProductTypesSelectListItems = new SelectList( productTypesRepository.GetList(), "Id", "Name"); SuppliersSelectListItems = new SelectList( suppliersRepository.GetList(), "Id", "Name"); UnitsSelectListItems = new SelectList( unitsRepository.GetList(), "Id", "Name", "Quantity"); }
/// <summary> /// Initializes the view model. /// </summary> public void Init(UnitsRepository unitsRepository) { UnitsSelectListItems = new SelectList( unitsRepository.GetList(), "Id", "Name", "Quantity"); }