Esempio n. 1
0
        static public List <TravelLogUnit> GetAll()
        {
            List <TravelLogUnit> list = new List <TravelLogUnit>();

            using (SQLiteConnectionUser cn = new SQLiteConnectionUser(mode: EDDbAccessMode.Reader))
            {
                using (DbCommand cmd = cn.CreateCommand("select * from TravelLogUnit"))
                {
                    DataSet ds = SQLiteDBClass.SQLQueryText(cn, cmd);
                    if (ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        return(list);
                    }

                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        TravelLogUnit sys = new TravelLogUnit(dr);
                        list.Add(sys);
                    }

                    return(list);
                }
            }
        }
Esempio n. 2
0
 public static bool TryGet(string name, out TravelLogUnit tlu)
 {
     tlu = Get(name);
     return(tlu != null);
 }