private void btnEditNode_Click(object sender, EventArgs e) { using (DepartmentView departmentView = new DepartmentView(_mainViewModel.DepartmentID, _mainViewModel.CompanyID)) { departmentView.ShowDialog(); if (departmentView.DialogResult == DialogResult.OK) { SetAllDataSource(); } } }
private void btnAdd_Click(object sender, EventArgs e) { using (DepartmentView departmentView = new DepartmentView(0)) { departmentView.ShowDialog(); if (departmentView.DialogResult == DialogResult.OK) { dgwCompany.DataSource = _companyViewModel.GetAllCompanies(); dgwCompany.DataMember = "Company"; } } }