コード例 #1
0
        public List <ModuleStudyAction> DoImport(Group group, Module module)
        {
            List <ModuleStudyAction> result = new List <ModuleStudyAction>();
            // For the sake of convenience
            Action <ModuleStudyAction> add = x => { if (x != null)
                                                    {
                                                        result.Add(x);
                                                    }
            };

            add(_doLections(group, module));
            add(_doPractices(group, module));
            add(_doLabs(group, module));
            add(_doSelf(group, module));
            add(_doExam(group, module));
            add(_doZALIK(group, module));
            add(_doModule_tests(group, module));
            add(_doCourse_project(group, module));
            add(_doCourse_work(group, module));
            add(_doRGR(group, module));
            add(_doDKR(group, module));
            add(_doReferat(group, module));

            return(result);
        }
コード例 #2
0
        ModuleStudyAction _doSelf(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.Self != null && module.Self > 0)
            {
                result = _getItem("Самостійна робота студентів", (int)module.Self, group, module);
            }
            return(result);
        }
コード例 #3
0
        ModuleStudyAction _doReferat(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.Referat != null && module.Referat > 0)
            {
                result = _getItem("Реферати", (int)module.Referat, group, module);
            }
            return(result);
        }
コード例 #4
0
        ModuleStudyAction _doDKR(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.DKR != null && module.DKR > 0)
            {
                result = _getItem("ДКР", (int)module.DKR, group, module);
            }
            return(result);
        }
コード例 #5
0
        ModuleStudyAction _doCourse_work(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.Course_work != null && module.Course_work > 0)
            {
                result = _getItem("Курсові роботи", (int)module.Course_work, group, module);
            }
            return(result);
        }
コード例 #6
0
        ModuleStudyAction _doRGR(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.RGR != null && module.RGR > 0)
            {
                result = _getItem("РГР", (int)module.RGR, group, module);
            }
            return(result);
        }
コード例 #7
0
        ModuleStudyAction _doModule_tests(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.Module_tests != null && module.Module_tests > 0)
            {
                result = _getItem("Модульні", (int)module.Module_tests, group, module);
            }
            return(result);
        }
コード例 #8
0
        ModuleStudyAction _doCourse_project(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.Course_project != null && module.Course_project > 0)
            {
                result = _getItem("Курсові  проекти", (int)module.Course_project, group, module);
            }
            return(result);
        }
コード例 #9
0
        ModuleStudyAction _doExam(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.Exam != null && module.Exam > 0)
            {
                result = _getItem("Екзамени", (int)module.Exam, group, module);
            }
            return(result);
        }
コード例 #10
0
        ModuleStudyAction _doLabs(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.Labs != null && module.Labs > 0)
            {
                result = _getItem("Лабораторні", (int)module.Labs, group, module);
            }
            return(result);
        }
コード例 #11
0
        ModuleStudyAction _doPractices(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.Practices != null && module.Practices > 0)
            {
                result = _getItem("Практичні", (int)module.Practices, group, module);
            }
            return(result);
        }
コード例 #12
0
        ModuleStudyAction _doLections(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.Lections != null && module.Lections > 0)
            {
                result = _getItem("Лекції", (int)module.Lections, group, module);
            }
            return(result);
        }
コード例 #13
0
        public Group ImportGroup(RowNoHeader courseRow,
                                 RowNoHeader titleRow,
                                 int offset)
        {
            Group group = new Group();

            parseTitle(group, titleRow[offset]);
            group.Course = courseRow[offset];
            group.Year   = 2015;
            return(group);
        }
コード例 #14
0
        private void parseTitle(Group group, string titleRow)
        {
            var match       = _regex.Match(titleRow);
            var matchGroups = match.Groups;

            if (matchGroups.Count >= 3)
            {
                group.Name              = matchGroups[1].Value;
                group.Budget_students   = Convert.ToInt32(matchGroups[2].Value);
                group.Contract_students = Convert.ToInt32(matchGroups[3].Value);
            }
        }
コード例 #15
0
        private ModuleStudyAction _getItem(
            string actionName, int hours,
            Group group, Module module)
        {
            ModuleStudyAction result = new ModuleStudyAction();

            result.Group        = group;
            result.StudyActions = getStudyAction(actionName);
            result.Module       = module;
            result.Hours        = hours;
            result.Year         = Global.yearStr;
            return(result);
        }
コード例 #16
0
        ModuleStudyAction _doZALIK(Group group, Module module)
        {
            ModuleStudyAction result = null;

            if (module.ZALIK != null)
            {
                // String like "(%d)(д)", i.e. "1", "8", "4д"
                var capture = Regex.Match(module.ZALIK, @"\d+");
                if (capture.Success)
                {
                    int value = Convert.ToInt32(capture.Value);
                    result = _getItem("Заліки", value, group, module);
                }
            }
            return(result);
        }
コード例 #17
0
        /// <summary>
        /// Generate ModuleStudyAction from given data
        /// </summary>
        private ModuleStudyAction GetModuleStudyAction(Module module,
                                                       Group group,
                                                       bool failSilently = false)
        {
            ModuleStudyAction _m     = null;
            GroupWrapper      _group = group as GroupWrapper;

            if (_group == null && !failSilently)
            {
                //throw new ArgumentException("Group has wrong type");
            }
            else
            {
                _m.Group = group;
            }
            return(_m);
        }
コード例 #18
0
 public bool IsValid(Group group)
 {
     return(_regex.IsMatch(group.Name));
 }