public int InsertToSQL(FoodTABLE foodinstance) { var conn = new SQLiteConnection(GlobalFunction.dbPath); conn.CreateTable <FoodTABLE>(); return(conn.Insert(foodinstance)); }
public async void InsertToSQL(FoodTABLE foodinstance, string just_to_make_overload) { var conn = new SQLiteAsyncConnection(GlobalFunction.dbPath); await conn.CreateTableAsync <FoodTABLE>(); int retRecord = await conn.InsertAsync(foodinstance); } //experiment method
protected override void OnCreate(Bundle savedInstanceState) { SetTheme(Resource.Style.Base_Theme_AppCompat_Light); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_food_detail); var img_back = FindViewById <ImageView>(Resource.Id.imageView46); img_back.Click += delegate { //StartActivity(new Intent(this, typeof(Food_Type_1))); this.Finish(); };//back button total = 1; foodTABLE = new FoodTABLE(); f_name = FindViewById <TextView>(Resource.Id.food_name2); f_cal = FindViewById <TextView>(Resource.Id.food_cal2); f_unit = FindViewById <TextView>(Resource.Id.food_unit2); f_netweight = FindViewById <TextView>(Resource.Id.food_netweight2); f_netunit = FindViewById <TextView>(Resource.Id.food_netunit2); f_pro = FindViewById <TextView>(Resource.Id.food_protein2); f_fat = FindViewById <TextView>(Resource.Id.food_fat2); f_car = FindViewById <TextView>(Resource.Id.food_carbohydrate2); f_sugar = FindViewById <TextView>(Resource.Id.food_sugar2); f_sodium = FindViewById <TextView>(Resource.Id.food_sodium2); f_detail = FindViewById <TextView>(Resource.Id.tv_food_detail); rec = FindViewById <ImageView>(Resource.Id.imageView30); #region incomplete rec.Click += delegate { df_show = new SimpleDateFormat("yyyy-MM-dd HH:mm"); c = Calendar.GetInstance(Java.Util.TimeZone.GetTimeZone("GMT+7")); var intent = new Intent(this, typeof(Report)); intent.AddFlags(ActivityFlags.ClearTop); StartActivity(intent); Finish(); //function incomplete }; #endregion editCal_Total = FindViewById <EditText>(Resource.Id.et_exe2); editCal_Total.Click += delegate { total = Convert.ToDouble(editCal_Total.Text); SetFoodDetail(total); }; detailFood = foodTABLE.selectDetailByID(Intent.GetIntExtra("food_id", 0)); SetFoodDetail(total); //GlobalFunction.createDialog(this, Intent.GetIntExtra("food_id", 0).ToString()).Show(); // Create your application here }
protected override void OnCreate(Bundle savedInstanceState) { SetTheme(Resource.Style.Base_Theme_AppCompat_Light); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_food__type_1); btn_search = FindViewById <Button>(Resource.Id.bFoodSearch); txt_search = FindViewById <EditText>(Resource.Id.tv_Sfood); var img_back = FindViewById <ImageView>(Resource.Id.imageView44); foodTable = new FoodTABLE(); btn_search.Click += delegate { word_search = txt_search.Text; setListFood(word_search); }; img_back.Click += delegate { //StartActivity(new Intent(this, typeof(MainActivity))); this.Finish(); }; base.ListView.ItemClick += onItemClick; setListFood(""); // Create your application here }