예제 #1
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            Case     @case     = new Case();
            DateTime select    = (DateTime)Calendar.SelectedDate;
            string   selectnew = select.ToShortDateString();

            //@case.Reader(Read_Textblock, selectnew);

            using (var contex = new MyDbContex())
            {
                var Case = contex.Cases;

                foreach (Case c in Case)
                {
                    if (select == c.DateCreat)
                    {
                        Read_Textblock.Text += $"Название дела:{c.Name}\n" +
                                               $"Дата планирования:{c.DateCreat.ToShortDateString()}\n" +
                                               $"Время планирования:{c.time}\n" +
                                               $"Важность:{c.importance}\n";
                    }
                }
            }
            SelectedDates(Calendar);
        }
예제 #2
0
 void SelectedDates(Calendar calendar)
 {
     using (var contex = new MyDbContex())
     {
         var Case = contex.Cases;
         foreach (Case c in Case)
         {
             calendar.SelectedDates.Add(c.DateCreat);
         }
     }
 }
예제 #3
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     using (var contex = new MyDbContex())
     {
         var  Case  = new Case(Time, Name_Textbox, Data, Prime);
         Case @case = new Case(Time, Name_Textbox, Data, Prime);
         @case.Writer();
         contex.Cases.Add(Case);
         contex.SaveChanges();
     }
     SelectedDates(Calendar);
 }