public void SaveHaveBeenQuantity(Hr_NeedQueryParam queryParam) { HKSJRecruitmentContext ctx = HttpContext.GetDbContext <HKSJRecruitmentContext>(); Expression <Func <THR_Needs, bool> > predicate = SearchPredicate(queryParam); IPageList <THR_Needs> models = ctx.THR_Needs .Where(predicate) .OrderUsingSortExpression(queryParam.Sort.Replace("deptname", "deptid").Replace("postname", "postid"), queryParam.Order) .ToPagedList(queryParam.PageIndex, queryParam.PageSize); List <THR_Needs> dtos = models.ToList(); // List<THR_Needs> list = ctx.THR_Needs //.Where(c => c.IsDelete == 0 && c.NeedQuantity > 0).ToList(); foreach (THR_Needs needmodel in dtos) { int Quantity = ctx.THR_Recruit .Where(c => c.IsDelete == 0 && c.NeedsId == needmodel.Id && c.Status == 82).ToList().Count;//已录用 needmodel.HaveBeenQuantity = Quantity; if (needmodel.NeedQuantity == needmodel.HaveBeenQuantity) { needmodel.IsHaveBeen = 1; } else { needmodel.IsHaveBeen = 0; } } ctx.SaveChanges(); }
public ActionResult List(RecruitQueryParam queryParam) { IPageList <RecruitModel> models = GetRecruitList(queryParam); List <RecruitModel> dtos = models.ToList(); return(Content(this.GetJSON(new { total = models.PageInfo.TotalCount, rows = dtos }), this.JsonContentType())); }
public ActionResult List(PostQueryParam queryParam) { Expression <Func <TErp_Post, bool> > predicate = c => c.IsDelete == 0; if (queryParam.DeptId > 0) { predicate = predicate.And(c => c.DeptId == queryParam.DeptId); } HKSJRecruitmentContext ctx = HttpContext.GetDbContext <HKSJRecruitmentContext>(); IPageList <PostDto> models = ctx.TErp_Post .Where(predicate) .OrderUsingSortExpression(queryParam.Sort, queryParam.Order) .Select(c => new PostDto { DeptId = c.DeptId, DeptName = c.TErp_Department.DeptName, PositionId = c.PositionId, PositionLevel = c.TErp_Position.PositionLevel, PostDesc = c.PostDesc, PostName = c.PostName, Id = c.Id, PositionName = c.TErp_Position.PositionName }) .ToPagedList(queryParam.PageIndex, queryParam.PageSize); List <PostDto> dtos = models.ToList(); return(Content(this.GetJSON(new { total = models.PageInfo.TotalCount, rows = dtos }), this.JsonContentType())); }
public ActionResult List(Hr_NeedQueryParam queryParam) { SaveHaveBeenQuantity(queryParam); IPageList <Hr_NeedDto> models = GetNeedData(queryParam); List <Hr_NeedDto> dtos = models.ToList(); return(Content(this.GetJSON(new { total = models.PageInfo.TotalCount, rows = dtos }), this.JsonContentType())); }
public ActionResult List(QueryParam queryParam) { Expression <Func <TErp_Position, bool> > predicate = c => c.IsDelete == 0; HKSJRecruitmentContext ctx = HttpContext.GetDbContext <HKSJRecruitmentContext>(); IPageList <TErp_Position> models = ctx.TErp_Position .Where(predicate) .OrderUsingSortExpression(queryParam.Sort, queryParam.Order) .ToPagedList(queryParam.PageIndex, queryParam.PageSize); List <TErp_Position> dtos = models.ToList(); return(Content(this.GetJSON(new { total = models.PageInfo.TotalCount, rows = dtos }), this.JsonContentType())); }
public ActionResult List(PanramQueryParam queryParam) { Expression <Func <Tapp_Param, bool> > predicate = c => true; predicate = predicate.And(c => c.Parentid == queryParam.Parentid && c.IsDelete == 0); HKSJRecruitmentContext ctx = HttpContext.GetDbContext <HKSJRecruitmentContext>(); IPageList <Tapp_Param> models = ctx.Tapp_Param .Where(predicate) .OrderUsingSortExpression("parentid asc, sort asc") .ToPagedList(queryParam.PageIndex, queryParam.PageSize); List <Tapp_Param> dtos = models.ToList(); return(Content(this.GetJSON(new { total = models.PageInfo.TotalCount, rows = dtos }), this.JsonContentType())); }
public ActionResult List(ButtonQueryParam queryParam) { Expression <Func <Tapp_Button, bool> > predicate = c => true; if (queryParam.MenuId > 0) { predicate = predicate.And(c => c.MenuId == queryParam.MenuId); } HKSJRecruitmentContext ctx = HttpContext.GetDbContext <HKSJRecruitmentContext>(); IPageList <Tapp_Button> models = ctx.Tapp_Button .Where(predicate) .OrderUsingSortExpression(queryParam.Sort, queryParam.Order) .ToPagedList(queryParam.PageIndex, queryParam.PageSize); List <Tapp_Button> dtos = models.ToList(); return(Content(this.GetJSON(new { total = models.PageInfo.TotalCount, rows = dtos }), this.JsonContentType())); }
public ActionResult List(RoleQueryParam queryParam) { Expression <Func <Tapp_Role, bool> > predicate = c => true; if (!string.IsNullOrEmpty(queryParam.RoleName)) { predicate = predicate.And(c => c.RoleName.Contains(queryParam.RoleName)); } HKSJRecruitmentContext ctx = HttpContext.GetDbContext <HKSJRecruitmentContext>(); IPageList <Tapp_Role> models = ctx.Tapp_Role .Where(predicate) .OrderUsingSortExpression(queryParam.Sort, queryParam.Order) .ToPagedList(queryParam.PageIndex, queryParam.PageSize); List <Tapp_Role> dtos = models.ToList(); return(Content(this.GetJSON(new { total = models.PageInfo.TotalCount, rows = dtos }), this.JsonContentType())); }
public ActionResult List(RecruitQueryParam queryParam) { Expression <Func <THR_Recruit, bool> > predicate = c => c.IsDelete == 0; if (!string.IsNullOrEmpty(queryParam.Name)) { predicate = predicate.And(c => c.Name.StartsWith(queryParam.Name)); } if (!string.IsNullOrEmpty(queryParam.Tel)) { predicate = predicate.And(c => c.Tel.StartsWith(queryParam.Tel)); } if (queryParam.Status > 0) { predicate = predicate.And(c => c.Status == queryParam.Status); } if (queryParam.DptId > 0) { predicate = predicate.And(c => c.DptId == queryParam.DptId); } if (queryParam.PostId > 0) { predicate = predicate.And(c => c.PostId == queryParam.PostId); } if (!string.IsNullOrEmpty(queryParam.CreateBy)) { predicate = predicate.And(c => c.CreateBy == queryParam.CreateBy); } if (queryParam.IntervieweStart.HasValue && queryParam.IntervieweEnd.HasValue && queryParam.IntervieweStart.Value < queryParam.IntervieweEnd.Value) { predicate = predicate.And(c => c.Interview >= queryParam.IntervieweStart.Value && c.Interview <= queryParam.IntervieweEnd.Value); } if (queryParam.CreateTimeStart.HasValue && queryParam.CreateTimeEnd.HasValue && queryParam.CreateTimeStart.Value < queryParam.CreateTimeEnd.Value) { predicate = predicate.And(c => c.CreateTime >= queryParam.CreateTimeStart.Value && c.CreateTime <= queryParam.CreateTimeEnd.Value); } HKSJRecruitmentContext ctx = HttpContext.GetDbContext <HKSJRecruitmentContext>(); IPageList <RecruitModel> models = ctx.THR_Recruit .Where(predicate) .OrderUsingSortExpression(queryParam.Sort, queryParam.Order) .Select(c => new RecruitModel { DptId = c.DptId.Value, DptName = c.TErp_Department.DeptName, Id = c.Id, PostId = c.PostId.Value, PostName = c.TErp_Position.PositionName, Userurl = c.Userurl, Remark = c.Remark, Name = c.Name, Tel = c.Tel, Status = c.Status.Value, StatusName = c.Tapp_Param.ParamsName, Interview = c.Interview, Email = c.Email, CreateBy = c.CreateBy, CreateTime = c.CreateTime, HireTime = c.HireTime, NeedsId = c.NeedsId, NeedsName = c.THR_Needs.TErp_Department.DeptName + " " + c.THR_Needs.TErp_Position.PositionName, Interviewer = c.Interviewer }) .ToPagedList(queryParam.PageIndex, queryParam.PageSize); List <RecruitModel> dtos = models.ToList(); foreach (var item in dtos) { HR_Employee emp = ctx.HR_Employee.FirstOrDefault(c => c.uid == item.CreateBy); if (emp != null) { item.CreateBy = emp.name; } } return(Content(this.GetJSON(new { total = models.PageInfo.TotalCount, rows = dtos }), this.JsonContentType())); }