예제 #1
0
        public RoomsForm()
        {
            InitializeComponent();

            ds = new dsShedule();

            this.Load += new EventHandler(RoomsForm_Load);
        }
예제 #2
0
 public static List <ScheduleDiscipline> DisciplinesToList(dsShedule ds)
 {
     return((from dr in ds.Discipline
             select new ScheduleDiscipline()
     {
         Id = dr.Id,
         Name = dr.Name
     }).ToList());
 }
예제 #3
0
 public static List <ScheduleGroup> GroupsToList(dsShedule ds)
 {
     return((from dr in ds.Group
             select new ScheduleGroup()
     {
         Id = dr.Id,
         Name = dr.Name
     }).ToList());
 }
예제 #4
0
 public static List <ScheduleTeacher> TeachersToList(dsShedule ds)
 {
     return((from dr in ds.Teacher
             select new ScheduleTeacher()
     {
         Id = dr.Id,
         Name = dr.Name
     }).ToList());
 }
예제 #5
0
 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());
 }
예제 #6
0
        public EdicationLoadForm(List <ScheduleTeacher> tch, List <ScheduleDiscipline> dsp)
        {
            InitializeComponent();

            SheduleDataSet = new dsShedule();

            this.Load += new EventHandler(EdicationLoadForm_Load);

            Teachers    = tch;
            Disciplines = dsp;
        }
예제 #7
0
 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());
 }
예제 #8
0
파일: MainForm.cs 프로젝트: Iovy/MyShedule
        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("Не могу открыть файл с дисциплинами");
            }
        }