Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();

            _uow = new GenericUnitofWork();

            CB_ItemstoShow.Items.Add(nameof(Products));
            CB_ItemstoShow.Items.Add(nameof(Categories));
            CB_ItemstoShow.SelectedIndex = 0;
            UpdateTableItems();
        }
Exemple #2
0
        public CategoryInfoWindow(Categories ctgr, GenericUnitofWork unitofWork)
        {
            InitializeComponent();

            _uow = unitofWork;

            if (ctgr is null)
            {
                Category = new Categories();
            }
            else
            {
                Category     = ctgr;
                TB_Name.Text = ctgr.Name;
            }
        }
Exemple #3
0
        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();
            }
        }