Exemple #1
0
        public static AwardingBody GetAwardingBody(int id, string language)
        {
            var           request  = AppServices.CreateNonAuthorizedRequest(Method.GET);
            string        finalUrl = $"{AppServices.BaseUri}awardingbodies/{language}/{id}";
            var           client   = new RestClient($"{finalUrl}");
            IRestResponse response = client.Execute(request);

            if (response.IsSuccessful)
            {
                return(JsonConvert.DeserializeObject <AwardingBody>(response.Content));
            }
            return(null);
            //return (new AwardingBody { Id = 1, ActiveLanguage = new AwardingBodyLanguage() { AwardingBodyId = 1, Name = "Υπουργείο Οικονομίας, Υποδομών, Ναυτιλίας και Τουρισμού - Ανώτερη Σχολή Τουριστικής Εκπαίδευσης Ρόδο" } });
        }
Exemple #2
0
        public static QualificationType GetQualificationType(int id, string language)
        {
            var           request  = AppServices.CreateNonAuthorizedRequest(Method.GET);
            string        finalUrl = $"{AppServices.BaseUri}qualificationtype/{language}/{id}";
            var           client   = new RestClient($"{finalUrl}");
            IRestResponse response = client.Execute(request);

            if (response.IsSuccessful)
            {
                return(JsonConvert.DeserializeObject <QualificationType>(response.Content));
            }
            return(null);
//            return (new QualificationType { Id = 3, EducationalLevel = new EducationalLevel() { Id = 3, LevelId = 53, EQFLevel = 28 }, ActiveLanguage = new QualificationTypeLanguage() { QualificationTypeId = 53, Name = "Απολυτήριο Επαγγελματικού Λυκείου (ΕΠΑ.Λ.)" } });
        }
Exemple #3
0
        public static EducationalSector GetEducationalSector(int id, string language)
        {
            var           request  = AppServices.CreateNonAuthorizedRequest(Method.GET);
            string        finalUrl = $"{AppServices.BaseUri}sector/{language}/{id}";
            var           client   = new RestClient($"{finalUrl}");
            IRestResponse response = client.Execute(request);

            if (response.IsSuccessful)
            {
                return(JsonConvert.DeserializeObject <EducationalSector>(response.Content));
            }

            return(null);
        }
Exemple #4
0
        public static Qualification GetQualification(int id, string language)
        {
            var           request  = AppServices.CreateNonAuthorizedRequest(Method.GET);
            string        finalUrl = $"{AppServices.BaseUri}qualifications/{language}/{id}";
            var           client   = new RestClient($"{finalUrl}");
            IRestResponse response = client.Execute(request);

            if (response.IsSuccessful)
            {
                return(JsonConvert.DeserializeObject <Qualification>(response.Content));
            }
            return(null);
            //            return (new Qualification() { Id = 1, QualificationTypeId = 61, EducationalLevelId = 2, EducationalLevel = new EducationalLevel() { Id = 28, EQFLevel = 4, LevelId = 4 } });
        }
Exemple #5
0
        public static EducationalLevel GetEducationalLevel(int id, string language)
        {
            var           request  = AppServices.CreateNonAuthorizedRequest(Method.GET);
            string        finalUrl = $"{AppServices.BaseUri}educationallevel/{language}/{id}";
            var           client   = new RestClient($"{finalUrl}");
            IRestResponse response = client.Execute(request);

            if (response.IsSuccessful)
            {
                var level = JsonConvert.DeserializeObject <EducationalLevel>(response.Content);
                return(level);
            }
            return(null);
//           return (new EducationalLevel { Id = 1, EQFLevel = 1, LevelId = 1, ActiveLanguage = new EducationalLevelLanguage() { Name = "name1", Skills = "skills1", Knowledge = "know1", Competence = "comp1" } });
        }
Exemple #6
0
        public static IList <EducationalSector> GetEducationalSectors(string language)
        {
            try
            {
                var request  = AppServices.CreateNonAuthorizedRequest(Method.GET);
                var finalUri = $"{AppServices.BaseUri}sector/{language}";

                var           client   = new RestClient(finalUri);
                IRestResponse response = client.Execute(request);
                if (response.IsSuccessful || response.StatusCode == System.Net.HttpStatusCode.OK)
                {
                    var categories = JsonConvert.DeserializeObject <IList <EducationalSector> >(response.Content);
                    return(categories);
                }

                return(new List <EducationalSector>());
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Exemple #7
0
        public static IList <Qualification> GetQualificationsByCriteria(string language, int?levelId, int?bodyId,
                                                                        int?sectorId, int?typeId, string text)
        {
            var queryString = "?";

            if (levelId != null && Convert.ToInt32(levelId) > 0)
            {
                if (queryString.Length > 1)
                {
                    queryString += $"&levelId={Convert.ToInt32(levelId)}";
                }
                else
                {
                    queryString += $"levelId={Convert.ToInt32(levelId)}";
                }
            }
            if (bodyId != null && Convert.ToInt32(bodyId) > 0)
            {
                if (queryString.Length > 1)
                {
                    queryString += $"&bodyId={Convert.ToInt32(bodyId)}";
                }
                else
                {
                    queryString += $"bodyId={Convert.ToInt32(bodyId)}";
                }
            }

            if (sectorId != null && Convert.ToInt32(sectorId) > 0)
            {
                if (queryString.Length > 1)
                {
                    queryString += $"&sectorId={Convert.ToInt32(sectorId)}";
                }
                else
                {
                    queryString += $"sectorId={Convert.ToInt32(sectorId)}";
                }
            }

            if (typeId != null && Convert.ToInt32(typeId) > 0)
            {
                if (queryString.Length > 1)
                {
                    queryString += $"&typeId={Convert.ToInt32(typeId)}";
                }
                else
                {
                    queryString += $"typeId={Convert.ToInt32(typeId)}";
                }
            }

            if (!string.IsNullOrEmpty(text))
            {
                if (queryString.Length > 1)
                {
                    queryString += $"&text={text}";
                }
                else
                {
                    queryString += $"text={text}";
                }
            }

            var           request  = AppServices.CreateNonAuthorizedRequest(Method.GET);
            string        finalUrl = $"{AppServices.BaseUri}qualifications/filter/{language}{queryString}";
            var           client   = new RestClient($"{finalUrl}");
            IRestResponse response = client.Execute(request);

            if (response.IsSuccessful)
            {
                return(JsonConvert.DeserializeObject <IList <Qualification> >(response.Content));
            }
            return(null);
            //            return (new Qualification() { Id = 1, QualificationTypeId = 61, EducationalLevelId = 2, EducationalLevel = new EducationalLevel() { Id = 28, EQFLevel = 4, LevelId = 4 } });
        }