本文整理汇总了C#中SQLite.SQLiteConnection.UpdateAll方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteConnection.UpdateAll方法的具体用法?C# SQLiteConnection.UpdateAll怎么用?C# SQLiteConnection.UpdateAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLite.SQLiteConnection
的用法示例。
在下文中一共展示了SQLiteConnection.UpdateAll方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createDatabase
public static void createDatabase(string strTblName)
{
try
{
var connection = new SQLiteConnection(path);
if(!isTableExisting(strTblName)){
if(strTblName == "Trivia"){
connection.CreateTable<Trivia>();
fillTrivia();
}else if(strTblName == "Tip"){
connection.CreateTable<Tip>();
fillTip();
}else if(strTblName == "Phrases"){
connection.CreateTable<Phrases>();
fillPhrases();
}else if(strTblName == "Dictionary"){
connection.CreateTable<Dictionary>();
fillDictionary();
}else if(strTblName == "Coins"){
connection.CreateTable<Coins>();
var data = new List<Coins> {new Coins { CoinsCount = 0}};
try
{
var db = new SQLiteConnection(path);
if (db.InsertAll(data) != 0){
db.UpdateAll(data);
}
}
catch (SQLiteException ex)
{
Console.Write (ex.Message);
}
}
}
}
catch (SQLiteException)
{
}
}
示例2: InitialRefresh
private void InitialRefresh(SQLiteConnection conn)
{
if (conn.Table<WordModel>().Count() != 0)
mMaxIdxOrder = conn.Table<WordModel>().Max(w => w.IdxOrder);
else
mMaxIdxOrder = 0;
// Words that need to be Searched/Downloaded
var allWords = conn.Table<WordModel>().ToList();
foreach (WordModel word in allWords)
{
if (NeedsSearch(word))
word.Status = WordStatus.NOT_STARTED;
}
conn.UpdateAll(allWords.ToList());
}
示例3: UpdateUploadStat
public void UpdateUploadStat()
{
string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;
DateTime now = DateTime.Now;
try {
using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
var list1 = db.Table<Invoice> ().ToList<Invoice> ().Where (x => x.isUploaded == false).ToList<Invoice> ();
List<Invoice> invlist = new List<Invoice>();
foreach (OutLetBill bill in bills) {
var found = list1.Where(x=>x.invno==bill.InvNo && bill.TrxType==x.trxtype).ToList<Invoice>();
if (found.Count>0)
{
found[0].isUploaded = true;
found[0].uploaded = now;
invlist.Add(found[0]);
}
}
var list2 = db.Table<CNNote> ().ToList<CNNote> ().Where (x => x.isUploaded == false).ToList<CNNote> ();
List<CNNote> invlist2 = new List<CNNote>();
foreach (OutLetBill bill in bills) {
var found = list2.Where(x=>x.cnno==bill.InvNo && bill.TrxType=="CN").ToList<CNNote>();
if (found.Count>0)
{
found[0].isUploaded = true;
found[0].uploaded = now;
invlist2.Add(found[0]);
}
}
if (invlist.Count>0)
db.UpdateAll (invlist);
if (invlist2.Count>0)
db.UpdateAll (invlist2);
UploadBillsToServer ();
}
} catch (Exception ex) {
_errmsg = "Update status Error." + ex.Message;
}
}
示例4: UpdateUploadStat
public void UpdateUploadStat()
{
string pathToDatabase = ((GlobalvarsApp)CallingActivity).DATABASE_PATH;
DateTime now = DateTime.Now;
try {
using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
var list1 = db.Table<GeoLocation> ().Where (x => x.isUploaded == false).ToList();
List<GeoLocation> geolist= new List<GeoLocation>();
foreach (MapLocation bill in locs) {
var found = list1.Where(x=>x.ID==bill.UID).ToList();
if (found.Count>0)
{
found[0].isUploaded = true;
geolist.Add(found[0]);
}
}
if (geolist.Count>0)
db.UpdateAll (geolist);
UploadlocsToServer ();
}
} catch (Exception ex) {
_errmsg = "Update status Error." + ex.Message;
}
}
示例5: UpdateUploadStat
public void UpdateUploadStat()
{
string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;
DateTime now = DateTime.Now;
try {
using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
var listInv = db.Table<Invoice> ().Where (x => x.isUploaded == false).ToList<Invoice> ();
var listCN = db.Table<CNNote> ().Where (x => x.isUploaded == false).ToList<CNNote> ();
var listSO = db.Table<SaleOrder> ().Where (x => x.isUploaded == false).ToList<SaleOrder> ();
var listDO = db.Table<DelOrder> ().Where (x => x.isUploaded == false).ToList<DelOrder> ();
List<Invoice> invlist = new List<Invoice> ();
List<CNNote> cnlist = new List<CNNote> ();
List<SaleOrder> solist = new List<SaleOrder> ();
List<DelOrder> dolist = new List<DelOrder> ();
string module = "";
foreach (OutLetBill bill in bills) {
if (bill.TrxType == "CASH" || bill.TrxType == "INVOICE")
module = "INV";
else if (bill.TrxType == "CN")
module = "CN";
else if (bill.TrxType == "DO")
module = "DO";
else if (bill.TrxType == "SO")
module = "SO";
else
module = "XXX";
var biList = allbills.Where (x => x.InvNo == bill.InvNo && x.Module == module).ToList ();
if (biList.Count == 0)
continue;
foreach(var bitem in biList)
{
bitem.IsUploaded = true;
}
if (module =="INV") {
var found = listInv.Where (x => x.invno == bill.InvNo && bill.TrxType == x.trxtype).ToList<Invoice> ();
if (found.Count > 0) {
found [0].isUploaded = true;
found [0].uploaded = now;
invlist.Add (found [0]);
}
}
else if (module == "CN") {
var found = listCN.Where (x => x.cnno == bill.InvNo).ToList<CNNote> ();
if (found.Count > 0) {
found [0].isUploaded = true;
found [0].uploaded = now;
cnlist.Add (found [0]);
}
}else if (module == "DO") {
var found = listDO.Where (x => x.dono == bill.InvNo).ToList<DelOrder> ();
if (found.Count > 0) {
found [0].isUploaded = true;
found [0].uploaded = now;
dolist.Add (found [0]);
}
}else if (module == "SO") {
var found = listSO.Where (x => x.sono == bill.InvNo).ToList<SaleOrder> ();
if (found.Count > 0) {
found [0].isUploaded = true;
found [0].uploaded = now;
solist.Add (found [0]);
}
}
}
if (invlist.Count > 0)
db.UpdateAll (invlist);
if (cnlist.Count > 0)
db.UpdateAll (cnlist);
if (dolist.Count > 0)
db.UpdateAll (dolist);
if (solist.Count > 0)
db.UpdateAll (solist);
DataHelper.UpdateLastConnect (pathToDatabase);
// if (invlist2.Count>0)
// db.UpdateAll (invlist2);
UploadBillsToServer ();
}
} catch (Exception ex) {
_errmsg = "Update status Error." + ex.Message;
}
}
示例6: fillPhrases
public static void fillPhrases(){
var peopleList = new List<Phrases>
{
new Phrases { TagalogPhrase = "Magandang Hapon", CebuanoPhrase = "Maayong hapon.", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Magandang Araw", CebuanoPhrase = "Maayong adlaw sa imo.", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Magandang Gabi", CebuanoPhrase = "Maayong gabii.", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Goodluck", CebuanoPhrase = "Maayo unta swertihon!", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Magandang Umaga", CebuanoPhrase = "Maayong buntag.", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Hello, Kumusta ka?", CebuanoPhrase = "Uy, kumusta man ka?", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Hindi ko maintindihan.", CebuanoPhrase = "Wala ko kasabot.", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Naiintidihan ko.", CebuanoPhrase = "Nakasabot ko.", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Ayos lang ako.", CebuanoPhrase = "Maayo man ko.", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Matagal na panahong di nagkita.", CebuanoPhrase = "Dugayng panahon wala ta nagkita", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Ang pangalan ko ay Juan.", CebuanoPhrase = "Ang akong ngalan kay Juan.", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Maligayang Pagdating.", CebuanoPhrase = "Maayong pag-abot", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Anong pangalan mo?", CebuanoPhrase = "Unsa'y imong ngalan?", Cost = 0, Status = 0},
new Phrases { TagalogPhrase = "Taga-saan ka?", CebuanoPhrase = "Taga-asa ka?", Cost = 0, Status = 0}
};
try
{
var db = new SQLiteConnection(path);
if (db.InsertAll(peopleList) != 0)
{
db.UpdateAll(peopleList);
}
}
catch (SQLiteException)
{
}
}
示例7: fillTrivia
//Trivia Database
private static void fillTrivia(){
var data = new List<Trivia>
{
new Trivia { TrivPhrase = "#001 Alam mo bang ang Cebuano ay tinatawag ring Bisaya?"},
new Trivia { TrivPhrase = "#002 Alam mo bang mahigit kumulang 20 milyong tao ang gumagamit sa dialektong Cebuano?"},
new Trivia { TrivPhrase = "#003 Alam mo bang ang araw ng pagkakatatag ng Cebu ay sa ika-6 ng Agosto?"},
new Trivia { TrivPhrase = "#004 Alam mo bang sa Cebu naganap ang paglalaban nina Lapu-Lapu at Magellan?"},
new Trivia { TrivPhrase = "#005 Alam mo bang nasa Cebu ang pinakamatandang relikang Kristiyano ng Pilipinas?"},
new Trivia { TrivPhrase = "#006 Alam mo bang nataguriang Queen City of the South ang Cebu?"},
new Trivia { TrivPhrase = "#007 Alam mo bang ang mga sinunang Cebuano ay gumagamit ng alahas na yari sa ari ng hayop o tao?"},
new Trivia { TrivPhrase = "#008 Alam mo bang karamihan sa mga salitang Cebuano ay sa wikang Espanyol rin nagmula?"},
new Trivia { TrivPhrase = "#009 Alam mo bang ang Cebuano ay unang isinulat ni Antonio Pigafetta?"},
new Trivia { TrivPhrase = "#010 Alam mo bang ang dialektong Cebuano ay mayroon lamang tatlong patinig noong panahon ng mga Espanyol?"},
new Trivia { TrivPhrase = "#011 Alam mo bang may tinatawag ring Mindanao Cebuano, Luzon Cebuano, and Negrense Cebuano?"},
new Trivia { TrivPhrase = "#012 Alam mo bang kaisa ang Cebuano sa Borneo-Philippines Languages?"},
new Trivia { TrivPhrase = "#013 Alam mo bang ang Cebuano ay may 16 na katinig at limang patinig?"},
new Trivia { TrivPhrase = "#014 Alam mo bang ang tawag sa mga nagsasalita ng Cebuano sa Luzon at Mindanao ay Binisaya?"},
new Trivia { TrivPhrase = "#015 Alam mo bang ang tawag sa mga nagsasalita ng Cebuano sa Bohol ay Bol-anon?"},
new Trivia { TrivPhrase = "#016 Alam mo bang ang Cebuano ang pangunahing dialekto sa Western Leyte?"},
new Trivia { TrivPhrase = "#017 Alam mo bang noong 18th century nagsimulang gamitin ng mga Misyonaryong Espanyol ang dialektong Cebuano sa pagsusulat?"}
};
try
{
var db = new SQLiteConnection(path);
if (db.InsertAll(data) != 0){
db.UpdateAll(data);
}
}
catch (SQLiteException ex)
{
Console.Write (ex.Message);
}
}
示例8: fillDictionary
//.........这里部分代码省略.........
new Dictionary {TagalogWord = " sasabihin ", CebuanoWord = " sultihan ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sasama ", CebuanoWord = " mokuyog ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sasama ", CebuanoWord = " manguyog ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sayaw ", CebuanoWord = " sayaw ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sayo ", CebuanoWord = " sayo ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " septyempre ", CebuanoWord = " septyempre ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sibuyas ", CebuanoWord = " sibuyas ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sigaw ", CebuanoWord = " singgit ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sige ", CebuanoWord = " sige ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sigurado ", CebuanoWord = " segurado ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sikat ", CebuanoWord = " gibantog ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sinabi ", CebuanoWord = " gisultihan ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sinagot ", CebuanoWord = " balusi ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sino ", CebuanoWord = " kinsa ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sino ", CebuanoWord = " kinsa ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sinsero ", CebuanoWord = " matinuuron ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sipa ", CebuanoWord = " sipa ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sitaw ", CebuanoWord = " balatong ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " spinach ", CebuanoWord = " ispinaka ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " suka ", CebuanoWord = " suka ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sulatan ", CebuanoWord = " sulati ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sumagot ", CebuanoWord = " pagtubag ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sumagot ", CebuanoWord = " mosugot ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sumisigaw ", CebuanoWord = " nagsinggit ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sunod ", CebuanoWord = " sunod ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " suntok ", CebuanoWord = " sumbag ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " suso ", CebuanoWord = " umang ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " susulatan ", CebuanoWord = " mosulat ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " sususod ", CebuanoWord = " umaabot ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " taas ", CebuanoWord = " taas ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tahimik ", CebuanoWord = " hilumon ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tainga ", CebuanoWord = " dalunggan ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " takbo ", CebuanoWord = " dagan ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " talaga ", CebuanoWord = " lagi ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " talaga ", CebuanoWord = " bitaw ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " talon ", CebuanoWord = " lukso ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tamad ", CebuanoWord = " tapulan ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tamis ", CebuanoWord = " tam-is ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tanggihan ", CebuanoWord = " mobalibad ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tanghali ", CebuanoWord = " udto ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tanghali ", CebuanoWord = " udto ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tanghali ", CebuanoWord = " udto ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " taon ", CebuanoWord = " tuig ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tapon ", CebuanoWord = " labay ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tara na ", CebuanoWord = " tana ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tatakan ", CebuanoWord = " tindak ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tatay ", CebuanoWord = " amahan ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tawa ", CebuanoWord = " katawa ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tawag ", CebuanoWord = " tawag ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tigil ", CebuanoWord = " hunong ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tinatanong ", CebuanoWord = " nangutana ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tingnan ", CebuanoWord = " tan'awa ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tita ", CebuanoWord = " tiya ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tita ", CebuanoWord = " iyaan ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tito ", CebuanoWord = " tiyo ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tito ", CebuanoWord = " uyuan ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tiyan ", CebuanoWord = " tiyan ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " totoo ", CebuanoWord = " tinuod ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tuhod ", CebuanoWord = " tuhod ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tulak ", CebuanoWord = " tulod ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tumango ", CebuanoWord = " tando ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tumatawa ", CebuanoWord = " nagkatawa ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tumayo ", CebuanoWord = " pagtindog ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tumayo ", CebuanoWord = " tindog ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tumingin ", CebuanoWord = " tan-aw ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tumitingin ", CebuanoWord = " nagtan-aw ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " tunay ", CebuanoWord = " diay ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " ubo ", CebuanoWord = " ubo ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " ulit ", CebuanoWord = " usab ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " umaga ", CebuanoWord = " buntag ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " umaga ", CebuanoWord = " buntag ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " umalis ", CebuanoWord = " miadto ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " umiiyak ", CebuanoWord = " naghilak ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " unggoy ", CebuanoWord = " unggoy ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " upang ", CebuanoWord = " aron ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " upo ", CebuanoWord = " lingkod ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " upo ", CebuanoWord = " tabayag ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " wala ", CebuanoWord = " wala'y ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " wala ", CebuanoWord = " gidili ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " walang kuwenta ", CebuanoWord = " binuang ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " walis ", CebuanoWord = " silhig ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " wow ", CebuanoWord = " ayay ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " yakap ", CebuanoWord = " gakos ", Cost = 0, Status = 0},
new Dictionary {TagalogWord = " yan ", CebuanoWord = " niana ", Cost = 0, Status = 0},
};
try
{
var db = new SQLiteConnection(path);
if (db.InsertAll(mlistWords) != 0)
{
db.UpdateAll(mlistWords);
}
}
catch (SQLiteException)
{
}
}
示例9: fillTip
//end of Trivia Database
//Tip Database
private static void fillTip(){
var data = new List<Tip>
{
new Tip { TipPhrase = "TIP 01: Kumausap ng mga taong mahusay mag-Cebuano"},
new Tip { TipPhrase = "TIP 02: Wag pwersahin ang sarili sa pagkatuto"},
new Tip { TipPhrase = "TIP 03: Magsimula muna sa mga ordinaryong salita"},
new Tip { TipPhrase = "TIP 04: Basahin at gamitin ang diskyunaryo sa app na ito"},
new Tip { TipPhrase = "TIP 05: Mag-ensayo ng mga pangungusap sa iyong isip"},
new Tip { TipPhrase = "TIP 06: Tanggapin lamang na natural magkamali sa umpisa"},
new Tip { TipPhrase = "TIP 07: Ang tamang pagbigkas sa mga salita ay mahalaga"},
new Tip { TipPhrase = "TIP 08: Pakinggan mabuti ang mga tamang pagbigkas na maririnig dito"},
new Tip { TipPhrase = "TIP 09: Ang madalas na paggamit ng mga natutunang salita ay makakatulong"},
new Tip { TipPhrase = "TIP 10: Makinig o manuod ng mga palabas o tugtuging Cebuano"},
new Tip { TipPhrase = "TIP 11: Gawing masaya ang pagkatuto ng Cebuano"},
new Tip { TipPhrase = "TIP 12: Ang mga naipong \"coins\" ay maaring ipambili ng mga salita o ekspresyon"}
};
try
{
var db = new SQLiteConnection(path);
if (db.InsertAll(data) != 0){
db.UpdateAll(data);
}
}
catch (SQLiteException ex)
{
Console.Write (ex.Message);
}
}
示例10: UpdateUploadStat
public void UpdateUploadStat()
{
DateTime now = DateTime.Now;
try {
using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
var list1 = db.Table<Invoice> ().Where (x => x.isUploaded == false&&x.CompCode==comp&&x.BranchCode==brn).ToList<Invoice> ();
List<Invoice> invlist = new List<Invoice>();
foreach (OutLetBillEx bill in bills) {
var found = list1.Where(x=>x.invno==bill.InvNo && bill.TrxType==x.trxtype).ToList<Invoice>();
if (found.Count>0)
{
found[0].isUploaded = true;
found[0].uploaded = now;
invlist.Add(found[0]);
}
}
if (invlist.Count>0)
db.UpdateAll (invlist);
UploadBillsToServer ();
}
} catch (Exception ex) {
_errmsg = "Update status Error." + ex.Message;
}
}
示例11: insert_update_all
//------------------------------------------------------------------------//
//not used yet
public bool insert_update_all(IEnumerable<ShopItem> data)
{
try
{
var db = new SQLiteConnection(m_db_path);
if (db.InsertAll(data) != 0)
db.UpdateAll(data);
return true;
}
catch (SQLiteException ex)
{
Console.WriteLine("exception handled while inserting data:{0}", ex.Message);
return false;
}
}