private void btnEdit_Click(object sender, EventArgs e) { Category category = gridUtility.GetSelectedItem <Category>(); if (category != null) { frmEditCategory frmEdit = new frmEditCategory(category); frmEdit.Show(); } }
private void tsEditCate_Click(object sender, EventArgs e) { TreeTag treetag = treeView1.SelectedNode.Tag as TreeTag; Category cate; using (IUnitOfWork uow = new UnitOfWork()) { cate = uow.CategoryRepository.Find(treetag.CateId); uow.Commit(); } if (cate == null) { return; } frmEditCategory frmEdit = new frmEditCategory(cate); Enabled = false; frmEdit.UpdateNode = updateNode; frmEdit.Show(); Enabled = true; }