/// <summary> /// Gets all audit actions. /// </summary> /// <returns></returns> public static AuditActionCollection GetAllAuditActions() { AuditActionCollection toReturn = new AuditActionCollection(); toReturn.GetMulti(null, 0, new SortExpression(AuditActionFields.AuditActionDescription.Ascending())); return(toReturn); }
/// <summary> /// Gets the audit actions for user. /// </summary> /// <param name="userID">The user ID.</param> /// <returns>fetched collection</returns> public static AuditActionCollection GetAuditActionsForUser(int userID) { var qf = new QueryFactory(); var q = qf.AuditAction .Where(AuditActionFields.AuditActionID .In(qf.Create() .Select(RoleAuditActionFields.AuditActionID) .From(qf.RoleAuditAction .InnerJoin(qf.Role).On(RoleAuditActionFields.RoleID == RoleFields.RoleID) .InnerJoin(qf.RoleUser).On(RoleFields.RoleID == RoleUserFields.RoleID)) .Where(RoleUserFields.UserID == userID))); AuditActionCollection auditActions = new AuditActionCollection(); auditActions.GetMulti(q); return(auditActions); }