void BtnAlter_Click(object sender, RoutedEventArgs e) { if (DtGrid.SelectedItems.Count > 0) { SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW SelectedEmployee = DtGrid.SelectedItems[0] as SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW; if (!SMT.SaaS.FrameworkUI.Common.Utility.ToolBarButtonOperationPermission(SelectedEmployee, "T_HR_EMPLOYEE", SMT.SaaS.FrameworkUI.OperationType.Edit, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID)) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("NOEDITPERMISSION"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); return; } Form.Personnel.EmployeeForm form = new SMT.HRM.UI.Form.Personnel.EmployeeForm(FormTypes.Edit, SelectedEmployee.EMPLOYEEID); EntityBrowser browser = new EntityBrowser(form); //form.MinWidth = 1000; ////form.MinWidth = 900; //form.MinHeight = 700; //form.MinHeight = 700; browser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); } else { //ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRMBUTTON")); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "EDIT"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } }
private void AuthorizationBtn_Click(object sender, RoutedEventArgs e) { Button AuthorBtn = sender as Button; SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW AuthorUser = AuthorBtn.Tag as SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW; permclient.GetUserByEmployeeIDAsync(AuthorUser.EMPLOYEEID); }
void client_GetEmpOrgInfoByIDCompleted(object sender, GetEmpOrgInfoByIDCompletedEventArgs e) { try { if (e.Error != null || e.Result == null) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message)); } else { SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW employeeView = e.Result; string strOrgName = employeeView.POSTNAME + " - " + employeeView.DEPARTMENTNAME + " - " + employeeView.COMPANYNAME; if (!string.IsNullOrWhiteSpace(strOrgName)) { strOrgName = EmployeeCheck.T_HR_EMPLOYEE.EMPLOYEECNAME + " - " + strOrgName; } //T_HR_EMPLOYEE ent = new T_HR_EMPLOYEE(); //ent.EMPLOYEEID = employeeView.EMPLOYEEID; //ent.EMPLOYEECODE = employeeView.EMPLOYEECODE; //ent.OWNERID = employeeView.OWNERID; //ent.OWNERPOSTID = employeeView.OWNERPOSTID; //ent.OWNERDEPARTMENTID = employeeView.OWNERDEPARTMENTID; //ent.OWNERCOMPANYID = employeeView.OWNERCOMPANYID; lkEmployeeName.TxtLookUp.Text = strOrgName; //lkEmployeeName.DataContext = ent; } } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message + ex.Message)); } }
private void DtGrid_LoadingRow(object sender, DataGridRowEventArgs e) { SetRowLogo(DtGrid, e.Row, "T_SYS_FBADMIN"); SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW UserT = (SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW)e.Row.DataContext; //Button MyAuthorBtn = DtGrid.Columns[7].GetCellContent(e.Row).FindName("AuthorizationBtn") as Button; //MyAuthorBtn.Tag = UserT; }
void DtGrid_CurrentCellChanged(object sender, EventArgs e) { DataGrid grid = sender as DataGrid; if (grid.SelectedItem != null) { SelectedEmployee = (SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW)grid.SelectedItems[0]; } }
private void BtnDel_Click(object sender, RoutedEventArgs e) { Button delBtn = sender as Button; SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW MeetingV = delBtn.Tag as SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW; listEmpolyeeView.Remove(MeetingV); dgmember.ItemsSource = null; BindData(); }
private void dgmember_LoadingRow(object sender, DataGridRowEventArgs e) { SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW StaffV = (SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW)e.Row.DataContext; Button DelBtn = dgmember.Columns[4].GetCellContent(e.Row).FindName("BtnDel") as Button; DelBtn.Tag = StaffV; int index = e.Row.GetIndex(); var cell = dgmember.Columns[0].GetCellContent(e.Row) as TextBlock; cell.Text = (index + 1).ToString(); }
void BtnView_Click(object sender, RoutedEventArgs e) { if (DtGrid.SelectedItems.Count > 0) { SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW SelectedEmployee = DtGrid.SelectedItems[0] as SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW; Form.Personnel.EmployeeForm form = new SMT.HRM.UI.Form.Personnel.EmployeeForm(FormTypes.Browse, SelectedEmployee.EMPLOYEEID); EntityBrowser browser = new EntityBrowser(form); browser.FormType = FormTypes.Browse; //browser.MinWidth = 1000; ////form.MinWidth = 900; //browser.MinHeight = 700; //form.MinHeight = 700; browser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); } else { //ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRMBUTTON")); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } }
private void btnDel_Click(object sender, RoutedEventArgs e) { if (SelectedEmployee != null) { if (this.DtGrid.SelectedItems != null) { SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW employee = DtGrid.SelectedItem as SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEVIEW; //var Ents = from ent in LstFbAdmin // where ent.OWNERCOMPANYID == employee.OWNERCOMPANYID && ent.OWNERPOSTID == employee.OWNERPOSTID // && ent.OWNERDEPARTMENTID == employee.OWNERDEPARTMENTID // && ent.EMPLOYEEID == employee.EMPLOYEEID // select ent; //if (Ents != null) //{ // if (Ents.Count() > 0) // { // //if(Ents.FirstOrDefault().) // } //} if (DtGrid.SelectedItems.Count > 1) { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), "只能删除单条记录,请重新选择!", Utility.GetResourceStr("CONFIRMBUTTON")); } else { if (employee != null) { strSelectEmployeeID = employee.EMPLOYEEID; permclient.DeleteFbAdminAsync(employee.EMPLOYEEID, employee.OWNERCOMPANYID); } } } } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), "请选择需要删除的信息", Utility.GetResourceStr("CONFIRMBUTTON")); } }
void ckh_Click(object sender, RoutedEventArgs e) { CheckBox chk = sender as CheckBox; var ent = dgEmployeeList.SelectedItem as PersonnelWS.V_EMPLOYEEVIEW; var tmps = from n in SelectedEmployees where n.EMPLOYEEID == ent.EMPLOYEEID select n; //这里判断了,但是可能会导致存入不了相同EMPLOYEEID的数据,例如一个员工有两个岗位, //那么后面就会只有一条数据,所以注释掉 //bool bIsNotExists = false; //if (tmps != null) //{ // if (tmps.Count() > 0) // { // bIsNotExists = true; // } //} //PersonnelWS.T_HR_EMPLOYEE temp = new PersonnelWS.T_HR_EMPLOYEE(); //temp.EMPLOYEEID = ent.EMPLOYEEID; //temp.EMPLOYEECNAME = ent.EMPLOYEECNAME; //temp.EMPLOYEECODE = ent.EMPLOYEECODE; //temp.SEX = ent.SEX; //temp.IDNUMBER = ent.IDNUMBER; //temp.OWNERCOMPANYID = ent.OWNERCOMPANYID; //temp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID; //temp.OWNERPOSTID = ent.OWNERPOSTID; /// <summary> /// Modify Desc:在信息的处理中,在初始值中不能加入列表选择信息,所以在checkbox选择中 /// 进行数据加入和移除,然后传入到初始值中进行初始化,而且也要注意不同表单 /// 要传入的值可能不一样,这是目前发现用到的信息,以后有需要可继续加入 /// Modify Date:2012-8-8 //信息存入视图 PersonnelWS.V_EMPLOYEEVIEW temp = new PersonnelWS.V_EMPLOYEEVIEW(); temp.EMPLOYEEID = ent.EMPLOYEEID; temp.EMPLOYEECNAME = ent.EMPLOYEECNAME; temp.EMPLOYEECODE = ent.EMPLOYEECODE; temp.SEX = ent.SEX; temp.IDNUMBER = ent.IDNUMBER; temp.OWNERCOMPANYID = ent.OWNERCOMPANYID; temp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID; temp.OWNERPOSTID = ent.OWNERPOSTID; temp.ISAGENCY = ent.ISAGENCY; temp.POSTLEVEL = ent.POSTLEVEL; temp.EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID; temp.COMPANYNAME = ent.COMPANYNAME; temp.DEPARTMENTNAME = ent.DEPARTMENTNAME; temp.POSTNAME = ent.POSTNAME; temp.MOBILE = ent.MOBILE; temp.OFFICEPHONE = ent.OFFICEPHONE; //存入数据到V_EMPLOYEEVIEW视图和部门,岗位表 PersonnelWS.V_EMPLOYEEVIEW vTemp = new PersonnelWS.V_EMPLOYEEVIEW(); vTemp.EMPLOYEEID = ent.EMPLOYEEID; vTemp.EMPLOYEECNAME = ent.EMPLOYEECNAME; vTemp.EMPLOYEECODE = ent.EMPLOYEECODE; vTemp.SEX = ent.SEX; vTemp.IDNUMBER = ent.IDNUMBER; vTemp.OWNERCOMPANYID = ent.OWNERCOMPANYID; vTemp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID; vTemp.OWNERPOSTID = ent.OWNERPOSTID; vTemp.DEPARTMENTNAME = ent.DEPARTMENTNAME; vTemp.POSTNAME = ent.POSTNAME; vTemp.POSTLEVEL = ent.POSTLEVEL; vTemp.ISAGENCY = ent.ISAGENCY; vTemp.EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID; vTemp.MOBILE = ent.MOBILE; vTemp.OFFICEPHONE = ent.OFFICEPHONE; //信息存入PersonnelWS.T_HR_POSTDICTIONARY里 PersonnelWS.T_HR_POSTDICTIONARY postDicTemp = new PersonnelWS.T_HR_POSTDICTIONARY(); postDicTemp.POSTNAME = ent.POSTNAME; postDicTemp.POSTLEVEL = ent.POSTLEVEL; //信息存入PersonnelWS.T_HR_DEPARTMENTDICTIONARY里 PersonnelWS.T_HR_DEPARTMENTDICTIONARY departmentTemp = new PersonnelWS.T_HR_DEPARTMENTDICTIONARY(); departmentTemp.DEPARTMENTNAME = ent.DEPARTMENTNAME; //把信息存入PersonnelWS.T_HR_POST,然后再把PersonnelWS.T_HR_POST数据存入PersonnelWS.T_HR_EMPLOYEEPOST //最后把数据存入PersonnelWS.T_HR_EMPLOYEEPOST //注意他们之间数据类型转换 PersonnelWS.T_HR_POST tempPerWSPost = new PersonnelWS.T_HR_POST(); tempPerWSPost.POSTLEVEL = ent.POSTLEVEL; tempPerWSPost.POSTID = ent.OWNERPOSTID; PersonnelWS.T_HR_EMPLOYEE tempEmployee = new PersonnelWS.T_HR_EMPLOYEE(); tempEmployee.EMPLOYEECNAME = ent.EMPLOYEECNAME; tempEmployee.EMPLOYEEID = ent.EMPLOYEEID; tempEmployee.EMPLOYEEENAME = ent.EMPLOYEEENAME; tempEmployee.EMPLOYEECODE = ent.EMPLOYEECODE; //把PersonnelWS.T_HR_EMPLOYEEPOST信息存入,有些表单可能会用到 PersonnelWS.T_HR_EMPLOYEEPOST tempPerWSEmployeePost = new PersonnelWS.T_HR_EMPLOYEEPOST(); tempPerWSEmployeePost.EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID; tempPerWSEmployeePost.ISAGENCY = ent.ISAGENCY; tempPerWSEmployeePost.POSTLEVEL = ent.POSTLEVEL; tempPerWSEmployeePost.T_HR_POST = tempPerWSPost; tempPerWSEmployeePost.T_HR_EMPLOYEE = tempEmployee; try { if (chk.IsChecked.Value) { //if (!bIsNotExists) //{ //单多选进行判断,这段代码目前是为了解决员工考勤方案分配时, //同一员工的考勤分配,一个人有两个岗位情况,那么只算一个考勤分配 //到底分配什么考勤方案,那就看情况,目前还不懂考勤分配 if (this.MultiSelected == true) { if (SelectedEmployees.Count() == 0) { SelectedDepartment.Add(departmentTemp); SelectedPost.Add(postDicTemp); SelectedEmployees.Add(temp); SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost); } else { for (int i = 0; i < SelectedEmployees.Count(); i++) { //岗位一样则只算一个,这个地方想了好久的逻辑 if (SelectedEmployees[i].EMPLOYEEID == temp.EMPLOYEEID && SelectedEmployees[i].EMPLOYEECNAME==temp.EMPLOYEECNAME) { break; } if (i == SelectedEmployees.Count() - 1) { //加入字典信息这两个没有用到,写着为了测试盒调试使用,以后可能有用 SelectedDepartment.Add(departmentTemp); SelectedPost.Add(postDicTemp); SelectedEmployees.Add(temp); SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost); } } } } if (this.MultiSelected == false) { SelectedDepartment.Add(departmentTemp); SelectedPost.Add(postDicTemp); SelectedEmployees.Add(temp); SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost); } //} } else { //这里显然是个悲剧,原始的移除根本不起作用,所以在这加个判断, //如果信息一致就移除相应序号的信息,考虑到一个人可能有几个岗位 //所以这里不仅要判断员工ID还要判断部门ID和岗位ID,我就不信这人 //在一个部门里面还有两个岗位,如果有那他可能就是程序员兼客服兼测试…… //那就没办法了 for (int i = 0; i < SelectedEmployees.Count(); i++) { if ((SelectedEmployees[i].EMPLOYEEID == temp.EMPLOYEEID) && (SelectedEmployees[i].OWNERDEPARTMENTID == temp.OWNERDEPARTMENTID) && (SelectedEmployees[i].OWNERPOSTID == temp.OWNERPOSTID)) { SelectedDepartment.Remove(departmentTemp); SelectedPost.Remove(postDicTemp); SelectedEmployees.RemoveAt(i); SelectedPersonnelEmloyeePostNew.RemoveAt(i); } } } } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("CAUTION"), "数据存入缓存错误,可关掉重新选择"); } //if (chk.IsChecked.Value) //{ // if (!bIsNotExists) // { // SelectedEmployees.Add(temp); // } //} //else //{ // if (bIsNotExists) // { // SelectedEmployees.Remove(temp); // } //} }
void ckh_Click(object sender, RoutedEventArgs e) { CheckBox chk = sender as CheckBox; var ent = dgEmployeeList.SelectedItem as PersonnelWS.V_EMPLOYEEVIEW; var tmps = from n in SelectedEmployees where n.EMPLOYEEID == ent.EMPLOYEEID select n; //这里判断了,但是可能会导致存入不了相同EMPLOYEEID的数据,例如一个员工有两个岗位, //那么后面就会只有一条数据,所以注释掉 //bool bIsNotExists = false; //if (tmps != null) //{ // if (tmps.Count() > 0) // { // bIsNotExists = true; // } //} //PersonnelWS.T_HR_EMPLOYEE temp = new PersonnelWS.T_HR_EMPLOYEE(); //temp.EMPLOYEEID = ent.EMPLOYEEID; //temp.EMPLOYEECNAME = ent.EMPLOYEECNAME; //temp.EMPLOYEECODE = ent.EMPLOYEECODE; //temp.SEX = ent.SEX; //temp.IDNUMBER = ent.IDNUMBER; //temp.OWNERCOMPANYID = ent.OWNERCOMPANYID; //temp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID; //temp.OWNERPOSTID = ent.OWNERPOSTID; /// <summary> /// Modify Desc:在信息的处理中,在初始值中不能加入列表选择信息,所以在checkbox选择中 /// 进行数据加入和移除,然后传入到初始值中进行初始化,而且也要注意不同表单 /// 要传入的值可能不一样,这是目前发现用到的信息,以后有需要可继续加入 /// Modify Date:2012-8-8 //信息存入视图 PersonnelWS.V_EMPLOYEEVIEW temp = new PersonnelWS.V_EMPLOYEEVIEW(); temp.EMPLOYEEID = ent.EMPLOYEEID; temp.EMPLOYEECNAME = ent.EMPLOYEECNAME; temp.EMPLOYEECODE = ent.EMPLOYEECODE; temp.SEX = ent.SEX; temp.IDNUMBER = ent.IDNUMBER; temp.OWNERCOMPANYID = ent.OWNERCOMPANYID; temp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID; temp.OWNERPOSTID = ent.OWNERPOSTID; temp.ISAGENCY = ent.ISAGENCY; temp.POSTLEVEL = ent.POSTLEVEL; temp.EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID; temp.COMPANYNAME = ent.COMPANYNAME; temp.DEPARTMENTNAME = ent.DEPARTMENTNAME; temp.POSTNAME = ent.POSTNAME; temp.MOBILE = ent.MOBILE; temp.OFFICEPHONE = ent.OFFICEPHONE; //存入数据到V_EMPLOYEEVIEW视图和部门,岗位表 PersonnelWS.V_EMPLOYEEVIEW vTemp = new PersonnelWS.V_EMPLOYEEVIEW(); vTemp.EMPLOYEEID = ent.EMPLOYEEID; vTemp.EMPLOYEECNAME = ent.EMPLOYEECNAME; vTemp.EMPLOYEECODE = ent.EMPLOYEECODE; vTemp.SEX = ent.SEX; vTemp.IDNUMBER = ent.IDNUMBER; vTemp.OWNERCOMPANYID = ent.OWNERCOMPANYID; vTemp.OWNERDEPARTMENTID = ent.OWNERDEPARTMENTID; vTemp.OWNERPOSTID = ent.OWNERPOSTID; vTemp.DEPARTMENTNAME = ent.DEPARTMENTNAME; vTemp.POSTNAME = ent.POSTNAME; vTemp.POSTLEVEL = ent.POSTLEVEL; vTemp.ISAGENCY = ent.ISAGENCY; vTemp.EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID; vTemp.MOBILE = ent.MOBILE; vTemp.OFFICEPHONE = ent.OFFICEPHONE; //信息存入PersonnelWS.T_HR_POSTDICTIONARY里 PersonnelWS.T_HR_POSTDICTIONARY postDicTemp = new PersonnelWS.T_HR_POSTDICTIONARY(); postDicTemp.POSTNAME = ent.POSTNAME; postDicTemp.POSTLEVEL = ent.POSTLEVEL; //信息存入PersonnelWS.T_HR_DEPARTMENTDICTIONARY里 PersonnelWS.T_HR_DEPARTMENTDICTIONARY departmentTemp = new PersonnelWS.T_HR_DEPARTMENTDICTIONARY(); departmentTemp.DEPARTMENTNAME = ent.DEPARTMENTNAME; //把信息存入PersonnelWS.T_HR_POST,然后再把PersonnelWS.T_HR_POST数据存入PersonnelWS.T_HR_EMPLOYEEPOST //最后把数据存入PersonnelWS.T_HR_EMPLOYEEPOST //注意他们之间数据类型转换 PersonnelWS.T_HR_POST tempPerWSPost = new PersonnelWS.T_HR_POST(); tempPerWSPost.POSTLEVEL = ent.POSTLEVEL; tempPerWSPost.POSTID = ent.OWNERPOSTID; PersonnelWS.T_HR_EMPLOYEE tempEmployee = new PersonnelWS.T_HR_EMPLOYEE(); tempEmployee.EMPLOYEECNAME = ent.EMPLOYEECNAME; tempEmployee.EMPLOYEEID = ent.EMPLOYEEID; tempEmployee.EMPLOYEEENAME = ent.EMPLOYEEENAME; tempEmployee.EMPLOYEECODE = ent.EMPLOYEECODE; //把PersonnelWS.T_HR_EMPLOYEEPOST信息存入,有些表单可能会用到 PersonnelWS.T_HR_EMPLOYEEPOST tempPerWSEmployeePost = new PersonnelWS.T_HR_EMPLOYEEPOST(); tempPerWSEmployeePost.EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID; tempPerWSEmployeePost.ISAGENCY = ent.ISAGENCY; tempPerWSEmployeePost.POSTLEVEL = ent.POSTLEVEL; tempPerWSEmployeePost.T_HR_POST = tempPerWSPost; tempPerWSEmployeePost.T_HR_EMPLOYEE = tempEmployee; try { if (chk.IsChecked.Value) { //if (!bIsNotExists) //{ //单多选进行判断,这段代码目前是为了解决员工考勤方案分配时, //同一员工的考勤分配,一个人有两个岗位情况,那么只算一个考勤分配 //到底分配什么考勤方案,那就看情况,目前还不懂考勤分配 if (this.MultiSelected == true) { if (SelectedEmployees.Count() == 0) { SelectedDepartment.Add(departmentTemp); SelectedPost.Add(postDicTemp); SelectedEmployees.Add(temp); SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost); } else { for (int i = 0; i < SelectedEmployees.Count(); i++) { //岗位一样则只算一个,这个地方想了好久的逻辑 if (SelectedEmployees[i].EMPLOYEEID == temp.EMPLOYEEID && SelectedEmployees[i].EMPLOYEECNAME == temp.EMPLOYEECNAME) { break; } if (i == SelectedEmployees.Count() - 1) { //加入字典信息这两个没有用到,写着为了测试盒调试使用,以后可能有用 SelectedDepartment.Add(departmentTemp); SelectedPost.Add(postDicTemp); SelectedEmployees.Add(temp); SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost); } } } } if (this.MultiSelected == false) { SelectedDepartment.Add(departmentTemp); SelectedPost.Add(postDicTemp); SelectedEmployees.Add(temp); SelectedPersonnelEmloyeePostNew.Add(tempPerWSEmployeePost); } //} } else { //这里显然是个悲剧,原始的移除根本不起作用,所以在这加个判断, //如果信息一致就移除相应序号的信息,考虑到一个人可能有几个岗位 //所以这里不仅要判断员工ID还要判断部门ID和岗位ID,我就不信这人 //在一个部门里面还有两个岗位,如果有那他可能就是程序员兼客服兼测试…… //那就没办法了 for (int i = 0; i < SelectedEmployees.Count(); i++) { if ((SelectedEmployees[i].EMPLOYEEID == temp.EMPLOYEEID) && (SelectedEmployees[i].OWNERDEPARTMENTID == temp.OWNERDEPARTMENTID) && (SelectedEmployees[i].OWNERPOSTID == temp.OWNERPOSTID)) { SelectedDepartment.Remove(departmentTemp); SelectedPost.Remove(postDicTemp); SelectedEmployees.RemoveAt(i); SelectedPersonnelEmloyeePostNew.RemoveAt(i); } } } } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("CAUTION"), "数据存入缓存错误,可关掉重新选择"); } //if (chk.IsChecked.Value) //{ // if (!bIsNotExists) // { // SelectedEmployees.Add(temp); // } //} //else //{ // if (bIsNotExists) // { // SelectedEmployees.Remove(temp); // } //} }