Exemplo n.º 1
0
        internal static CourseHeader GetCourseHeader(string courseNumber, ApiManagerCredentials credentials)
        {
            try
            {
                var service = new ASA.Apim.Library.CourseHeader_Service.CourseHeader_Service()
                {
                    ApiCredentials = credentials
                };

                var courseHeader = service.Read(courseNumber);
                service.Dispose();
                return(courseHeader);
            }
            catch (Exception exception)
            {
                Services.LogService.Error("Fejl i forespørgelse af kursus.", exception);
                return(null);
            }
        }
Exemplo n.º 2
0
        internal static IEnumerable <CourseHeader> GetCourseHeaders(CourseHeader_Filter[] filter, ApiManagerCredentials credentials, int size)
        {
            try
            {
                var service = new ASA.Apim.Library.CourseHeader_Service.CourseHeader_Service()
                {
                    ApiCredentials = credentials
                };

                var list = service.ReadMultiple(filter, "", size).ToList();
                service.Dispose();
                return(list);
            }
            catch (Exception exception)
            {
                Services.LogService.Error("Fejl i forespørgelse af kurser.", exception);
                return(new List <CourseHeader>());
            }
        }