本文整理汇总了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();
}
}
示例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();
}
}
示例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)
{
}
}
}
示例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 ();
}
}
示例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);
// }
}
}
}
示例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{
}
}
示例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 {
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例11: Delete
private void Delete(Model.Usuario Usuario)
{
using (var db = new SQLite.SQLiteConnection(DB_PATH))
{
if (db.Delete(Usuario) > 0)
ListaDeUsuarios.Remove(Usuario);
}
}
示例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 {
}
}
}
示例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)
{
}
}
}
示例14: deleteAllUsers
public void deleteAllUsers()
{
using (var db = new SQLite.SQLiteConnection(app.DBPath))
{
var data = db.Table<User>();
if (db.Delete(data) > 0)
{
}
}
}
示例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{
}
}