当前位置: 首页>>代码示例>>C#>>正文


C# SQLite.SQLiteConnection.Delete方法代码示例

本文整理汇总了C#中SQLite.SQLiteConnection.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# SQLite.SQLiteConnection.Delete方法的具体用法?C# SQLite.SQLiteConnection.Delete怎么用?C# SQLite.SQLiteConnection.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SQLite.SQLiteConnection的用法示例。


在下文中一共展示了SQLite.SQLiteConnection.Delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteAddress_DeleteAddressEvent

 private void DeleteAddress_DeleteAddressEvent()
 {
     var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "db.sqlite");
     using (var db = new SQLite.SQLiteConnection(dbPath))
     {
             db.RunInTransaction(() =>
             {
                 foreach (User user in AdressBookItems.SelectedItems)
                 {
                     db.Delete(user);
                 }
             });
             BindLists();
     }
 }
开发者ID:TimothyJames,项目名称:SIG-Windows8,代码行数:15,代码来源:Dashboard.xaml.cs

示例2: DeleteRequest_DeleteRequestEvent

        void DeleteRequest_DeleteRequestEvent()
        {
            var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "db.sqlite");
            using (var db = new SQLite.SQLiteConnection(dbPath))
            {
                db.RunInTransaction(() =>
                {
                    foreach (Appointment appointment in RequestItems.SelectedItems)
                    {
                        db.Delete(appointment);
                    }
                });

                BindLists();

            }
        }
开发者ID:TimothyJames,项目名称:SIG-Windows8,代码行数:17,代码来源:Dashboard.xaml.cs

示例3: dropHistory

        public void dropHistory()
        {
            using (var db = new SQLite.SQLiteConnection(app.DBPath))
            {
                db.DropTable<History>();
                var data = db.Table<History>();
                if (db.Delete(data) > 0)
                {

                }
            }
        }
开发者ID:sovenga,项目名称:ElectricityApp,代码行数:12,代码来源:HistoryViewModel.cs

示例4: DeleteInv

 private void DeleteInv()
 {
     try {
         using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
             var list = db.Table<InvoiceDtls> ().Where (x => x.invno == invno).ToList<InvoiceDtls> ();
             var list2 = db.Table<Invoice> ().Where (x => x.invno == invno).ToList<Invoice> ();
             if (list2.Count > 0) {
                 string trxtype = "INV";
                 AdNumDate adNum = DataHelper.GetNumDate (pathToDatabase, list2 [0].invdate, trxtype);
                 if (invno.Length > 5) {
                     string snum = invno.Substring (invno.Length - 4);
                     int num;
                     if (int.TryParse (snum, out num)) {
                         if (adNum.RunNo == num) {
                             adNum.RunNo = num - 1;
                             db.Update(adNum);
                             db.Delete (list2 [0]);
                             if (list.Count>0)
                             {
                                 foreach(var itmdtls in list)
                                     db.Delete(itmdtls);
                             }
                         }
                     }
                 }
             }
         }
     } catch (Exception ex)
     {
         Toast.MakeText (this,ex.Message , ToastLength.Long).Show ();
     }
 }
开发者ID:mokth,项目名称:merpV3,代码行数:32,代码来源:InvoiceActivityEx.cs

示例5: DeleteItem

 void DeleteItem(InvoiceDtls invdtls)
 {
     using (var db = new SQLite.SQLiteConnection(pathToDatabase))
     {
         var list = db.Table<InvoiceDtls>().Where(x=>x.invno==invdtls.invno&& x.ID==invdtls.ID).ToList<InvoiceDtls>();
         if (list.Count > 0) {
             db.Delete (list [0]);
             RefreshItemList ();
     //					var arrlist= listData.Where(x=>x.invno==invdtls.invno&& x.ID==invdtls.ID).ToList<InvoiceDtls>();
     //					if (arrlist.Count > 0) {
     //						listData.Remove (arrlist [0]);
     //						SetViewDlg viewdlg = SetViewDelegate;
     //						listView.Adapter = new GenericListAdapterEx<InvoiceDtls> (this, listData, Resource.Layout.InvDtlItemViewCS, viewdlg);
     //					}
         }
     }
 }
开发者ID:mokth,项目名称:merpV3,代码行数:17,代码来源:InvoiceActivityEx.cs

示例6: DeleteDOWithEmptyDOitem

 private void DeleteDOWithEmptyDOitem()
 {
     try{
         using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
             var list = db.Table<DelOrderDtls>().Where(x=>x.dono==dono&&x.CompCode==compCode&&branchCode==branchCode).ToList<DelOrderDtls>();
             if (list.Count == 0) {
                 var list2 = db.Table<DelOrder>().Where(x=>x.dono==dono&&x.CompCode==compCode&&branchCode==branchCode).ToList<DelOrder>();
                 if (list2.Count > 0) {
                     AdNumDate adNum= DataHelper.GetNumDate(pathToDatabase, list2[0].dodate,"DO",compCode,branchCode);
                     if (dono.Length > 5) {
                         string snum= dono.Substring (dono.Length - 4);
                         int num;
                         if (int.TryParse (snum, out num)) {
                             if (adNum.RunNo == num) {
                                 adNum.RunNo = num - 1;
                                 db.Delete (list2[0]);
                                 db.Delete (adNum);
                             }
                         }
                     }
                 }
                 //db.Table<Invoice> ().Delete (x => x.invno == invno);
             }
         }
     }catch{
     }
 }
开发者ID:mokth,项目名称:merpCS,代码行数:27,代码来源:DOItemActivity.cs

示例7: DeleteInv

 private void DeleteInv()
 {
     try {
         using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
             var list = db.Table<InvoiceDtls> ().Where (x => x.invno == invno).ToList<InvoiceDtls> ();
             var list2 = db.Table<Invoice> ().Where (x => x.invno == invno).ToList<Invoice> ();
             if (list2.Count > 0) {
                 string trxtype = "CS";
                 AdNumDate adNum = DataHelper.GetNumDate (pathToDatabase, list2 [0].invdate, trxtype);
                 if (invno.Length > 5) {
                     string snum = invno.Substring (invno.Length - 4);
                     int num;
                     if (int.TryParse (snum, out num)) {
                         if (adNum.RunNo == num) {
                             adNum.RunNo = num - 1;
                             db.Delete (list2 [0]);
                             if (list.Count>0)
                                 db.Delete(list);
                             db.Delete (adNum);
                         }
                     }
                 }
             }
         }
     } catch {
     }
 }
开发者ID:mokth,项目名称:merpV3,代码行数:27,代码来源:CashSalesActivity.cs

示例8: DeleteIntake

 public void DeleteIntake(IntakeViewModel intake)
 {
     using (var db = new SQLite.SQLiteConnection(App.DBPath))
         {
             Intake delete = db.Table<Intake>().Where(i => i.Id == intake.Id).SingleOrDefault();
             var day = (db.Table<Day>().Where(d => d.Id == intake.DayId)).SingleOrDefault();
             reduceDayTotals(day, intake);
             db.Delete(delete);
         }
 }
开发者ID:porokuokka,项目名称:CaloriesCounter,代码行数:10,代码来源:IntakeViewModel.cs

示例9: DeleteCust

        void DeleteCust(Trader item)
        {
            bool isDeleted = false;
            using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
                var list = db.Table<Trader> ().Where (x => x.CustCode == item.CustCode && x.CompCode == item.CompCode && x.BranchCode == item.BranchCode).ToList ();
                if (list.Count > 0) {
                    if (list [0].IsLocal) {
                        db.Delete (list [0]);
                        isDeleted = true;
                    }
                }
            }

            if (isDeleted) {
                listData.Clear ();
                populate (listData);
                SetViewDlg viewdlg = SetViewDelegate;
                listView.Adapter = new GenericListAdapter<Trader> (this, listData, Resource.Layout.ListCustDtlView, viewdlg);
            }
        }
开发者ID:mokth,项目名称:merpCS,代码行数:20,代码来源:CustomerActivity.cs

示例10: DeleteIngredient

        public string DeleteIngredient(int ingredientId)
        {
            string result = string.Empty;
            using (var db = new SQLite.SQLiteConnection(App.DBPath))
            {
                var existingIngredient = (db.Table<Ingredient>().Where(
                    c => c.Id == ingredientId)).Single();

                if (db.Delete(existingIngredient) > 0)
                {
                    result = "Success";
                }
                else
                {
                    result = "This ingredient was not removed";
                }
            }
            return result;
        }
开发者ID:mhebestadt,项目名称:CateringKingCalculator,代码行数:19,代码来源:IngredientViewModel.cs

示例11: Delete

 private void Delete(Model.Usuario Usuario)
 {
     using (var db = new SQLite.SQLiteConnection(DB_PATH))
     {
         if (db.Delete(Usuario) > 0)
             ListaDeUsuarios.Remove(Usuario);
     }
 }
开发者ID:yvanafv,项目名称:windowsphoneapp,代码行数:8,代码来源:UsuarioViewModel.cs

示例12: deleteAllAppliances

        public void deleteAllAppliances()
        {
            using (var db = new SQLite.SQLiteConnection(app.DBPath))
            {
                db.DropTable<Appliance>();
                    var data = db.Table<Appliance>();
                    if (db.Delete(data) > 0)
                    {

                    }
                    else { 
                        
                    }   
            
            }
        }
开发者ID:sovenga,项目名称:ElectricityApp,代码行数:16,代码来源:ApplianceViewModel.cs

示例13: deleteAllUsersVersion2

        public void deleteAllUsersVersion2()
        {
            using (var db = new SQLite.SQLiteConnection(app.DBPath))
            {
                var data = db.Query<User>("delete from Appliance");
                if (db.Delete(data) > 0)
                {

                }

            }

        }
开发者ID:sovenga,项目名称:ElectricityApp,代码行数:13,代码来源:ApplianceViewModel.cs

示例14: deleteAllUsers

        public void deleteAllUsers()
        {
            using (var db = new SQLite.SQLiteConnection(app.DBPath))
            {
                var data = db.Table<User>();
                if (db.Delete(data) > 0)
                { 
                    
                }
                
            }

        }
开发者ID:sovenga,项目名称:ElectricityApp,代码行数:13,代码来源:ApplianceViewModel.cs

示例15: DeleteCNWithEmptyCNitem

 private void DeleteCNWithEmptyCNitem()
 {
     try{
         using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
             var list = db.Table<CNNoteDtls>().Where(x=>x.cnno==invno).ToList<CNNoteDtls>();
             if (list.Count == 0) {
                 var list2 = db.Table<CNNote>().Where(x=>x.cnno==invno).ToList<CNNote>();
                 if (list2.Count > 0) {
                     AdNumDate adNum= DataHelper.GetNumDate(pathToDatabase, list2[0].invdate,"CN");
                     if (invno.Length > 5) {
                         string snum= invno.Substring (invno.Length - 4);
                         int num;
                         if (int.TryParse (snum, out num)) {
                             if (adNum.RunNo == num) {
                                 adNum.RunNo = num - 1;
                                 db.Delete (list2[0]);
                                 db.Delete (adNum);
                             }
                         }
                     }
                 }
                 //db.Table<Invoice> ().Delete (x => x.invno == invno);
             }
         }
     }catch{
     }
 }
开发者ID:mokth,项目名称:merpV2Production,代码行数:27,代码来源:CNItemActivity.cs


注:本文中的SQLite.SQLiteConnection.Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。