示例#1
0
        public BudgetPlanManagementForm(int userID)
        {
            InitializeComponent();
            this.userID          = userID;
            this.buttons         = new Button[] { submitButtonBPManagement, deleteButtonBPManagement };
            this.datePickers     = new DateTimePicker[] { dateTimePickerBPManagement };
            this.gridViewManager = new DataGridViewManager(dataGridViewBPManagement);

            //Sets the default date of the date time picker as the first day of the current month of the current year(before the MVC is set up so the date setting action does not trigger the data retrieval method from the model)
            setDateTimePickerDefaultDate(datePickers);

            controller = new BudgetPlanManagementController();
            model      = new BudgetPlanManagementModel();

            wireUp(controller, model);
        }
示例#2
0
        private void wireUp(IUpdaterControl paramController, IUpdaterModel paramModel)
        {
            if (model != null)
            {
                model.removeObserver(this);
            }

            this.model      = paramModel;
            this.controller = paramController;

            //Reversing the method calls
            controller.setView(this);
            controller.setModel(model);

            model.addObserver(this);
        }
示例#3
0
        private void wireUp(IUpdaterControl paramController, IUpdaterModel paramModel)
        {
            if (model != null)
            {
                model.removeObserver(this);
            }

            this.controller = paramController;
            this.model      = paramModel;

            //Reverses the method calls so that NPE is avoided when there's no DB conection (otherwise the disableControls() method of the View would be called on a null object)
            controller.setView(this);
            controller.setModel(model);


            model.addObserver(this);
        }