private void AddDataToListView(object sender, RoutedEventArgs e)
    {
        daysLeft = new List <int>();
        ReadAllData alldata = new ReadAllData();

        DB_DaysLeft = alldata.GetAllDays();
        foreach (days in DB_Days_Lefy)
        {
            daysLeft.add(dateTime.Now.Subtract(days).TotalDays());
        }
    }
Exemplo n.º 2
0
    private void AddDataToListView(object sender, RoutedEventArgs e)
    {
        daysleft = new List <AllData>();

        ReadAllData alldata = new ReadAllData();

        DB_DaysLeft = alldata.GetAllDays();
        foreach (var Date in DB_DaysLeft)
        {
            AllData  ad = new AllData();
            DateTime dt = Convert.ToDateTime(Date);

            TimeSpan diff = DateTime.Now - Date.Date;
            int      days = (int)Math.Abs(Math.Round(diff.TotalDays));


            ad.diff    = days;
            ad.myEvent = events;
            daysleft.Add(ad);
        }
        DaysLeftListView.ItemsSource = DB_DaysLeft.OrderByDescending(i => i.Id).ToList();
    }