public RolePresenter() { _view = new RoleView(); _services = new RoleServices(new RoleRepository(), new ModelDataAnnotationCheck()); _roleManager = new RoleManager(); _roleManager = new RoleManager(); _roleManager.TreeView = _view.TreeViewAction; // Enable buttons _roleManager.EnableButtons((Form)_view); // Atur DataSource ComboBox menu var listKvp = _roleManager.DataSourceMenuParent(); _view.ComboBoxMenu.SetDataSource(listKvp, false); PopulateMenuStripToTreeView(); _view.OnLoadData += _view_LoadData; _view.OnListDataGridSelectionChanged += _view_OnListDataGridSelectionChanged; _view.OnComboBoxMenuSelectedIndexChanged += _view_OnComboBoxMenuSelectedIndexChanged; _view.OnButtonTambahClick += _view_OnCreateData; _view.OnButtonUbahClick += _view_OnUpdateData; _view.OnButtonHapusClick += _view_OnDeleteData; _view.OnButtonRefreshClick += _view_OnRefreshData; _view.OnButtonUpdateActionClick += _view_OnButtonUpdateActionClick; _view.OnDataGridCellDoubleClick += OnDataGrid_CellDoubleClick; }
public RolePresenter(IRoleView view, RoleModel model) { _view = view; _model = model; InitializeFields(); }