private void btnAdd_Click(object sender, EventArgs e) { if (treeActionList.GetFocusedRow() is Actions item) { frmAddEditDocActionTree frm = new frmAddEditDocActionTree(category, item, MethodType.Add); frm.ShowDialog(); dropdownsBindingSource.DataSource = new BindingList <Actions>(new UnitOfWork().ActionsRepo.Get()); } }
private void btnEdit_Click(object sender, EventArgs e) { if (treeActionList.GetFocusedRow() is Actions item) { if (category == "Program") { FrmAddEditPrograms frmAddEditPrograms = new FrmAddEditPrograms(MethodType.Edit, item); frmAddEditPrograms.ShowDialog(); dropdownsBindingSource.DataSource = new BindingList <Actions>(new UnitOfWork().ActionsRepo.Get()); return; } frmAddEditDocActionTree frm = new frmAddEditDocActionTree(category, item, MethodType.Edit); frm.ShowDialog(); treeActionList.ExpandAll(); } }