SerieIDsFromStr() public static method

public static SerieIDsFromStr ( string str ) : List
str string
return List
Example #1
0
    //uniqueID == -1 selects all ExecuteAutoSQLs
    //uniqueID > 0 selects one ExecuteAutoSQL
    public static List <ExecuteAutoSQL> Select(bool dbconOpened, int uniqueID)
    {
        if (!dbconOpened)
        {
            Sqlite.Open();
        }

        string whereStr = "";

        if (uniqueID != -1)
        {
            whereStr = " WHERE uniqueID == " + uniqueID;
        }

        dbcmd.CommandText = "SELECT * from " + Constants.ExecuteAutoTable + whereStr;
        LogB.SQL(dbcmd.CommandText.ToString());

        SqliteDataReader reader;

        reader = dbcmd.ExecuteReader();

        List <ExecuteAutoSQL> sequences = new List <ExecuteAutoSQL>();
        int i;

        while (reader.Read())
        {
            i = 0;
            ExecuteAutoSQL eaSQL = new ExecuteAutoSQL(
                Convert.ToInt32(reader[i++].ToString()),                                                  //uniqueID
                reader[i++].ToString(),                                                                   //name
                (ExecuteAuto.ModeTypes)Enum.Parse(typeof(ExecuteAuto.ModeTypes), reader[i++].ToString()), //mode
                reader[i++].ToString(),                                                                   //description
                ExecuteAutoSQL.SerieIDsFromStr(reader[i++].ToString()),                                   //serie1IDs
                ExecuteAutoSQL.SerieIDsFromStr(reader[i++].ToString()),                                   //serie2IDs
                ExecuteAutoSQL.SerieIDsFromStr(reader[i++].ToString())                                    //serie3IDs
                );
            sequences.Add(eaSQL);
        }
        reader.Close();
        if (!dbconOpened)
        {
            Sqlite.Close();
        }

        return(sequences);
    }