/// <summary> /// 查询 /// </summary> private void DoSelect() { string sql = @"select B.GroupID As CorpId ,B.Name As CorpName from sysuser As A left join SysGroup As B on A.Pk_corp=B.GroupID where A.UserID='{0}' " ; sql = string.Format(sql, UserInfo.UserID); DataTable Dt = DataHelper.QueryDataTable(sql); CommPowerSplit ps = new CommPowerSplit(); if (ps.IsHR(UserInfo.UserID, UserInfo.LoginName) || ps.IsSetMgrRole(UserInfo.UserID, UserInfo.LoginName)) //设置管理角色 or HR { ents = WelfareConfig.FindAll(SearchCriterion); } else { string CorpIds = string.Empty; SysUser Ent = SysUser.Find(UserInfo.UserID); // 判断公司登陆 if (Session["CompanyId"] != null) { CorpIds = Session["CompanyId"] + ""; } else { CorpIds = Ent.Pk_corp; } ents = WelfareConfig.FindAll(SearchCriterion, Expression.Sql("CorpId='" + CorpIds + "' or CreateId='" + UserInfo.UserID + "' ")); } this.PageState.Add("DataList", ents); }