示例#1
0
 public void New(ObjectListView olv)
 {
     using (SchedulesRepository repo = new SchedulesRepository())
     {
         Schedule obj = repo.New();
         obj.CurrentDate = DateTime.Now.Date;
         obj.Done        = false;
         ScheduleForm frm = new ScheduleForm(obj);
         frm.Text = "Νέα Επιθεώρηση";
         if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             obj = frm.Schedule;
             repo.Insert(obj);
             obj = repo.Reload(obj);
             olv.AddObject(obj);
         }
     }
 }