private void txtAttachEmpName_ButtonCustomClick(object sender, EventArgs e) { frmSelectEmp frmSelectEmp = new frmSelectEmp(true); frmSelectEmp.empIds = txtAttachEmpID.Text.Split(',').Select(a => (int?)a.ToInt32()).ToArray(); frmSelectEmp.OrgID = cboOrgID.SelectedValue.ToInt32(); frmSelectEmp.DeptID = cboDeptID.SelectedValue.ToInt32(); DialogResult rst = frmSelectEmp.ShowDialog(); if (rst == DialogResult.OK) { List <HR_EmployeeResult> rstList = frmSelectEmp.GetSelectList <HR_EmployeeResult>(); if (rstList != null && rstList.Count > 0) { if (txtAttachEmpID.Text.Length > 0) { txtAttachEmpID.Text = txtAttachEmpID.Text + "," + string.Join(",", rstList.Select(a => a.EmpID).ToArray()); txtAttachEmpName.Text = txtAttachEmpName.Text + "," + string.Join(",", rstList.Select(a => a.EmpName).ToArray()); } else { txtAttachEmpID.Text = string.Join(",", rstList.Select(a => a.EmpID).ToArray()); txtAttachEmpName.Text = string.Join(",", rstList.Select(a => a.EmpName).ToArray()); } } } }
private void btnAddEmps_Click(object sender, EventArgs e) { if (_roleID <= 0) { this.ShowMessage("请先选择角色!"); return; } frmSelectEmp frm = new frmSelectEmp(true); frm.ShowDialog(); List <HR_EmployeeResult> slcList = frm.GetSelectList <HR_EmployeeResult>(); if (slcList.Count > 0) { int?[] arrEmpIds = slcList.Select(a => (int?)a.EmpID).ToArray(); Sys_EmpDataRightLogic logic = new Sys_EmpDataRightLogic(this); WCFAddUpdateResult rst = logic.AddRoleEmpIDs(new Sys_EmpDataRightParam() { RoleID = _roleID.ToString(), RoleName = _roleName, EmpIDs = arrEmpIds }); if (rst.Key > 0) { LoadEmpList(); } } }
private void txtManagerName_ButtonCustomClick(object sender, EventArgs e) { frmSelectEmp frmSelectEmp = new frmSelectEmp(false); frmSelectEmp.empIds = txtManagerID.Text.Split(',').Select(a => (int?)a.ToInt32()).ToArray(); DialogResult rst = frmSelectEmp.ShowDialog(); if (rst == DialogResult.OK) { List <HR_EmployeeResult> rstList = frmSelectEmp.GetSelectList <HR_EmployeeResult>(); if (rstList != null && rstList.Count > 0) { txtManagerID.Text = string.Join(",", rstList.Select(a => a.EmpID).ToArray()); txtManagerName.Text = string.Join(",", rstList.Select(a => a.EmpName).ToArray()); } } }
private void txtOperEmpName_ButtonCustomClick(object sender, EventArgs e) { frmSelectEmp frmSelectEmp = new frmSelectEmp(false); frmSelectEmp.empIds = txtOperEmpID.Text.Split(',').Select(a => (int?)a.ToInt32()).ToArray(); frmSelectEmp.OrgID = cboOperOrgID.SelectedValue.ToInt32(); frmSelectEmp.DeptID = txtOperDeptID.Text.ToInt32(); DialogResult rst = frmSelectEmp.ShowDialog(); if (rst == DialogResult.OK) { List <HR_EmployeeResult> rstList = frmSelectEmp.GetSelectList <HR_EmployeeResult>(); if (rstList != null && rstList.Count > 0) { txtOperEmpID.Text = rstList[0].EmpID.ToStringHasNull(); txtOperEmpName.Text = rstList[0].EmpName; } } }