//insert lan check - ke thua method nay public new ObservableCollection<BabyCheck> GetListObject() { using (var db = new SQLiteConnection(dbPath)) { BabyCheck temp = new BabyCheck(); List<BabyCheck> obCollection = db.Table<BabyCheck>().ToList<BabyCheck>(); for(int i = 0,j = obCollection.Count-1;i<obCollection.Count;++i) { if(i<obCollection.Count/2) { temp = obCollection[i]; obCollection[i] = obCollection[j]; obCollection[j] = temp; } } ObservableCollection<BabyCheck> listBabyCheck = new ObservableCollection<BabyCheck>(obCollection); return listBabyCheck; } }
public void UpdateObject(BabyCheck baby) { using (var db = new SQLiteConnection(dbPath)) { // var existing = db.Query<BabyCheck>("").FirstOrDefault(); db.RunInTransaction(() => { db.Update(baby); }); } }
private void ResultBaby_Click(object sender, RoutedEventArgs e) { Index index = new Index(); index = ProcessTextInput(InputHeightBaby.Text, InputWeightBaby.Text); var localSetting = ApplicationData.Current.LocalSettings; Object value = localSetting.Values["CheckSex"]; string sex = (string)value; BabyCheck baby = new BabyCheck(); ProcessBabyCheck prbb = new ProcessBabyCheck(MeBe.MainPage._month, sex, index.weight, index.height); AdviceForBaby.Text = prbb.SmartCheck(); }