public AjaxMessage GetInviteCustomer(int page, int pageSize, string sortName, PropModel[] searchs, string inviteEmployee) { AjaxMessage ajax = new AjaxMessage(); ajax.IsSuccess = false; ajax.Message = "查询失败,系统异常"; try { int count = 0; List <Expression <Func <InviteDto, bool> > > parmList = new List <Expression <Func <InviteDto, bool> > >(); #region 条件 //默认显示当前登录人以及下级的邀约的信息 if (!string.IsNullOrEmpty(inviteEmployee)) { string employeeId = inviteEmployee.ToInt32() > 0 ? inviteEmployee : LoginInfo.UserInfo.EmployeeId.ToString(); //选择只显示选择人个人的邀约信息 bool isLookLowLevel = inviteEmployee.ToInt32() > 0 ? false : true; ExpressionTools.GetParsByCondition <InviteDto>("InviteEmployee", parmList, employeeId, "Contains", true, isLookLowLevel); } else { //默认获取本人及下级邀约信息 MyEmployee sel_emp = new MyEmployee(); sel_emp.GetMyEmployee <InviteDto>("InviteEmployee", parmList, true); } if (searchs.Count() > 0) { foreach (PropModel item in searchs) { if (item.value != "-1") //有明确的某个状态 { if (!string.IsNullOrEmpty(item.value)) { if (!(item.value.Contains(','))) { ExpressionTools.GetEqualPars(item.property, parmList, item.value, item.method); } else if (item.value.Contains(',')) //时间 婚期 { TimeHelper.GetPartyDateTime(item.value.ToString(), out start, out end); parmList.Add(c => c.PartyDate >= start && c.PartyDate <= end); } } } else //邀约/未邀约/邀约成功/确认到店 { parmList.Add(c => ("1,2,3,5").Contains(c.State.ToString())); } } } #endregion var DataList = _inviteService.GetAllByPage(page, pageSize, parmList, sortName, out count); ajax.data = DataList; ajax.total = count; //数据总条数 ajax.PageIndex = page; //当前页 ajax.PageSize = pageSize; //每页显示条数 ajax.EmpId = LoginInfo.UserInfo.EmployeeId.ToString(); //登录员工 ajax.IsSuccess = true; } catch (Exception e) { ajax.Message = e.Message; } return(ajax); }