//新增类别
        private void addCat_Click(object sender, EventArgs e)
        {
            MenuCatgoryForm addCat = new MenuCatgoryForm(db, null);

            if (addCat.ShowDialog() == DialogResult.OK)
            {
                createTree();
            }
        }
        //编辑类别
        private void editCat_Click(object sender, EventArgs e)
        {
            if (catTree.SelectedNode == null ||
                db.Catgory.FirstOrDefault(x => x.name == catTree.SelectedNode.Text) == null)
            {
                GeneralClass.printWarningMsg("没有选择类别!");
                return;
            }

            Catgory         cat     = db.Catgory.FirstOrDefault(x => x.name == catTree.SelectedNode.Text);
            MenuCatgoryForm editCat = new MenuCatgoryForm(db, cat);

            if (editCat.ShowDialog() == DialogResult.OK)
            {
                createTree();
            }
        }
 //新增类别
 private void addCat_Click(object sender, EventArgs e)
 {
     MenuCatgoryForm addCat = new MenuCatgoryForm(db, null);
     if (addCat.ShowDialog() == DialogResult.OK)
         createTree();
 }
        //编辑类别
        private void editCat_Click(object sender, EventArgs e)
        {
            if (catTree.SelectedNode == null ||
                db.Catgory.FirstOrDefault(x => x.name == catTree.SelectedNode.Text) == null)
            {
                GeneralClass.printWarningMsg("没有选择类别!");
                return;
            }

            Catgory cat = db.Catgory.FirstOrDefault(x => x.name == catTree.SelectedNode.Text);
            MenuCatgoryForm editCat = new MenuCatgoryForm(db, cat);
            if (editCat.ShowDialog() == DialogResult.OK)
                createTree();
        }