コード例 #1
0
 //新增职位
 private void addOfficer_Click(object sender, EventArgs e)
 {
     JobForm addJob = new JobForm(db, null);
     if (addJob.ShowDialog() == DialogResult.OK)
         createTree();
 }
コード例 #2
0
        //编辑职位
        private void editOfficer_Click(object sender, EventArgs e)
        {
            if (jobTree.SelectedNode == null ||
                db.Job.FirstOrDefault(x => x.name == jobTree.SelectedNode.Text) == null)
            {
                GeneralClass.printErrorMsg("没有选择类别!");
                return;
            }

            Job job = db.Job.FirstOrDefault(x => x.name == jobTree.SelectedNode.Text);
            JobForm editJob = new JobForm(db, job);
            if (editJob.ShowDialog() == DialogResult.OK)
                createTree();
        }