Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Chemtex5.Models;
- using SQLite;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using Xamarin.Forms;
- namespace Chemtex5.Views
- {
- public class AddTransportPage : ContentPage
- {
- private Picker _picker;
- private Entry _idEntry;
- private Entry _nameEntry;
- private Entry _countEntry;
- private Button _AddButton;
- Surowiec surowiec = new Surowiec();
- string _dbPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "myDB.db3");
- public AddTransportPage()
- {
- this.Title = "Dodaj surowce z transportu";
- var db = new SQLiteConnection(_dbPath);
- StackLayout stackLayout = new StackLayout();
- for(int i = 0; i<5; i++)
- {
- _picker = new Picker
- {
- ItemsSource = db.Table<Surowiec>().OrderBy(x => x.Name).ToList(),
- Title = "Wybierz surowiec",
- TitleColor = Color.Gold,
- };
- _idEntry = new Entry()
- {
- Placeholder = "ID",
- IsVisible = false
- };
- _countEntry = new Entry()
- {
- Keyboard = Keyboard.Text,
- Placeholder = "Wprowadź ilość surowca"
- };
- stackLayout.Children.Add(_picker);
- stackLayout.Children.Add(_idEntry);
- stackLayout.Children.Add(_countEntry);
- }
- _AddButton = new Button();
- _AddButton.Text = "Dodaj";
- _AddButton.Clicked += _AddButton_Clicked;
- Content = stackLayout;
- }
- /* private async void _AddButton_Clicked(object sender, EventArgs e)
- {
- var db = new SQLiteConnection(_dbPath);
- Surowiec surowiec = new Surowiec()
- {
- Id =
- }
- }*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement