Esempio n. 1
0
        public void InitView(ProductFinderModel model)
        {
            _model = model;

            tbBarcord.DataBindings.Add("Text", _model, "Barcode", true, DataSourceUpdateMode.OnPropertyChanged);
            tbName.DataBindings.Add("Text", _model, "Name", true, DataSourceUpdateMode.OnPropertyChanged);
            dgvProducts.DataBindings.Add("DataSource", _model, "Products", true, DataSourceUpdateMode.OnPropertyChanged);
        }
Esempio n. 2
0
        public ProductFinderPresenter(IProductFinderView view)
        {
            _business      = new ProductBusiness(Singleton <PosEngine> .Instance.Resolve <IRepository <Product> >());
            _businessPrice = new ProductPriceBusiness(Singleton <PosEngine> .Instance.Resolve <IRepository <ProductPrice> >());
            _view          = view;

            _model                 = new ProductFinderModel(new Product());
            _model.Products        = new List <Product>();
            _model.SearchProductFn = new ProductFinderModel.SearchProductDelegate(HandleSearchProduct);

            _view.InitView(_model);
        }