示例#1
0
        //private ObservableCollection<Plans> PlanList;
        public MainPage()
        {
            this.InitializeComponent();
            Sqlite data = new Sqlite();

            PlanList = data.conn.Table<Plans>();
        }
示例#2
0
 public CompanyCodeViewModel(SQLite.Net.TableQuery <CompanyCode> companyCodeTable)
 {
     for (int i = 0; i < companyCodeTable.Count(); i++)
     {
         companyCodeList.Add(companyCodeTable.ElementAt <CompanyCode>(i));
     }
 }
示例#3
0
        /// <summary>
        /// Rafraichit la grille de tache dans une boucle
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RefreshTask(object sender, RoutedEventArgs e)
        {
            App Data = App.Current as App;

            SQLite.Net.TableQuery <Task> TaskToDo = Data.MyDb.Table <Task>();
            foreach (var OneTask in TaskToDo)
            {
                Grid      AllTask;
                TextBlock Done;
                TextBlock Date;
                MenuToDoList.Children.Add(AllTask = new Tasks
                {
                    Background = new SolidColorBrush(Windows.UI.Colors.CornflowerBlue),
                    Margin     = new Thickness(50, 50, 0, 0),
                    Height     = 300,
                    Width      = 200,
                    Id         = OneTask.Id
                });
                AllTask.Children.Add(new TextBlock
                {
                    Text          = OneTask.Title,
                    Foreground    = new SolidColorBrush(Windows.UI.Colors.Black),
                    TextAlignment = TextAlignment.Center,
                    FontWeight    = FontWeights.ExtraBlack,
                    TextWrapping  = TextWrapping.Wrap,
                    TextTrimming  = TextTrimming.CharacterEllipsis,
                    MaxHeight     = 50,
                    Margin        = new Thickness(0, 0, 0, 75)
                });
                AllTask.Children.Add(new TextBlock
                {
                    Text          = OneTask.DueTime,
                    Foreground    = new SolidColorBrush(Windows.UI.Colors.Purple),
                    TextAlignment = TextAlignment.Center,
                    FontWeight    = FontWeights.ExtraBlack,
                    TextWrapping  = TextWrapping.Wrap,
                    TextTrimming  = TextTrimming.CharacterEllipsis,
                    MaxHeight     = 50,
                    Margin        = new Thickness(0, 0, 0, 20)
                });
                AllTask.Children.Add(Done = new TextBlock
                {
                    Foreground    = new SolidColorBrush(Windows.UI.Colors.DarkBlue),
                    TextAlignment = TextAlignment.Center,
                    Margin        = new Thickness(0, 0, 0, 75),
                    Visibility    = Visibility.Collapsed
                });
                if (OneTask.Done == true)
                {
                    AllTask.Background = new SolidColorBrush(Windows.UI.Colors.LightGreen);
                }
                AllTask.PointerPressed += new PointerEventHandler(grid_OnClick);
            }
        }