Пример #1
0
 /// <summary>
 /// 网格条件过滤
 /// </summary>
 /// <param name="where">where</param>
 /// <param name="gridType">网格类型</param>
 /// <param name="condition">条件</param>
 /// <param name="initModule">原始模块,针对表单弹出框</param>
 /// <param name="initField">原始字段,针对表单弹出框</param>
 /// <param name="otherParams">其他参数</param>
 /// <param name="currUser">当前用户</param>
 /// <returns></returns>
 public Expression <Func <OrgM_Emp, bool> > GetGridFilterCondition(out string where, DataGridType gridType, Dictionary <string, string> condition = null, string initModule = null, string initField = null, Dictionary <string, string> otherParams = null, UserInfo currUser = null)
 {
     where = string.Empty;
     if (condition != null && condition.ContainsKey("OrgM_DeptId"))
     {
         OrgM_Dept root   = OrgMOperate.GetDeptRoot();
         Guid      deptId = condition["OrgM_DeptId"].ObjToGuid();
         if (deptId != root.Id)
         {
             List <Guid> childDeptIds = OrgMOperate.GetChildDepts(deptId).Select(x => x.Id).ToList();
             childDeptIds.Add(deptId);
             string deptIdStr = string.Join("','", childDeptIds);
             where = string.Format("Id IN(SELECT OrgM_EmpId FROM dbo.OrgM_EmpDeptDuty WHERE OrgM_DeptId IN('{0}'))", deptIdStr);
             condition.Remove("OrgM_DeptId");
         }
     }
     return(null);
 }