public MainWindow() { InitializeComponent(); _uow = new GenericUnitofWork(); CB_ItemstoShow.Items.Add(nameof(Products)); CB_ItemstoShow.Items.Add(nameof(Categories)); CB_ItemstoShow.SelectedIndex = 0; UpdateTableItems(); }
public CategoryInfoWindow(Categories ctgr, GenericUnitofWork unitofWork) { InitializeComponent(); _uow = unitofWork; if (ctgr is null) { Category = new Categories(); } else { Category = ctgr; TB_Name.Text = ctgr.Name; } }
public ProductInfoWindow(Products prdct, GenericUnitofWork unitofWork) { InitializeComponent(); _uow = unitofWork; CB_Category.ItemsSource = _uow.Repository <Categories>().GetEntities(); CB_Category.DisplayMemberPath = nameof(Categories.Name); if (prdct is null) { Product = new Products(); } else { Product = prdct; InitializeContents(); } }