public OpenCloseOrder(Employee empl) { employee = empl; products = new ObservableCollection <Product>(); IRepController controller = new RepositoryController(); products = controller.GetDBProducts(); Requiers = controller.GetDBRequiersTo(employee.center); InitializeComponent(); ProductsList.Items.Clear(); RequiersTable.ItemsSource = Requiers; ProductsList.ItemsSource = products; ProductsList.DisplayMemberPath = "Name"; }
public void Execute() { IRepController repository = new RepositoryController(); Employee employee = EmployeeWindow.GetInstance().employe; ObservableCollection <ProductPosition> products = repository.GetStorageProducts(employee.center); foreach (ProductPosition product in products) { ProductsViewer.ProductsOnStorage.Add(new ViewerObject(product)); } ObservableCollection <Require> requiersTo = repository.GetDBRequiersTo(employee.center); ObservableCollection <Require> requiersFrom = repository.GetDBRequiersFrom(employee.center); foreach (ViewerObject viewObj in ProductsViewer.ProductsOnStorage) { viewObj.SetNumberFrom(requiersFrom); viewObj.SetNumberTo(requiersTo); } }