Esempio n. 1
0
        //NEEDS FURTHER CHECKS!! WHAT HAPPENS IF A MODEL IMPLEMENTING IMODEL CLASS IS CASTED TO A MODEL IMPLEMENTING IUPDATERMODEL? WHAT HAPPENS TO THE UPDATE AND DELETE METHODS?
        public void setModel(IModel model)
        {
            this.model = (IUpdaterModel)model;

            if (!model.hasDBConnection())
            {
                view.disableControls();
            }
        }
        public void setModel(IModel model)
        {
            this.model = (IUpdaterModel)model;

            //La momentul setarii model se verfica daca exista conexiune la baza de date si se dezactiveaza/activeaza controlalele din interfata
            if (!model.hasDBConnection())
            {
                disableViewControls();
            }
            else
            {
                //enableViewControls();
            }
        }
Esempio n. 3
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);
        }
Esempio n. 4
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);
        }
Esempio n. 5
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);
        }
 public UpdateUserDataController(IView view, IUpdaterModel model)
 {
     this.view  = view;
     this.model = model;
 }
Esempio n. 7
0
 public BudgetPlanManagementController(IView view, IUpdaterModel model)
 {
     this.view  = view;
     this.model = model;
 }