コード例 #1
0
        async void Save_Clicked(object sender, EventArgs e)
        {
            Console.WriteLine(Item.Percentage);
            var SelectedDate = Item.DueDate;



            MessagingCenter.Send(this, "AddItem", Item);
            SQLSource sqlsource = new SQLSource()
            {
                Name        = ItemName.Text,
                Description = ItemDescription.Text,
                Department  = (string)DepartmentSelector.SelectedItem,
                Subject     = (string)SubjectSelector.SelectedItem,
                Date        = SelectedDate,
                Percent     = Item.Percentage,
            };

            Console.Write(SelectedDate + "Selected");

            using (SQLiteConnection conn = new SQLiteConnection(App.FilePath))
            {
                conn.CreateTable <SQLSource>();
                int rowsAdded = conn.Insert(sqlsource);

                //String selectQuery = "SELECT * FROM " + TABLE_NAME + " ORDER BY datetime(dateColumn) DESC";
                //return database.rawQuery(selectQuery, null);
            }

            await Navigation.PopModalAsync();
        }
コード例 #2
0
 public ItemDetailViewModel(SQLSource item)
 {
     this.item = item;
 }