public ResultView(MainController mainController) { InitializeComponent(); this.mainController = mainController; this.resultController = mainController.resultController; Nummer.ReadOnly = true; Gebruiker.ReadOnly = true; Datum.ReadOnly = true; Bodem.ReadOnly = true; Verdunning.ReadOnly = true; Kolonies.ReadOnly = true; }
//On dateView click private void dataView_onCellClick(object sender, DataGridViewCellEventArgs e) { this.resultController = mainController.resultController; int id = 0; try { //Gets the ID from the selected row id = (int)dataView.Rows[e.RowIndex].Cells[3].Value; } //When user clicks on the DataGrid header (ID,GEBRUIKER, ETC.) // catch (ArgumentOutOfRangeException) { } resultController.OpenResultDialog(e, id); }
/// <summary> /// All the variables are initialized here. /// </summary> private void Initialize() { //Other this.resultModelList = new List <ResultModel>(); this.resultList = new ArrayList(); //Model dbConnection = new ConnectionModel(); //View this.mainForm = new MainForm(); this.mainView = new MainView(this); this.adminLoginView = new AdminLoginView(); this.inleesView = new InleesView(this); this.resultView = new ResultView(this); this.loadMapView = new LoadMapView(this); this.statisticView = new StatisticView(this); //Controller this.mainViewController = new MainViewController(this); this.inleesViewController = new InleesViewController(this); this.resultController = new ResultController(this); this.resultDialogController = new ResultDialogController(this); this.colonyController = new ColonyController(); this.fileSelectController = new FileController(this); this.statisticController = new StatisticController(this); // ADD INLEESVIEW AND RESULTVIEW TO MAINVIEW this.mainViewController.AddToPage(inleesView, 0); this.mainViewController.AddToPage(resultView, 1); this.mainViewController.AddToPage(statisticView, 2); this.mainForm.Controls.Add(mainView); this.mainView.Dock = DockStyle.Fill; this.resultView.Dock = DockStyle.Fill; this.statisticView.Dock = DockStyle.Fill; // START APP Application.EnableVisualStyles(); Application.Run(mainForm); }
/// <summary> /// All the variables are initialized here. /// </summary> private void Initialize() { //Other this.resultModelList = new List<ResultModel>(); this.resultList = new ArrayList(); //Model dbConnection = new ConnectionModel(); //View this.mainForm = new MainForm(); this.mainView = new MainView(this); this.adminLoginView = new AdminLoginView(); this.inleesView = new InleesView(this); this.resultView = new ResultView(this); this.loadMapView = new LoadMapView(this); this.statisticView = new StatisticView(this); //Controller this.mainViewController = new MainViewController(this); this.inleesViewController = new InleesViewController(this); this.resultController = new ResultController(this); this.resultDialogController = new ResultDialogController(this); this.colonyController = new ColonyController(); this.fileSelectController = new FileController(this); this.statisticController = new StatisticController(this); // ADD INLEESVIEW AND RESULTVIEW TO MAINVIEW this.mainViewController.AddToPage(inleesView, 0); this.mainViewController.AddToPage(resultView, 1); this.mainViewController.AddToPage(statisticView, 2); this.mainForm.Controls.Add(mainView); this.mainView.Dock = DockStyle.Fill; this.resultView.Dock = DockStyle.Fill; this.statisticView.Dock = DockStyle.Fill; // START APP Application.EnableVisualStyles(); Application.Run(mainForm); }