private void btn_save_test_Click(object sender, EventArgs e) { string dpPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "Blood_Tests.sqlite"); var db = new SQLiteConnection(dpPath); db.CreateTable <Tbl_Tests>(); Tbl_Tests tbl = new Tbl_Tests(); tbl.Test_Name = txt_test_name.Text; tbl.Test_Range = txt_test_range.Text; db.Insert(tbl); Toast.MakeText(this, "Record Added Successfully...,", ToastLength.Short).Show(); txt_test_name.Text = ""; txt_test_range.Text = ""; load_spiner_tests(); }
private void btn_delete_test_Click(object sender, EventArgs e) { string dpPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "Blood_Tests.sqlite"); var db = new SQLiteConnection(dpPath); var subitem = new Tbl_Tests(); var item = new Tbl_Tests(); item.Id = Convert.ToInt32(txt_test_id.Text); var data = db.Delete(item); Toast.MakeText(this, "Record Deleted Successfully...,", ToastLength.Short).Show(); txt_test_name.Text = ""; txt_test_range.Text = ""; load_spiner_tests(); }