Пример #1
0
        public JsonResult SelectDropdown_CourseType(string ID = "", string Discipline_ID = "", string ProgramLevel_Id = "", string Qualification_ID = "", string Type = "", string CourseOfStudy_ID = "", string InstituteType = "", string InstituteID = "", string GenderRestrictions = "")
        {
            NICHE             objRep      = new NICHE();
            DataSet           ds          = objRep.sp_Select_tbl_InstituteCourse_Niche_Search(ID, Discipline_ID, "0", "0", "DropDown_List_Type", "0", "0", "", "0");
            List <CourseType> _CourseType = new List <CourseType>();

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        CourseType _obj = new CourseType();
                        _obj.Id    = (row["Id"].ToString());
                        _obj.Value = row["Value"].ToString();
                        _CourseType.Add(_obj);
                    }
                }
            }
            string Code = string.Empty, Message = string.Empty;

            return(Json(new
            {
                List = _CourseType,
                c = Code,
                m = Message
            },
                        JsonRequestBehavior.AllowGet
                        ));
            //ViewBag.DesciplineNiche = _CourseType;
        }
Пример #2
0
 public Developer(int employeeID, string employeeName, bool haveAccess, CourseType typeOfCourse)
 {
     EmplayeeID   = employeeID;
     EmployeeName = employeeName;
     HaveAccessForOnlineLearning = haveAccess;
     TypeOfCourse = typeOfCourse;
 }
        private async Task <InstructorCourse> CreateCourseAsync(string instructorId,
                                                                string name,
                                                                string description,
                                                                string imageUri,
                                                                string about,
                                                                TimeSpan duration,
                                                                string[] skillsDescription,
                                                                CourseType courseType)
        {
            // create course
            var course = new Course(skillsDescription.Count());

            course.ImageUri   = imageUri;
            course.Name       = name;
            course.Descripton = description;
            course.About      = about;
            course.Duration   = duration;
            course.Type       = courseType;
            await AddAndSaveAsync(course);

            var instructorCourse = new InstructorCourse(course.Id, instructorId);

            await AddAndSaveAsync(instructorCourse);

            return(instructorCourse);
        }
Пример #4
0
        /// <summary>
        /// 校验年龄段交叉
        /// <para>作    者:zhiwei.Tang</para>
        /// <para>创建时间:2018-09-14</para>
        /// </summary>
        /// <param name="ageGroups">待校验的年龄段数据</param>
        /// <param name="courseType">课程类别</param>
        /// <param name="companyId">公司编号</param>
        /// <param name="courseId">课程Id 添加时可空,编辑时传入</param>
        private static void VerifyAgeCross(List <AgeGroup> ageGroups, CourseType courseType, string companyId, long?courseId = null)
        {
            if (ageGroups == null || ageGroups.Count == 0)
            {
                return;
            }

            //必修课所有时间段不允许交叉
            //选修课课程级别内时间段不允许
            if (courseType == CourseType.Compulsory)
            {
                var compulsorys = new TblDatCourseRepository().GetByCourseType(companyId, (int)CourseType.Compulsory, courseId).Result;
                if (compulsorys.Any())
                {
                    var courseIds = compulsorys.Select(x => x.CourseId);
                    var ages      = new TblDatCourseLevelMiddleRepository()
                                    .GetByCourseId(courseIds)
                                    .Result
                                    .Select(x => new AgeGroup
                    {
                        MinAge = x.BeginAge,
                        MaxAge = x.EndAge
                    });

                    ageGroups.AddRange(ages);
                }
            }
            //校验
            CrossCalc(ageGroups);
        }
Пример #5
0
        public override string ToString()
        {
            StringBuilder result = new StringBuilder();

            result.Append(Id.ToString());
            result.Append("|");
            result.Append(CourseCode.ToString());
            result.Append("|");
            result.Append(CourseName.ToString());
            result.Append("|");
            result.Append(Ects.ToString());
            result.Append("|");
            result.Append(CourseType.ToString());
            result.Append("|");
            result.Append(Zzu.ToString());
            result.Append("|");
            result.Append(SemesterNumber.ToString());
            result.Append("|");
            result.Append(StudyPlanID.ToString());
            result.Append("|");
            result.Append(CoursesGroupID.ToString());
            result.Append("|");
            result.Append(IsCoursesGroup.ToString());
            return(result.ToString());
        }
        internal static List <DeliveryMode> MapToDeliveryModes(this CourseType courseTypes)
        {
            var result = new List <DeliveryMode>();

            switch (courseTypes)
            {
            case CourseType.ClassroomBased:
                result.Add(DeliveryMode.ClassroomBased);
                break;

            case CourseType.Online:
                result.Add(DeliveryMode.Online);
                break;

            case CourseType.WorkBased:
                result.Add(DeliveryMode.WorkBased);
                break;

            case CourseType.All:
            default:
                result.Add(DeliveryMode.ClassroomBased);
                result.Add(DeliveryMode.WorkBased);
                result.Add(DeliveryMode.Online);
                result.Add(DeliveryMode.Undefined);
                break;
            }

            return(result.Distinct().ToList());
        }
Пример #7
0
        public void AssCourseStudenttOutput()
        {
            string splGetAssPerCoursePerStudent = "SELECT  Firstname, Lastname, Stream, CourseType, Description FROM Student " +
                                                  "INNER JOIN CourseStudent ON Student.Student_ID = CourseStudent.Student_ID " +
                                                  "INNER JOIN Course ON CourseStudent.CourseTitle = Course.CourseTitle " +
                                                  "INNER JOIN Assignment ON Course.CourseTitle = Assignment.CourseTitleA " +
                                                  "ORDER BY Firstname, Lastname;";

            try
            {
                using (SqlConnection conn = new SqlConnection(ConnectionString.connection))
                {
                    conn.Open();

                    using (SqlCommand cmSelectAssCourseStudent = new SqlCommand(splGetAssPerCoursePerStudent, conn))
                    {
                        using (SqlDataReader drAssCourseStudent = cmSelectAssCourseStudent.ExecuteReader())
                        {
                            Console.ForegroundColor = ConsoleColor.DarkMagenta;
                            Console.WriteLine("----------------------------------------------------------------------------");
                            Console.WriteLine($"| {"FIRSTNAME",-12} | {"LASTNAME",-12} | {"COURSE PARTICIPATING",-23} | {"ASSIGNMENTS",-16} |");
                            Console.WriteLine("----------------------------------------------------------------------------");
                            Console.WriteLine("----------------------------------------------------------------------------");
                            Console.ForegroundColor = ConsoleColor.White;

                            while (drAssCourseStudent.Read())
                            {
                                FirstName   = drAssCourseStudent["FirstName"].ToString();
                                LastName    = drAssCourseStudent["LastName"].ToString();
                                Stream      = drAssCourseStudent["Stream"].ToString();
                                CourseType  = drAssCourseStudent["CourseType"].ToString();
                                Description = drAssCourseStudent["Description"].ToString();

                                // Remove the unessessary empty space characters from inserted strings
                                FirstName   = FirstName.Replace(" ", string.Empty);
                                LastName    = LastName.Replace(" ", string.Empty);
                                Stream      = Stream.Replace(" ", string.Empty);
                                CourseType  = CourseType.Replace(" ", string.Empty);
                                Description = Description.Replace(" ", string.Empty);

                                Console.ForegroundColor = ConsoleColor.Magenta;
                                Console.WriteLine($"| {FirstName,-12} | {LastName,-12} | {Stream,-10} | {CourseType,-10} |{Description,-17} |");
                                Console.WriteLine("----------------------------------------------------------------------------");
                                Console.ForegroundColor = ConsoleColor.White;
                            }

                            Console.ForegroundColor = ConsoleColor.DarkMagenta;
                            Console.WriteLine("----------------------------------------------------------------------------");
                            Console.WriteLine($"| {"FIRSTNAME",-12} | {"LASTNAME",-12} | {"COURSE PARTICIPATING",-23} | {"ASSIGNMENTS",-16} |");
                            Console.WriteLine("----------------------------------------------------------------------------");
                            Console.ForegroundColor = ConsoleColor.White;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #8
0
 public Course(int semester, string name, int numberOfClasses, CourseType type)
 {
     Semester        = semester;
     Name            = name;
     NumberOfClasses = numberOfClasses;
     Type            = type;
 }
Пример #9
0
 public Course(string courseID, string courseName, int credits, CourseType courseType)
 {
     _courseID       = courseID;
     _courseName     = courseName;
     _credits        = credits;
     this.courseType = courseType;
 }
        public async Task <IActionResult> PutCourseType([FromRoute] int id, [FromBody] CourseType courseType)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != courseType.ID)
            {
                return(BadRequest());
            }

            _context.Entry(courseType).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CourseTypeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #11
0
        public void CourseSelectOutput()
        {
            string splGetCourse = "SELECT * FROM Course";

            try
            {
                using (SqlConnection conn = new SqlConnection(ConnectionString.connection))
                {
                    conn.Open();

                    using (SqlCommand cmSelectCourse = new SqlCommand(splGetCourse, conn))
                    {
                        using (SqlDataReader drCourse = cmSelectCourse.ExecuteReader())
                        {
                            Console.ForegroundColor = ConsoleColor.DarkMagenta;
                            Console.WriteLine("----------------------------------------------------------------------------");
                            Console.WriteLine($"| {"TITLE",-8} | {"STREAM",-12} | {"COURSE",-14} | {"START DATE",-13} | {"END DATE",-13} |");
                            Console.WriteLine("----------------------------------------------------------------------------");
                            Console.WriteLine("----------------------------------------------------------------------------");
                            Console.ForegroundColor = ConsoleColor.White;

                            while (drCourse.Read())
                            {
                                CourseTitle = drCourse["CourseTitle"].ToString();
                                Stream      = drCourse["Stream"].ToString();
                                CourseType  = drCourse["CourseType"].ToString();
                                StartDate   = drCourse["StartDate"].ToString();
                                EndDate     = drCourse["EndDate"].ToString();

                                // Split the DATE string so as to get rid of the Time
                                string[] StartDateList = StartDate.Split(' ');
                                string[] EndDateList   = EndDate.Split(' ');

                                // Remove the unessessary empty space characters from inserted strings
                                CourseTitle = CourseTitle.Replace(" ", string.Empty);
                                Stream      = Stream.Replace(" ", string.Empty);
                                CourseType  = CourseType.Replace(" ", string.Empty);
                                StartDate   = StartDate.Replace(" ", string.Empty);
                                EndDate     = EndDate.Replace(" ", string.Empty);

                                Console.ForegroundColor = ConsoleColor.Magenta;
                                Console.WriteLine($"| {CourseTitle,-8} | {Stream,-12} | {CourseType,-14} | {StartDateList[0],-13} | {EndDateList[0],-13} |");
                                Console.WriteLine("----------------------------------------------------------------------------");
                                Console.ForegroundColor = ConsoleColor.White;
                            }

                            Console.ForegroundColor = ConsoleColor.DarkMagenta;
                            Console.WriteLine("----------------------------------------------------------------------------");
                            Console.WriteLine($"| {"TITLE",-8} | {"STREAM",-12} | {"COURSE",-14} | {"START DATE",-13} | {"END DATE",-13} |");
                            Console.WriteLine("----------------------------------------------------------------------------");
                            Console.ForegroundColor = ConsoleColor.White;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #12
0
        //Course Type Details
        public CourseType GetCourseType(int id)
        {
            var courseType = new CourseType();

            try
            {
                using (var sqlconnection = new SqlConnection(ConfigurationManager.ConnectionStrings["InstCon"].ConnectionString))
                {
                    sqlconnection.Open();
                    SqlCommand cmd = new SqlCommand("GetCourseType", sqlconnection);
                    cmd.Parameters.Add(new SqlParameter("@CourseTypeId", id));
                    cmd.CommandType = CommandType.StoredProcedure;
                    SqlDataReader sdr = cmd.ExecuteReader();
                    if (sdr.HasRows)
                    {
                        while (sdr.Read())
                        {
                            courseType.CourseTypeName = sdr["CourseTypeName"].ToString();
                        }
                    }
                    sqlconnection.Close();
                }
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
            }
            return(courseType);
        }
Пример #13
0
        public IList <CourseType> GetAllCourseType()
        {
            List <CourseType> courseTypes = new List <CourseType>();

            try
            {
                using (var sqlconnection = new SqlConnection(ConfigurationManager.ConnectionStrings["InstCon"].ConnectionString))
                {
                    sqlconnection.Open();
                    SqlCommand cmd = new SqlCommand("GetCouseType", sqlconnection);
                    cmd.CommandType = CommandType.StoredProcedure;
                    SqlDataReader sdr = cmd.ExecuteReader();
                    if (sdr.HasRows)
                    {
                        while (sdr.Read())
                        {
                            var course = new CourseType();
                            course.CourseTypeName = sdr["CourseTypeName"].ToString();
                            course.CourseTypeId   = Convert.ToInt32(sdr["CourseTypeID"]);
                            courseTypes.Add(course);
                        }
                    }
                    sqlconnection.Close();
                }
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
            }
            return(courseTypes.ToList());
        }
Пример #14
0
 public Course(string ID, string name, string description, string externalLink, int weight,
               SuccessObjectiveClassifier classifier, string courseID, CourseType type)
     : base(ID, name, description, externalLink, weight, classifier)
 {
     CourseID = courseID;
     Type     = type;
 }
Пример #15
0
 private void ValidateCourseType(CourseType courseType)
 {
     if (courseType == null)
     {
         throw new ArgumentNullException("courseType");
     }
 }
Пример #16
0
 private static void fieldOfStudyType(Document doc, CourseType Type)
 {
     doc.Add(new Paragraph("Forma Studiów: ".ToUpper())
             .Add(new Paragraph(EnumTranslator.Translate(Type.ToString()))
                  .SetTextAlignment(iText.Layout.Properties.TextAlignment.RIGHT))
             .SetFixedLeading(0.5f));
 }
Пример #17
0
 public GroupInfo(int groupNum, int subGroupNum, int courseNum, CourseType courseType)
 {
     GroupNum    = groupNum;
     SubGroupNum = subGroupNum;
     CourseNum   = courseNum;
     CourseType  = courseType;
 }
Пример #18
0
        /// <summary>
        /// Calculates the GPA of a given student.
        /// </summary>
        /// <param name="studentId"></param>
        /// <returns></returns>
        private double calculateGPA(int studentId)
        {
            IQueryable <Registration> coursesGraded = from results
                                                      in db.Registrations
                                                      where results.Grade != null
                                                      where results.StudentId == studentId
                                                      select results;

            double?grades;
            string courseType;
            double gpv;
            double creditHours;
            double totalProduct     = 0;
            double totalCreditHours = 0;

            foreach (Registration courseGrade in coursesGraded)
            {
                creditHours = courseGrade.course.CreditHours;
                courseType  = courseGrade.course.CourseType;
                if (courseType != "Audit")
                {
                    grades = courseGrade.Grade;
                    CourseType courseTypeLookup = BusinessRules.courseTypeLookup(courseType);
                    double     gradesValue      = (double)grades;
                    gpv = BusinessRules.gradeLookup(gradesValue, courseTypeLookup);
                    double product = gpv * creditHours;
                    totalProduct     += product;
                    totalCreditHours += creditHours;
                }
            }

            double gpa = totalProduct / totalCreditHours;

            return(gpa);
        }
Пример #19
0
        public static string ToHtmlHeader(CourseType courseType)
        {
            const string cellTemplate = "<div class=\"cell\">{0}</div>\r\n";

            var cellsContent = string.Format(cellTemplate, "תקופה");

            cellsContent += string.Format(cellTemplate, "חודש");
            if (courseType != CourseType.None)
            {
                cellsContent += string.Format(cellTemplate, "ריבית חודש");
                cellsContent += string.Format(cellTemplate, "ריבית שנה");
            }

            cellsContent += string.Format(cellTemplate, "ריבית");
            cellsContent += string.Format(cellTemplate, "קרן");
            if (PriceIndexCourses.Contains(courseType))
            {
                cellsContent += string.Format(cellTemplate, "קרן צמודה");
            }

            cellsContent += string.Format(cellTemplate, "יתרת קרן");
            if (PriceIndexCourses.Contains(courseType))
            {
                cellsContent += string.Format(cellTemplate, "יתרת קרן צמודה");
            }

            cellsContent += string.Format(cellTemplate, "תשלום חודשי");
            var result = $"<div class=\"row header green\">\r\n{cellsContent.Trim()}\r\n</div>\r\n";

            return(result);
        }
Пример #20
0
        /// <summary>
        /// Method for creating course.
        /// </summary>
        /// <param name="courseType">Type of course(Corporate,Online,Offline).</param>
        /// <param name="platform">Type of platform(.Net,Java,Angular).</param>
        /// <returns>ICourse.</returns>
        public static ICourse CreateCourse(CourseType courseType, DeveloperPlatform platform)
        {
            AbstractCourseFactory courseFactory = null;

            switch (courseType)
            {
            case CourseType.Online:
                courseFactory = new OnlineCourseFactoryVersion2();
                break;

            case CourseType.Offline:
                courseFactory = new OfflineCourseFactory();
                break;

            case CourseType.Corporate:
                courseFactory = new CorporateCourseFactory();
                break;

            default:
                courseFactory = null;
                break;
            }
            if (courseFactory != null)
            {
                return(courseFactory.CreateCourse(platform));
            }
            else
            {
                return(null);
            }
        }
Пример #21
0
        public IList <Course> SelectCoursesOrderBySelectCount(CourseType courseType, int size)
        {
            string sql = " select top @size " + BaseInfo
                         + " from (select course_id, COUNT(*) as c from Course_choosing group by course_id) as Id_C(course_id,c),Course c "
                         + " where Id_C.course_id=c.course_id and course_type = @course_type "
                         + " order by Id_c.c desc ";
            string courseTypeDesc = CourseTypeUtils.GetInfo(courseType);//获取课程类型的中文表示(字段上的注解)

            SqlParameter[] parameters =
            {
                new SqlParameter("@size",        size),
                new SqlParameter("@course_type", courseTypeDesc)
            };

            //查询
            DataTable dataTable = DBUtils.getDBUtils().getRecords(sql, parameters);
            //存放结果
            IList <Course> courseList = new List <Course>();

            //遍历
            foreach (DataRow dataRow in dataTable.Rows)
            {
                //public const string BaseInfo = "course_id,course_name,course_credit,course_hour,college_id ";

                Course course = new Course();
                course.course_id     = dataRow["course_id"].ToString();
                course.course_name   = dataRow["course_name"].ToString();
                course.course_credit = decimal.Parse(dataRow["course_credit"].ToString());
                course.course_hour   = dataRow["course_hour"].ToString();
                course.college_id    = dataRow["college_id"].ToString();
                courseList.Add(course);
            }
            return(courseList);
        }
Пример #22
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] CourseType courseType)
        {
            if (id != courseType.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(courseType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CourseTypeExists(courseType.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(courseType));
        }
Пример #23
0
        public IList <Course> SelectCoursesOrderByDate(CourseType courseType, int size)
        {
            string sql = "SELECT TOP @size  " + BaseInfo + " from Course "
                         + "where course_type = @course_type and status='1' order by course_id ";
            string courseTypeDesc = CourseTypeUtils.GetInfo(courseType);//获取课程类型的中文表示(字段上的注解)

            SqlParameter[] parameters =
            {
                new SqlParameter("@size",        size),
                new SqlParameter("@course_type", courseTypeDesc)
            };

            //查询
            DataTable dataTable = DBUtils.getDBUtils().getRecords(sql, parameters);
            //存放结果
            IList <Course> courseList = new List <Course>();

            //遍历
            foreach (DataRow dataRow in dataTable.Rows)
            {
                //public const string BaseInfo = "course_id,course_name,course_credit,course_hour,college_id ";

                Course course = new Course();
                course.course_id     = dataRow["course_id"].ToString();
                course.course_name   = dataRow["course_name"].ToString();
                course.course_credit = decimal.Parse(dataRow["course_credit"].ToString());
                course.course_hour   = dataRow["course_hour"].ToString();
                course.college_id    = dataRow["college_id"].ToString();
                courseList.Add(course);
            }
            return(courseList);
        }
Пример #24
0
        protected CourseTypeDto GetCourseTypeDto(CourseType courseType)
        {
            var courseTypeDto = Mapper.Map <CourseType, CourseTypeDto>(courseType);

            courseTypeDto.Url = UrlResoucesUtil.GetBaseUrl(Request, "CourseTypes") + courseType.Id;
            return(courseTypeDto);
        }
Пример #25
0
        public static string GetCourseTitle(CourseType courseType)
        {
            switch (courseType)
            {
            case CourseType.None:
                return("(כל המסלולים)");

            case CourseType.Fix:
                return("ריבית קבועה - לא צמודה");

            case CourseType.FixPriceIndex:
                return("ריבית קבועה - צמודה למדד");

            case CourseType.Prime:
                return("ריבית משתנה פריים");

            case CourseType.Variable:
                return("ריבית משתנה (כל 5) - לא צמודה");

            case CourseType.VariablePriceIndex:
                return("ריבית משתנה (כל 5) - צמודה למדד");

            default:
                return(string.Empty);
            }
        }
Пример #26
0
        public string ToHtml(CourseType courseType)
        {
            const string cellTemplate = "<div class=\"cell\">{0}</div>\r\n";
            var          cellsContent = string.Format(cellTemplate, Period);

            cellsContent += string.Format(cellTemplate, PeriodDate.ToString("MM/yyyy"));
            if (courseType != CourseType.None)
            {
                cellsContent += string.Format(cellTemplate, InterestMonthPercentage.ToString("N4") + "%");
                cellsContent += string.Format(cellTemplate, InterestYearPercentage.ToString("N2") + "%");
            }

            cellsContent += string.Format(cellTemplate, InterestPayment.ToString("N0"));
            cellsContent += string.Format(cellTemplate, FundPayment.ToString("N0"));
            if (PriceIndexCourses.Contains(courseType))
            {
                cellsContent += string.Format(cellTemplate, FundPaymentWithPriceIndex.ToString("N0"));
            }

            cellsContent += string.Format(cellTemplate, TotalFund.ToString("N0"));
            if (PriceIndexCourses.Contains(courseType))
            {
                cellsContent += string.Format(cellTemplate, TotalFundWithPriceIndex.ToString("N0"));
            }

            var paymentTemplate = cellTemplate.Replace("class=\"cell\"", "class=\"cell payment_green\"");

            cellsContent += string.Format(paymentTemplate, "₪" + TotalPayment.ToString("N0"));
            var result = $"<div class=\"row\">\r\n{cellsContent.Trim()}\r\n</div>\r\n";

            return(result);
        }
        public static CourseSiteBuilder Build(CourseType courseType, Course course = null)
        {
            var result = new CourseSiteBuilder();

            switch (courseType)
            {
            case CourseType.NewUnpublished:
            {
                result.Unpublished().WithNewStatus();
                break;
            }

            case CourseType.NewPublished:
            {
                result.Published().WithNewStatus();
                break;
            }

            case CourseType.SuspensedUnpublished:
            {
                result.Unpublished().WithSuspensedStatus();
                break;
            }

            case CourseType.SuspensedPublished:
            {
                result.Published().WithSuspensedStatus();
                break;
            }

            case CourseType.RunningUnpublished:
            {
                result.Unpublished().WithRunningStatus();
                break;
            }

            case CourseType.RunningPublished:
            {
                result.Published().WithRunningStatus();
                break;
            }

            case CourseType.DiscontinuedUnpublished:
            {
                result.Unpublished().WithDiscontinuedStatus();
                break;
            }

            case CourseType.DiscontinuedPublished:
            {
                result.Published().WithDiscontinuedStatus();
                break;
            }
            }

            result._courseSite.Site = course?.Provider?.Sites?.FirstOrDefault();

            return(result);
        }
Пример #28
0
        public static string sql_DeleteCourseClassByType(CourseType type)
        {
            string sql = $@"delete from CourseInfoClass  
                            from CourseInfo as ci
                            where ci.CourseType = {(int)type} and CourseInfoClass.CourseCode = ci.Code";

            return(sql);
        }
Пример #29
0
 public static CourseTypeViewModel Map(CourseType courseType)
 {
     return(new CourseTypeViewModel
     {
         Id = courseType.Id,
         Name = courseType.Name,
     });
 }
Пример #30
0
        public ActionResult DeleteConfirmed(int id)
        {
            CourseType courseType = db.CourseTypes.Find(id);

            db.CourseTypes.Remove(courseType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #31
0
 private async void SelectExercise(CourseType type)
 {
     App.ViewModel.CourseType = type;
     await App.ViewModel.PerformTimeConsumingProcess(this, "Loading exercises...", 
         async () => await App.ViewModel.LoadExercises(new List<int>()));
     if (App.ViewModel.Solutions.Count <= 0) return;
     await App.ViewModel.LoadSubjectModules();
     (Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri(string.Format("/ModuleSelection.xaml?courseName={0}", CourseName.Text), UriKind.Relative));
 }
        private async Task SelectExercise(CourseType type, IEnumerable<int> selectedModuleIdList)
        {
            await App.ViewModel.PerformTimeConsumingProcess(this, "Loading exercises...",
                async () => await App.ViewModel.LoadExercises(selectedModuleIdList));
            if (App.ViewModel.Solutions.Count <= 0) return;

            if (App.ViewModel.CourseType == CourseType.Time)
            {
                App.ViewModel.Timer = new DTimer();
                var timer = App.ViewModel.Timer;
                if (!timer.IsEnabled())
                {
                    timer.HandleTick += App.ViewModel.TimerModeTickHandler;
                    timer.Start(1, 20);
                }
            }
        }
Пример #33
0
 public CourseFilter(CourseType course)
 {
     _course = course;
 }
 private Room()
 {
     Name = "none";
     Type = CourseType.NormalCourse;
 }
 public Room(string aName, CourseType aType)
 {
     Name = aName;
     Type = aType;
 }
Пример #36
0
 private async void NavigateToModuleSelectionPage(CourseType courseType)
 {
     App.ViewModel.CourseType = courseType;
     await App.ViewModel.LoadSubjectModules();
     (Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri(string.Format("/ModuleSelection.xaml?courseName={0}&courseType={1}", CourseName.Text, courseType), UriKind.Relative));
 }
 public Course(string aName, Professor aProf, CourseType aType)
 {
     Name = aName;
     Professor = aProf;
     CourseType = aType;
 }