public bool Insert_Into_WordCount(string DbFile, string FilePath = "", string Word = "", string wCount = "", string TableName = "WordCount") // insert new word into wordcount table { _Database.SQLite sqlite = new _Database.SQLite(); string InsertLine = "Insert Into [" + TableName + "] (FilePath, Word, wCount) values ('" + FilePath + "', '" + Word + "', '" + wCount + "')"; bool Inserted = sqlite.Execute(DbFile, InsertLine); if (GlobalDebug) { ahk.MsgBox("Inserted Into [WordCount] = " + Inserted.ToString()); } return Inserted; }
// wordlist sqlite public bool Update_WordCount(string DbFile, string FilePath = "", string Word = "", string wCount = "", string TableName = "WordCount") // update a wordcount entry with new word count value { _Database.SQLite sqlite = new _Database.SQLite(); string UpdateLine = "Update [" + TableName + "] set FilePath = '" + FilePath + "', Word = '" + Word + "', wCount = '" + wCount + "' WHERE Word = '" + Word + "'"; bool Updated = sqlite.Execute(DbFile, UpdateLine); if (GlobalDebug) { ahk.MsgBox("Updated [WordCount] = " + Updated.ToString()); } return Updated; }
public bool PrnChill_Insert(PrnChill inObject, string DbFile = "") { _Database.SQLite sqlite = new _Database.SQLite(); _AHK ahk = new _AHK(); if (DbFile == "") { DbFile = ahk.AppDir() + @"\Db\PrnChill.sqlite"; } string InsertLine = "Insert Into [PrnChill] (PostName, PostURL, Links, DateAdded, LinkCheckDate, InCollection, ImageDir) values ('" + inObject.PostName + "', '" + inObject.PostURL + "', '" + inObject.Links + "', '" + inObject.DateAdded + "', '" + inObject.LinkCheckDate + "', '" + inObject.InCollection + "', '" + inObject.ImageDir + "')"; bool Inserted = sqlite.Execute(DbFile, InsertLine); if (!Inserted) { ahk.MsgBox("Inserted Into [PrnChill] = " + Inserted.ToString()); } return(Inserted); }
public bool PrnChill_Update(PrnChill inObject, string DbFile = "") { _Database.SQLite sqlite = new _Database.SQLite(); _AHK ahk = new _AHK(); //string UpdateLine = "Update [PrnChill] set PostName = '" + inObject.PostName + "', PostURL = '" + inObject.PostURL + "', Links = '" + inObject.Links + "', DateAdded = '" + inObject.DateAdded + "', LinkCheckDate = '" + inObject.LinkCheckDate + "', InCollection = '" + inObject.InCollection + "', ImageDir = '" + inObject.ImageDir + "' WHERE [Item] = 'Value' "; string UpdateLine = "Update [PrnChill] set "; if (inObject.PostName != null) { UpdateLine = UpdateLine + "[PostName] = '" + inObject.PostName + "',"; } if (inObject.PostURL != null) { UpdateLine = UpdateLine + "[PostURL] = '" + inObject.PostURL + "',"; } if (inObject.Links != null) { UpdateLine = UpdateLine + "[Links] = '" + inObject.Links + "',"; } if (inObject.DateAdded != null) { UpdateLine = UpdateLine + "[DateAdded] = '" + inObject.DateAdded + "',"; } if (inObject.LinkCheckDate != null) { UpdateLine = UpdateLine + "[LinkCheckDate] = '" + inObject.LinkCheckDate + "',"; } if (inObject.InCollection != null) { UpdateLine = UpdateLine + "[InCollection] = '" + inObject.InCollection + "',"; } if (inObject.ImageDir != null) { UpdateLine = UpdateLine + "[ImageDir] = '" + inObject.ImageDir + "',"; } UpdateLine = ahk.TrimLast(UpdateLine, 1); UpdateLine = UpdateLine + " WHERE [PostName] = ' '"; // DEFINE CONDITION HERE !!! bool Updated = sqlite.Execute(DbFile, UpdateLine); return(Updated); }