public List <Employee> GetIsLeaveEmployees(string condition, Dimission isLeave = Dimission.All) { var employees = new List <Employee>(); var web = info.GetWeb1(); var list = web.Lists.GetByTitle("China Employees List"); info.ChinaAdministrationContext.Load(list); info.ChinaAdministrationContext.ExecuteQuery(); var items = list.GetItems(new CamlQuery()); info.ChinaAdministrationContext.Load(items); info.ChinaAdministrationContext.ExecuteQuery(); foreach (var item in items) { if (item[dictionarys[Constant.Name]] != null) { if (condition.Contains(item[dictionarys[Constant.Name]].ToString()) || condition.Contains(item[dictionarys[Constant.EnglishName]].ToString())) { employees.Add(GetOneDimissionEmployee(item, isLeave)); } } else if (condition.Contains(item[dictionarys[Constant.EnglishName]].ToString())) { employees.Add(GetOneDimissionEmployee(item, isLeave)); } } return(employees); }
/// <summary> /// 提交离职 /// </summary> /// <param name="dimission"></param> /// <returns></returns> public int Dimission(Dimission dimission) { int result = FinanceDal.Dimission(dimission); if (result > 0) { Managerdal.DeleteEmp(dimission.EmpsId); } return(result); }
/// <summary> /// 离职方法 /// </summary> /// <param name="dimission"></param> /// <returns></returns> public string Dimission(Dimission dimission) { int n = FinanceBll.Dimission(dimission); if (n > 0) { return("办理离职成功!员工信息已移除!"); } else { return("办理离职失败"); } }
public Employee GetOneDimissionEmployee(ListItem item, Dimission isLeave = Dimission.All) { if (isLeave.Equals(Dimission.NotLeave) && item[dictionarys[Constant.IsLeave]].ToString().Equals("否")) { return(GetEmployeeInfo(item)); } else if (isLeave.Equals(Dimission.HavedLeave) && item[dictionarys[Constant.IsLeave]].ToString().Equals("是")) { return(GetEmployeeInfo(item)); } else if (isLeave.Equals(Dimission.All)) { return(GetEmployeeInfo(item)); } else { return(null); } }
/// <summary> /// 提交离职 /// </summary> /// <param name="dimission"></param> /// <returns></returns> public int Dimission(Dimission dimission) { my.Dimissions.Add(dimission); return(my.SaveChanges()); }