コード例 #1
0
        public List <User> GetAllUsers()
        {
            string responseJsonString = null;

            using (var httpClient = new WebClient())
            {
                try
                {
                    responseJsonString = httpClient.DownloadString(UrlConstant.BaseUrl + UrlConstant.GetAllUsers);
                    var data = new DeserializeData <ResponseData <User> >(responseJsonString);
                    users = data.DeserializedObject.data;
                }
                catch (Exception)
                {
                    ///throw;
                }
            }
            return(users);
        }
コード例 #2
0
        public List <Programare> GetDoctorProgramations(int DoctorId)
        {
            string responseJsonString = null;

            using (var httpClient = new WebClient())
            {
                try
                {
                    responseJsonString = httpClient.DownloadString(UrlConstant.BaseUrl + UrlConstant.GetProgramationByIdDoctor + DoctorId);
                    var data = new DeserializeData <ResponseData <Programare> >(responseJsonString);
                    programare_dct = data.DeserializedObject.data;
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(programare_dct);
        }
コード例 #3
0
        public List <AvailableDay> GetAllAvailableDays()
        {
            string responseJsonString = null;

            using (var httpClient = new WebClient())
            {
                try
                {
                    responseJsonString = httpClient.DownloadString(UrlConstant.BaseUrl + UrlConstant.GetAllAvailableDay);
                    var data = new DeserializeData <ResponseData <AvailableDay> >(responseJsonString);
                    availableDays = data.DeserializedObject.data;
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(availableDays);
        }
コード例 #4
0
        public List <Programare> GetAllProgramation()
        {
            string responseJsonString = null;

            using (var httpClient = new WebClient())
            {
                try
                {
                    responseJsonString = httpClient.DownloadString(UrlConstant.BaseUrl + UrlConstant.GetAllProgramation);
                    var data = new DeserializeData <ResponseData <Programare> >(responseJsonString);
                    programari = data.DeserializedObject.data;
                }
                catch (Exception)
                {
                    ///throw;
                }
            }

            return(programari);
        }
コード例 #5
0
        public List <RelationProcedureDoctor> GetAllProcedureDocRelations()
        {
            List <RelationProcedureDoctor> relations;
            string responseJsonString = null;

            using (var httpClient = new WebClient())
            {
                try
                {
                    responseJsonString = httpClient.DownloadString(UrlConstant.BaseUrl + UrlConstant.GetAllProcedureDocRelation);
                    var data = new DeserializeData <ResponseData <RelationProcedureDoctor> >(responseJsonString);
                    relations = data.DeserializedObject.data;
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(relations);
        }
コード例 #6
0
        public User GetUserLog(string login, string password)
        {
            List <User> loggedUser;
            string      responseJsonString = null;

            using (var httpClient = new WebClient())
            {
                try
                {
                    responseJsonString = httpClient.DownloadString(UrlConstant.BaseUrl + UrlConstant.GetUserById + login + '.' + password);
                    var data = new DeserializeData <ResponseData <User> >(responseJsonString);
                    loggedUser = data.DeserializedObject.data;
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(loggedUser.FirstOrDefault());
        }
コード例 #7
0
        public List <Procedura> GetAllProcedure()
        {
            string responseJsonString = null;

            using (var httpClient = new WebClient())
            {
                string url = UrlConstant.BaseUrl + UrlConstant.GetAllProcedure;
                responseJsonString = httpClient.DownloadString(url);
                var data = new DeserializeData <ResponseData <Procedura> >(responseJsonString);
                procedures = data.DeserializedObject.data;
                //try
                //{

                //}
                //catch (Exception)
                //{
                //    throw;
                //}
            }

            return(procedures);
        }