private void LoadCurTimetable() { DateTime date = dateTimePicker1.Value; if (date < mTb.StartTime || date >= mTb.EndTime) { mTb.ReadTimetable(date, mCategory); tn = new TreeNode(mTb.Timetable.Print()); tn.Name = mTb.Timetable.Name; foreach (var itr in mTb.Timetable.Subs) { LoadTimetableItemSubs(itr, tn); } treeView1.Nodes.Clear(); treeView1.Nodes.Add(tn); treeView1.ExpandAll(); ViewEventItem.InitCategoryCompare(mTb.Timetable); } mTb.Timetable.Clear(); foreach (var ev in curEvs) { mTb.Timetable.Update(ev.Category, UltilityConvert.ToDoble(ev.Time), (double)24); } DisplayTimetable(mTb.Timetable, tn); }
private void InitializeTimetable() { mTb = new ModelTimetable(); mTb.ReadTimetable(dateTimePicker1.Value, mCategory); tn = new TreeNode(mTb.Timetable.Print()); tn.Name = mTb.Timetable.Name; foreach (var itr in mTb.Timetable.Subs) { LoadTimetableItemSubs(itr, tn); } treeView1.Nodes.Clear(); treeView1.Nodes.Add(tn); treeView1.ExpandAll(); }
private void LoadCurTimetable() { if (true) { mTb.ReadTimetable(dateTimePicker1.Value, mCategory); tn = new TreeNode(mTb.Timetable.Print()); tn.Name = mTb.Timetable.Name; foreach (var itr in mTb.Timetable.Subs) { LoadTimetableItemSubs(itr, tn); } treeView1.Nodes.Clear(); treeView1.Nodes.Add(tn); treeView1.ExpandAll(); } mTb.Timetable.Clear(); foreach (var ev in viewEvList) { mTb.Timetable.Update(ev.Category, ev.Time, (double)720); } //DisplayTimetable(mTb.Timetable, tn.Nodes[0]); DisplayTimetable(mTb.Timetable, tn); }