public AddEditForm(AddEditPresenter presenter) { this.presenter = presenter; InitializeComponent(); this.departmentCombobox.Items.AddRange(presenter.GetDepartmentNames().ToArray()); this.departmentCombobox.DropDownStyle = ComboBoxStyle.DropDownList; }
/// <summary> /// Opens another form to add a new employee /// </summary> public void OpenAddDialog() { AddEditPresenter addPresenter = new AddEditPresenter(this,model, ViewMode.Add); }
/// <summary> /// Opens another form to edit an employee /// </summary> /// <param name="selectedNode">The employee selected in a treeview.</param> public void OpenEditDialog(TreeNode selectedNode) { Empoyee employee = employees.First(e => e.ID == (decimal)selectedNode.Tag); AddEditPresenter editPresenter = new AddEditPresenter(this,model,ViewMode.Edit,employee); }