public static WarehousesViewModel MapToViewModel(IEnumerable <Warehouse> items) { var result = new WarehousesViewModel(); result.Warehouses = items.Select(x => new WarehouseViewModel(x)).ToList(); return(result); }
public AppViewModel(SuppliersViewModel suppliersViewModel, WarehousesViewModel warehousesViewModel, EmployeesViewModel employeesViewModel, ProductsViewModel productsViewModel, SuppliesViewModel suppliesViewModel) { PageViewModels.Add(suppliersViewModel); PageViewModels.Add(warehousesViewModel); PageViewModels.Add(employeesViewModel); PageViewModels.Add(productsViewModel); PageViewModels.Add(suppliesViewModel); CurrentPageViewModel = PageViewModels[0]; }
private IEnumerable <WarehousesViewModel> PreencherDeInventarioParaWarehouse(IEnumerable <Inventario> inventario) { var warehousesView = new List <WarehousesViewModel>(); foreach (var movimento in inventario) { var novoMovimento = new WarehousesViewModel() { Locality = movimento.Localidade, Quantity = movimento.Quantidade, Type = movimento.Tipo }; warehousesView.Add(novoMovimento); } return(warehousesView); }