public DataTable Return_DataTable_From_PrnChill(string DbFile) { _Database.SQLite sqlite = new _Database.SQLite(); string SelectLine = "Select [PostName], [PostURL], [Links], [DateAdded], [LinkCheckDate], [InCollection], [ImageDir] From [PrnChill]"; DataTable ReturnTable = sqlite.GetDataTable(DbFile, SelectLine); return(ReturnTable); }
public DataTable Return_PrnChill_DataTable(string DbFile = "", string TableName = "PrnChill", string WhereClause = "", bool Debug = false) { _Database.SQLite sqlite = new _Database.SQLite(); _AHK ahk = new _AHK(); if (DbFile == "") { DbFile = ahk.AppDir() + @"\Db\PrnChill.sqlite"; } string SelectLine = "Select * From [PrnChill]"; if (WhereClause != "") { if (WhereClause.ToUpper().Contains("WHERE")) { SelectLine = SelectLine + " " + WhereClause; } if (!WhereClause.ToUpper().Contains("WHERE")) { SelectLine = SelectLine + " WHERE " + WhereClause; } } DataTable ReturnTable = sqlite.GetDataTable(DbFile, SelectLine); DataTable table = new DataTable(); table.Columns.Add("PostName", typeof(string)); table.Columns.Add("PostURL", typeof(string)); table.Columns.Add("Links", typeof(string)); table.Columns.Add("DateAdded", typeof(string)); table.Columns.Add("LinkCheckDate", typeof(string)); table.Columns.Add("InCollection", typeof(string)); table.Columns.Add("ImageDir", typeof(string)); if (ReturnTable != null) { foreach (DataRow ret in ReturnTable.Rows) { PrnChill returnObject = new PrnChill(); returnObject.PostName = ret["PostName"].ToString(); returnObject.PostURL = ret["PostURL"].ToString(); returnObject.Links = ret["Links"].ToString(); returnObject.DateAdded = ret["DateAdded"].ToString(); returnObject.LinkCheckDate = ret["LinkCheckDate"].ToString(); returnObject.InCollection = ret["InCollection"].ToString(); returnObject.ImageDir = ret["ImageDir"].ToString(); table.Rows.Add(returnObject.PostName, returnObject.PostURL, returnObject.Links, returnObject.DateAdded, returnObject.LinkCheckDate, returnObject.InCollection, returnObject.ImageDir); } } return(table); }
public List <PrnChill> Return_PrnChill_List(string WhereClause = "", string DbFile = "", string TableName = "[PrnChill]") { _Database.SQLite sqlite = new _Database.SQLite(); _AHK ahk = new _AHK(); if (DbFile == "") { DbFile = ahk.AppDir() + @"\Db\PrnChill.sqlite"; } string SelectLine = "Select * From " + TableName; if (WhereClause != "") { if (WhereClause.ToUpper().Contains("WHERE")) { SelectLine = SelectLine + " " + WhereClause; } if (!WhereClause.ToUpper().Contains("WHERE")) { SelectLine = SelectLine + " WHERE " + WhereClause; } } DataTable ReturnTable = sqlite.GetDataTable(DbFile, SelectLine); List <PrnChill> ReturnList = new List <PrnChill>(); if (ReturnTable != null) { foreach (DataRow ret in ReturnTable.Rows) { PrnChill returnObject = new PrnChill(); returnObject.PostName = ret["PostName"].ToString(); returnObject.PostURL = ret["PostURL"].ToString(); returnObject.Links = ret["Links"].ToString(); returnObject.DateAdded = ret["DateAdded"].ToString(); returnObject.LinkCheckDate = ret["LinkCheckDate"].ToString(); returnObject.InCollection = ret["InCollection"].ToString(); returnObject.ImageDir = ret["ImageDir"].ToString(); ReturnList.Add(returnObject); } } return(ReturnList); }
public PrnChill Return_Object_From_PrnChill(string WhereClause = "[PostName] = ''", string DbFile = "") { _Database.SQLite sqlite = new _Database.SQLite(); _AHK ahk = new _AHK(); if (DbFile == "") { DbFile = ahk.AppDir() + @"\Db\PrnChill.sqlite"; } string SelectLine = "Select [PostName], [PostURL], [Links], [DateAdded], [LinkCheckDate], [InCollection], [ImageDir] From [PrnChill] "; DataTable ReturnTable = sqlite.GetDataTable(DbFile, SelectLine); if (WhereClause.ToUpper().Contains("WHERE ")) { SelectLine = SelectLine + " " + WhereClause; } if (!WhereClause.ToUpper().Contains("WHERE ")) { SelectLine = SelectLine + "WHERE " + WhereClause; } PrnChill returnObject = new PrnChill(); int i = 0; string Value = ""; if (ReturnTable != null) { foreach (DataRow ret in ReturnTable.Rows) { returnObject.PostName = ret["PostName"].ToString(); returnObject.PostURL = ret["PostURL"].ToString(); returnObject.Links = ret["Links"].ToString(); returnObject.DateAdded = ret["DateAdded"].ToString(); returnObject.LinkCheckDate = ret["LinkCheckDate"].ToString(); returnObject.InCollection = ret["InCollection"].ToString(); returnObject.ImageDir = ret["ImageDir"].ToString(); } } return(returnObject); }