コード例 #1
0
ファイル: Program.cs プロジェクト: chronus7/StudyPlaner
        private static UniversityModule mockupEditModuleForm()
        {
            UniversityModule mod = new UniversityModule();
            mod.Name = "Algorithmen und Datenstrukturen";
            mod.ShortName = "AD";
            mod.Semester = UniversityStuff.Enums.Semester.Winter;
            mod.Department = UniversityStuff.Enums.Department.IT;
            mod.ID = 12354;

            UniversityEvent ev = new UniversityEvent();
            ev.LVNum = "67-125";
            ev.Type = UniversityStuff.Enums.EventType.Lecture;
            ev.Date = new Various.Time(8, 15, new DateTime(2012, 12, 4));
            ev.Duration = new TimeSpan(1, 30, 0);
            //mod.Events.Add(ev);

            UniversityEvent ev2 = new UniversityEvent();
            ev2.LVNum = "67-126";
            ev2.Type = UniversityStuff.Enums.EventType.Internship;
            ev2.Date = new Various.Time(10, 15, new DateTime(2012, 12, 4));
            ev2.Duration = new TimeSpan(1, 30, 0);
            //mod.Events.Add(ev2);

            UniversityEvent ev3 = new UniversityEvent();
            ev3.LVNum = "67-127";
            ev3.Type = UniversityStuff.Enums.EventType.Internship;
            ev3.Date = new Various.Time(12, 15, new DateTime(2012, 12, 4));
            ev3.Duration = new TimeSpan(1, 30, 0);
            //mod.Events.Add(ev3);

            return mod;
        }
コード例 #2
0
        /// <summary>
        /// Adds a Module to the UniversityManager
        /// </summary>
        /// <param name="uniID">The ID of the University to which the UniversityModule belongs</param>
        /// <param name="toAdd">The Module to add</param>
        /// <returns>The ID that was used to add the University</returns>
        public static uint AddModule(ushort uniID, UniversityModule toAdd)
        {
            CheckInitialization();

            if (toAdd == null)
                throw new ArgumentNullException("toAdd");

            uint newID = toAdd.ID;
            if (!IsValidID(newID) || ContainsModule(newID))
                newID = GenerateNewID(uniID);

            toAdd.ID = newID;
            _modules.Add(newID, toAdd);

            University uni = GetUniversity(uniID);
            uni.Modules.Add(newID); // uni.Modules != null garanteed by uni

            return toAdd.ID;
        }
コード例 #3
0
        private void Init()
        {
            if (_isNewModule)
                _module = new UniversityModule();
            _headNodes = new List<HeadTreeNode>();

            _cmBoxSemester.DataSource = Enum.GetValues(typeof(Semester));
            _cmBoxDepartment.DataSource = Enum.GetValues(typeof(Department));
            _cmBoxEventType.DataSource = Enum.GetValues(typeof(EventType));
            _cmBoxWeekInterval.DataSource = Enum.GetValues(typeof(WeekInterval));

            _panelEventData.Visible = false;

            if (_isNewModule)
                UniversityManager.AddModule(_uniId, _module); // will be deleted on cancel.
        }
コード例 #4
0
 private void CollectModuleData(uint moduleID)
 {
     _module = UniversityManager.GetModule(moduleID);
     _shortModified = true;
     _txBoxName.Text = _module.Name;
     _txBoxShort.Text = _module.ShortName;
     _cmBoxSemester.SelectedItem = _module.Semester;
     _cmBoxDepartment.SelectedItem = _module.Department;
 }