示例#1
0
 /// <summary>
 /// 修改部门
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void btnModify_Click(object sender, EventArgs e)
 {
     if (tv_left.SelectedNode != null)
     {
         Bse_Department model = instance.GetDeptModel(" And Dept_Code='" + tv_left.SelectedNode.Name + "'");
         Dept dept = new Dept(instance, employeeInstance, model);
         dept.OperationType = OperationTypeEnum.Edit;
         dept.FormClosing += new FormClosingEventHandler(dept_FormClosing);
         dept.ShowDialog();
     }
 }
示例#2
0
 /// <summary>
 /// 添加部门
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void btnAddDept_Click(object sender, EventArgs e)
 {
     Dept dept = new Dept(instance, employeeInstance, null);
     dept.OperationType = OperationTypeEnum.Add;
     //dept.FormClosing += new FormClosingEventHandler(dept_FormClosing);
     if (tv_left.SelectedNode != null)
     {
         dept.SetDeptPCode(tv_left.SelectedNode.Name.ToString(), tv_left.SelectedNode.Text);
     }
     else
     {
         if (tv_left.Nodes.Count > 0)
         {
             dept.SetDeptPCode(tv_left.Nodes[0].Name.ToString(), tv_left.Nodes[0].Text);
         }
     }
     dept.ShowDialog();
 }