示例#1
0
        public static IList <EducationalLevel> GetEducationalLevels(string language)
        {
            try
            {
                var request  = AppServices.CreateNonAuthorizedRequest(Method.GET);
                var finalUri = $"{AppServices.BaseUri}educationallevel/{language}";

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

                return(new List <EducationalLevel>());

//                var edLevels = new List<EducationalLevel>();
//                edLevels.Add(new EducationalLevel { Id = 1, EQFLevel = 1, LevelId = 1,ActiveLanguage=new EducationalLevelLanguage() { Name="name1",Skills="skills1",Knowledge="know1",Competence="comp1"} });
//                edLevels.Add(new EducationalLevel { Id = 2, EQFLevel = 2, LevelId = 2 });
//                edLevels.Add(new EducationalLevel { Id = 3, EQFLevel = 3, LevelId = 3 });
//                return edLevels;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
示例#2
0
        public static IList <AwardingBody> GetAwardingBodies(string language)
        {
            try
            {
                var request  = AppServices.CreateNonAuthorizedRequest(Method.GET);
                var finalUri = $"{AppServices.BaseUri}awardingbodies/{language}";

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

                return(new List <AwardingBody>());
//                var awBodies = new List<AwardingBody>();
//                awBodies.Add(new AwardingBody { Id = 1, ActiveLanguage = new AwardingBodyLanguage() { AwardingBodyId=1, Name = "Υπουργείο Οικονομίας, Υποδομών, Ναυτιλίας και Τουρισμού - Ανώτερη Σχολή Τουριστικής Εκπαίδευσης Ρόδο"} });
//                awBodies.Add(new AwardingBody { Id = 2, ActiveLanguage = new AwardingBodyLanguage() { AwardingBodyId = 1, Name = "Υπουργείο Οικονομίας, Υποδομών, Ναυτιλίας και Τουρισμού - Ανώτερη Σχολή Τουριστικής Εκπαίδευσης Κρήτ" } });
//                awBodies.Add(new AwardingBody { Id = 3, ActiveLanguage = new AwardingBodyLanguage() { AwardingBodyId = 1, Name = "ΠΥΡΟΣΒΕΣΤΙΚΗ ΑΚΑΔΗΜΙΑ:  α. Σχολή Ανθυποπυραγών. β. Σχολή Αρχιπυροσβεστών. γ. Σχολή Πυροσβεστών. δ. Σ" } });
//                return awBodies;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
示例#3
0
        public static IList <QualificationType> GetQualificationTypes(string language)
        {
            try
            {
                var request  = AppServices.CreateNonAuthorizedRequest(Method.GET);
                var finalUri = $"{AppServices.BaseUri}qualificationtype/{language}";

                var client = new RestClient(finalUri);
                //var client = new RestClient($"{AppServices.BaseUri}/{finalUri}");
                IRestResponse response = client.Execute(request);
                if (response.IsSuccessful || response.StatusCode == System.Net.HttpStatusCode.OK)
                {
                    var qualificationtypes = JsonConvert.DeserializeObject <IList <QualificationType> >(response.Content);
                    return(qualificationtypes);
                }

                return(new List <QualificationType>());
//                var qftypes = new List<QualificationType>();
//                qftypes.Add(new QualificationType { Id = 1, EducationalLevel = new EducationalLevel() {Id=1, LevelId=47,EQFLevel=1 }, ActiveLanguage = new QualificationTypeLanguage() { QualificationTypeId =47,Name= "ΑΠΟΛΥΤΗΡΙΟ ΔΗΜΟΤΙΚΟΥ"} });
//                qftypes.Add(new QualificationType { Id = 2, EducationalLevel = new EducationalLevel() { Id = 2, LevelId = 51, EQFLevel =4 }, ActiveLanguage = new QualificationTypeLanguage() { QualificationTypeId = 51, Name = "Πτυχίο ΕΠΑΓΓΕΛΜΑΤΙΚΗΣ ΣΧΟΛΗΣ (ΕΠΑ.Σ.)" } });
//                qftypes.Add(new QualificationType { Id = 3, EducationalLevel = new EducationalLevel() { Id = 3, LevelId = 53, EQFLevel = 4 }, ActiveLanguage = new QualificationTypeLanguage() { QualificationTypeId = 53, Name = "Απολυτήριο Επαγγελματικού Λυκείου (ΕΠΑ.Λ.)" } });
//                return qftypes;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
示例#4
0
        public static IList <Qualification> GetQualifications(string language)
        {
            try
            {
                var request  = AppServices.CreateNonAuthorizedRequest(Method.GET);
                var finalUri = $"{AppServices.BaseUri}qualifications/{language}";

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

                return(new List <Qualification>());
                //                var qftypes = new List<Qualification>();
                //                qftypes.Add(new Qualification() { Id = 1, QualificationTypeId = 61, EducationalLevelId = 2 , EducationalLevel = new EducationalLevel() { Id = 28, EQFLevel = 4, LevelId = 4 }} );
                //                qftypes.Add(new Qualification() { Id =924, QualificationTypeId = 59, EducationalLevelId = 30, EducationalLevel = new EducationalLevel() { Id = 30, EQFLevel = 6, LevelId = 6 } });
                //
                //                return qftypes;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
示例#5
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 = "Υπουργείο Οικονομίας, Υποδομών, Ναυτιλίας και Τουρισμού - Ανώτερη Σχολή Τουριστικής Εκπαίδευσης Ρόδο" } });
        }
示例#6
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 = "Απολυτήριο Επαγγελματικού Λυκείου (ΕΠΑ.Λ.)" } });
        }
示例#7
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);
        }
示例#8
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 } });
        }
示例#9
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" } });
        }
示例#10
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);
            }
        }
示例#11
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 } });
        }