Example #1
0
        /// <summary>
        /// Fetches an assignment role by ID
        /// </summary>
        /// <param name="output"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool FetchById(ref AssignmentRole output, int id)
        {
            SQLiteDataReader reader = DBI.DoPreparedQuery(
                @"SELECT * FROM AssignmentRole 
				WHERE id = @id LIMIT 1;"                ,
                new Tuple <string, object>("@id", id));

            if (reader != null && reader.Read())
            {
                output = AssignmentRole.Factory(reader);
                return(true);
            }
            return(false);
        }
Example #2
0
        /// <summary>
        /// Fetches a role by name
        /// </summary>
        /// <param name="output"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static bool FetchByName(ref AssignmentRole output, string name)
        {
            SQLiteDataReader reader = DBI.DoPreparedQuery(
                @"SELECT * FROM AssignmentRole 
				WHERE name = @name LIMIT 1;"                ,
                new Tuple <string, object>("@name", name));

            if (reader != null && reader.Read())
            {
                output = AssignmentRole.Factory(reader);
                return(true);
            }
            return(false);
        }
Example #3
0
        /// <summary>
        /// Fetches all possible assignment roles
        /// </summary>
        /// <param name="output"></param>
        /// <returns></returns>
        public static bool FetchAll(ref List <AssignmentRole> output)
        {
            output = new List <AssignmentRole>();

            SQLiteDataReader reader = DBI.DoQuery(
                "SELECT * FROM AssignmentRole;");

            while (reader != null && reader.Read())
            {
                AssignmentRole ar = AssignmentRole.Factory(reader);
                output.Add(ar);
            }

            return(true);
        }