//public ClientRepository(ILogger log)
        //{
        //    this.log = log;
        //}

        public static void MakeJsonFile(List <Clients> list)
        {
            string path = AppSet.AppTxts("pathC");

            if (!File.Exists(path))
            {
                string alumJson = JsonUtilities <Clients> .ToSerializeObject(list);

                using (StreamWriter sw = File.CreateText(path))
                    sw.WriteLine(alumJson);
            }
        }
Esempio n. 2
0
        public static HttpResponseMessage GetDataWeb(string uri)
        {
            HttpResponseMessage response = null;

            try
            {
                response = GlobalVariable.client.GetAsync(
                    AppSet.AppTxts(uri)).Result;
            }
            catch (HttpRequestException ex)
            {
                //Loggin.LogError(ex.Message);
                //Loggin.LogError(ex.StackTrace);
                throw new VuelingException(Resource1.E_HTTP, ex.InnerException);
            }
            catch (ArgumentNullException ex)
            {
                //Loggin.LogError(ex.Message);
                //Loggin.LogError(ex.StackTrace);
                throw new VuelingException(Resource1.E_ARG, ex.InnerException);
            }
            return(response);
        }