/// <summary> /// 为岗位分配人员 /// </summary> /// <param name="postEmployee"></param> /// <returns></returns> public ActionResult <bool> AddPostEmployee(PostEmployeeNew postEmployee) { try { if (postEmployee.EmployeeID.Count() <= 0) { throw new Exception("参数有误"); } var check = _rpspostemp.Any(p => postEmployee.EmployeeID.Contains(p.EmployeeID) && p.PostID == postEmployee.PostID); if (check) { throw new Exception("选中人员中存在已在该岗位下的人员"); } var dbpostemp = from emp in postEmployee.EmployeeID select new Basic_PostEmployees { EmployeeID = emp, PostID = postEmployee.PostID }; _rpspostemp.Add(dbpostemp); _work.Commit(); return(new ActionResult <bool>(true)); } catch (Exception ex) { return(new ActionResult <bool>(ex)); } }
public ActionResult <bool> AddPostEmployee(PostEmployeeNew postEmployee) { LogContent = "新建岗位与人员的关系模型,参数源:" + JsonConvert.SerializeObject(postEmployee); return(bll.AddPostEmployee(postEmployee)); }