private void btnNewProgram_Click(object sender, EventArgs e) { FrmAddEditPrograms frm = new FrmAddEditPrograms(MethodType.Add, new Actions()); frm.ShowDialog(); treeActionList.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(); } }