示例#1
0
        public async Task <IActionResult> Course(int id)
        {
            try
            {
                var result = await udal.GetCourse(id);

                if (result != null)
                {
                    return(Ok(new { status = true, result }));
                }
                else
                {
                    return(NotFound(new { status = false, message = "No record found!" }));
                }
            }
            catch (ExternalException e)
            {
                return(BadRequest(new { status = false, message = e.Message }));
            }
        }
示例#2
0
 /// <summary>
 /// 判断是否存在科目
 /// </summary>
 /// <param name="courseName">科目名称</param>
 /// <returns>bool类型,不存在返回true,存在返回false值</returns>
 public static bool GetCourse(string courseName)
 {
     return(course.GetCourse(courseName));
 }
示例#3
0
        public CourseEntity GetCourse(string curso, string area)
        {
            CourseDal courseDal = new CourseDal();

            return(courseDal.GetCourse(curso, area));
        }