public MainModel() { DataContext = new DiaryDataContext(ConnectionString); tableDiary = DataContext.Diary; listTime.Add("所有"); foreach (Diary diary in tableDiary) { listId.Add(diary.Id); listTime.Add(diary.time); listTitle.Add(diary.title); listContent.Add(diary.content); listWeather.Add(diary.weather); listCurrentTime.Add(diary.time); } listTime = new BindingList <string>(listTime.Distinct().ToList()); }
public newDiaryModel() { DataContext = new DiaryDataContext(ConnectionString); }