public RoomsForm() { InitializeComponent(); ds = new dsShedule(); this.Load += new EventHandler(RoomsForm_Load); }
public static List <ScheduleDiscipline> DisciplinesToList(dsShedule ds) { return((from dr in ds.Discipline select new ScheduleDiscipline() { Id = dr.Id, Name = dr.Name }).ToList()); }
public static List <ScheduleGroup> GroupsToList(dsShedule ds) { return((from dr in ds.Group select new ScheduleGroup() { Id = dr.Id, Name = dr.Name }).ToList()); }
public static List <ScheduleTeacher> TeachersToList(dsShedule ds) { return((from dr in ds.Teacher select new ScheduleTeacher() { Id = dr.Id, Name = dr.Name }).ToList()); }
public static List <ScheduleRoom> RoomsToList(dsShedule ds) { return((from dr in ds.Room select new ScheduleRoom() { DisciplinesLection = (dr.DisciplineLection.Split(new char[] { ',' })).ToList(), DisciplinesLabWork = (dr.DisciplineLabWork.Split(new char[] { ',' })).ToList(), DisciplinesPractice = (dr.DisciplinePractice.Split(new char[] { ',' })).ToList(), Lection = dr.Lection, LabWork = dr.LabWork, Practice = dr.Practice, Name = dr.Name }).ToList()); }
public EdicationLoadForm(List <ScheduleTeacher> tch, List <ScheduleDiscipline> dsp) { InitializeComponent(); SheduleDataSet = new dsShedule(); this.Load += new EventHandler(EdicationLoadForm_Load); Teachers = tch; Disciplines = dsp; }
public static List <LoadItem> EducationToList(dsShedule ds) { return((from dr in ds.Education select new LoadItem() { Groups = (dr.Group.Replace(" ", "").Split(new char[] { ',' })).ToList(), HoursSem = dr.HoursSem, Discipline = dr.Discipline, Teacher = dr.Teacher, LessonType = (LessonType)dr.LessonType, } ).ToList()); }
private void LoadDictionatyes() { ScheduleDataSet = new dsShedule(); Rooms = new List <ScheduleRoom>(); Teachers = new List <ScheduleTeacher>(); Groups = new List <ScheduleGroup>(); Disciplines = new List <ScheduleDiscipline>(); try { string filename = @"Data/Нагрузка.xml"; ScheduleDataSet.Education.ReadXml(filename); EducationAdapter = new EducationLoadAdapter(DictionaryConverter.EducationToList(ScheduleDataSet)); } catch (Exception) { MessageBox.Show("Не могу открыть файл c нагрузкой"); } try { string filename = @"Data/Аудитории.xml"; ScheduleDataSet.Room.ReadXml(filename); Rooms = DictionaryConverter.RoomsToList(ScheduleDataSet); } catch (Exception) { MessageBox.Show("Не могу открыть файл с аудиториями"); } try { string filename = @"Data/Преподаватели.xml"; ScheduleDataSet.Teacher.ReadXml(filename); Teachers = DictionaryConverter.TeachersToList(ScheduleDataSet); } catch (Exception) { MessageBox.Show("Не могу открыть файл с преподавателями"); } try { string filename = @"Data/Группы.xml"; ScheduleDataSet.Group.ReadXml(filename); Groups = DictionaryConverter.GroupsToList(ScheduleDataSet); } catch (Exception) { MessageBox.Show("Не могу открыть файл с группами"); } try { string filename = @"Data/Дисциплины.xml"; ScheduleDataSet.Discipline.ReadXml(filename); Disciplines = DictionaryConverter.DisciplinesToList(ScheduleDataSet); } catch (Exception) { MessageBox.Show("Не могу открыть файл с дисциплинами"); } }