コード例 #1
0
ファイル: ProcessDataBase.cs プロジェクト: nguyendo94vn/MeBe
        //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;
            }
        }
コード例 #2
0
ファイル: ProcessDataBase.cs プロジェクト: nguyendo94vn/MeBe
 public void UpdateObject(BabyCheck baby)
 {
     using (var db = new SQLiteConnection(dbPath))
     {
        // var existing = db.Query<BabyCheck>("").FirstOrDefault();
         db.RunInTransaction(() =>
         {
             db.Update(baby);
         });
     }
 }
コード例 #3
0
ファイル: Baby.xaml.cs プロジェクト: nguyendo94vn/MeBe
        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();
        }