Ejemplo n.º 1
0
 public void TestInitialize()
 {
     dataModel = new Model.DataModel();
     customerPresentationModel = new CustomerPresentationModel(dataModel);
     customerPresentationModel.PropertyChanged += CustomerSidePresentationModel_PropertyChanged;
     string totalPrice = customerPresentationModel.TotalPrice;
 }
Ejemplo n.º 2
0
 public CustomerSide(DataModel dataModel)
 {
     InitializeComponent();
     this._categoryTabControl.SelectedIndexChanged += new System.EventHandler(this.ClickMealTabPage);
     _dataModel = dataModel;
     _dataModel._modelChanged    += UpdateView;
     _dataModel._categoryChanged += RefreshTabPage;
     _customerPresentationModel   = new CustomerPresentationModel(_dataModel);
     GetTablePage();
     this._orderDataGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.ChangeRowData);
     GetTabPagesButton(_categoryTabControl.SelectedTab);
     _totalLabel.DataBindings.Add(Constant.ITEM_TEXT, _customerPresentationModel, Constant.NOTIFY_TOTAL_PRICE);
     _pageLabel.DataBindings.Add(Constant.ITEM_TEXT, _customerPresentationModel, Constant.NOTIFY_PAGE_LABEL);
     _nextPageButton.DataBindings.Add(Constant.ITEM_ENABLE, _customerPresentationModel, Constant.NOTIFY_NEXT_PAGE);
     _previousPageButton.DataBindings.Add(Constant.ITEM_ENABLE, _customerPresentationModel, Constant.NOTIFY_PREVIOUS_PAGE);
     _addButton.DataBindings.Add(Constant.ITEM_ENABLE, _customerPresentationModel, Constant.NOTIFY_ADD_BUTTON);
     _orderDataGridView.DataSource = _dataModel.GetOrder.OrderMealList;
 }
 //初始化
 public void Initialization()
 {
     _model = new Model();
     _customerPresentationModel = new CustomerPresentationModel(_model);
 }