//新增类别 private void addType_Click(object sender, EventArgs e) { ExpenseTypeForm addJob = new ExpenseTypeForm(db, null); if (addJob.ShowDialog() == DialogResult.OK) { createTree(); } }
//编辑类别 private void editType_Click(object sender, EventArgs e) { if (typeTree.SelectedNode == null || db.Job.FirstOrDefault(x => x.name == typeTree.SelectedNode.Text) == null) { GeneralClass.printErrorMsg("没有选择类别!"); return; } ExpenseType job = db.ExpenseType.FirstOrDefault(x => x.name == typeTree.SelectedNode.Text); ExpenseTypeForm editJob = new ExpenseTypeForm(db, job); if (editJob.ShowDialog() == DialogResult.OK) { createTree(); } }
//新增类别 private void addType_Click(object sender, EventArgs e) { ExpenseTypeForm addJob = new ExpenseTypeForm(db, null); if (addJob.ShowDialog() == DialogResult.OK) createTree(); }
//编辑类别 private void editType_Click(object sender, EventArgs e) { if (typeTree.SelectedNode == null || db.Job.FirstOrDefault(x => x.name == typeTree.SelectedNode.Text) == null) { GeneralClass.printErrorMsg("没有选择类别!"); return; } ExpenseType job = db.ExpenseType.FirstOrDefault(x => x.name == typeTree.SelectedNode.Text); ExpenseTypeForm editJob = new ExpenseTypeForm(db, job); if (editJob.ShowDialog() == DialogResult.OK) createTree(); }