public SearchProductPresenter(IStateManager manager, WorkCompletedCallBack callBack) : base(manager)
 {
     Form           = (ISearchProductView)FormFactory.CreateForm("SearchProductForm", new object[] { this });
     ProductSection = new ProductSection(Form.ProductDataTable, this, Form);
     Form.SetSearchParams(ProductSection.GetSearchParameters());
     ProductSection.UpdateVisibleProducts();
     Callback  = callBack;
     Form.Text = Title;
 }
示例#2
0
        public HomePresenter(IStateManager manager) : base(manager)
        {
            Form = (IHomeView) FormFactory.CreateForm("MainForm", new object[] {this});
            //onClosingEvent to stop the application
            ((Form) Form).FormClosing += (sender, args) => ApplicationState.IsRunning = false;
            ProductSection = new ProductSection(Form.ProductDataTable, this, Form);
            SettingsSection = new SettingsSection(this);

            StateManager.EventManager.AddEvent(new Event(
                Config.EventListenerImmediate,
                CheckIsLoginHandler,
                GetStateManager().EventManager,
                true));

            IsProductsDisplayed = false;
            Form.TabLabelText = Tab1LabelText;
            Form.SetSearchParams(ProductSection.GetSearchParameters());


            if (!StateManager.UserSession.IsActive) //prevent any actions till login
                return;
        }