public IEnumerable <SysRole> GetRoles(out int total, int tenantId, string roleName, int startIndex, int pageSize) { string where = string.Format(" Sys_Roles.RoleName like '%{0}%' AND Sys_Roles.Status=0 AND Sys_Roles.TenantId=@tenantId", roleName.ReplaceSql()); var param = new { roleName, tenantId }; return(_dataAccess.GetEntities <SysRole>(out total, where, startIndex, pageSize, "RoleId", param)); }
/// <summary> /// 获取所有用户 /// </summary> /// <returns></returns> public IEnumerable <SysUser> GetAllUsers(int tenantId) { int totalRecords = 0; string where = " Sys_Users.Status = 0 and Sys_Users.TenantId=@tenantId "; var param = new { tenantId }; return(_dataAccess.GetEntities <SysUser>(out totalRecords, where, 0, int.MaxValue, "UserId", param)); }
public IEnumerable <SysPost> GetAllPost(out int total, int pageIndex, int pageSize, int tenantId, string postName) { string where = "Sys_Posts.Status=0 AND Sys_Posts.TenantId=@tenantId"; if (!string.IsNullOrEmpty(postName)) { where += string.Format(" AND Sys_Posts.PostName LIKE '%{0}%'", postName.ReplaceSql()); } var param = new { tenantId, postName }; return (_dataAccess.GetEntities <SysPost>(out total, where, pageIndex, pageSize, "PostId", param)); }
public IEnumerable <SysDepartment> GetAllDept(out int total, int startIndex, int pageSize, int tenantId, string deptName) { string where = "Sys_Department.Status=0 AND Sys_Department.TenantId=@tenantId"; if (!string.IsNullOrEmpty(deptName)) { where += " AND Sys_Department.DeptName=@deptName"; } var param = new { tenantId, deptName }; return (_dataAccess.GetEntities <SysDepartment>(out total, where, startIndex, pageSize, "DeptId", param)); }
public List <UserActivity> GetList(out int total, int pageIndex, int pageSize, string strWhere, string order, dynamic param = null) { return(_dataAccess.GetEntities <UserActivity>(out total, strWhere, (pageIndex - 1) * pageSize + 1, pageSize, order).ToList()); }