Ejemplo n.º 1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            Category category = gridUtility.GetSelectedItem <Category>();

            if (category != null)
            {
                frmEditCategory frmEdit = new frmEditCategory(category);
                frmEdit.Show();
            }
        }
Ejemplo n.º 2
0
        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;
        }