private void processDutyOrgNode(int parentID, TreeNode node) { string nodeName = ""; TreeNode currentNode; ArrayList nodeList = UserOrgStruct.getInctance().getNodesFormParentID(parentID); for (int i = 0; i < nodeList.Count; i++) { UserOrgStructTable record = (UserOrgStructTable)nodeList[i]; if (record.departmentOrStaff == 1) { nodeName = Staff.getInctance().getStaffNameFromPkey(record.value); // 用户在线或者不在线,使用不同的图片 if (Staff.getInctance().isOnline(record.value)) { m_tree.addNode(node, nodeName, 3, 3, Convert.ToString(record.pkey)); } else { m_tree.addNode(node, nodeName, 2, 2, Convert.ToString(record.pkey)); } } else { nodeName = AuxiliaryMaterial.getInctance().getAuxiliaryMaterialNameFromPkey("BASE_DEPARTMENT_LIST", record.value); currentNode = m_tree.addNode(node, nodeName, 0, 1, Convert.ToString(record.pkey)); processDutyOrgNode(record.pkey, currentNode); } } }
private void staffRemove_Click(object sender, EventArgs e) { if (MessageBoxExtend.messageQuestion("确定移除[" + m_name + "]吗?")) { UserOrgStruct.getInctance().delete(m_pkey); refreshTreeView(); } }
private void departmentRemove_Click(object sender, EventArgs e) { if (UserOrgStruct.getInctance().getChildNodesCount(m_pkey) == 0) { if (MessageBoxExtend.messageQuestion("确定移除[" + m_name + "]吗?")) { UserOrgStruct.getInctance().delete(m_pkey); refreshTreeView(); } } else { MessageBoxExtend.messageWarning("[" + m_name + "] 移除失败,请移除隶属的用户,然后重试."); } }
private void delete_Click(object sender, EventArgs e) { if (UserOrgStruct.getInctance().getPkeyFromValue(m_currentDataGridViedRecordPkey) == -1) { if (m_currentDataGridViedRecordPkey != 0) { if (MessageBoxExtend.messageQuestion("确定删除[" + m_currentDataGridViedRecordCompanyName + "]吗?")) { Staff.getInctance().delete(m_currentDataGridViedRecordPkey); updateDataGridView(getCurrentNodeAllChildNodesStaff()); } } } else { MessageBoxExtend.messageWarning("[" + m_currentDataGridViedRecordCompanyName + "]删除失败,该用户已被关联到系统登录用户\n请先在系统登录中移除,然后重试!"); } }
private void staffAdd_Click(object sender, EventArgs e) { FormCreateUser fcu = new FormCreateUser(); fcu.ShowDialog(); if (fcu.isAddStaff()) { UserOrgStructTable userOrgStructData = new UserOrgStructTable(); userOrgStructData.value = fcu.getSelectRecordPkey(); userOrgStructData.departmentOrStaff = 1; // 0:部门 1:员工 userOrgStructData.parentPkey = m_pkey; if (userOrgStructData.value != 0) { UserOrgStruct.getInctance().insert(userOrgStructData); refreshTreeView(); } } }
private void departmentAdd_Click(object sender, EventArgs e) { ArrayList tables = new ArrayList(); tables.Add("BASE_DEPARTMENT_LIST"); FormBaseAuxiliaryMaterial fbam = new FormBaseAuxiliaryMaterial(tables, "部门信息管理", true); fbam.ShowDialog(); UserOrgStructTable userOrgStructData = new UserOrgStructTable(); userOrgStructData.value = fbam.getSelectRecordPkey(); userOrgStructData.departmentOrStaff = 0; // 0:部门 1:员工 userOrgStructData.parentPkey = m_pkey; if (userOrgStructData.value != 0) { UserOrgStruct.getInctance().insert(userOrgStructData); refreshTreeView(); } }