Пример #1
0
        /// <summary>
        /// Get the summary of an order
        /// </summary>
        /// <param name="resources">a comma (,) separated list of resource_uuid</param>
        /// <param name="wordcount">word count </param>
        /// <param name="sourceLanguage">See the list of Language Codes</param>
        /// <param name="targetLanguage">See the list of Language Codes</param>
        /// <param name="service">[Optional] translation | proofreading | transproof | transcription (defaults to translation)</param>
        /// <param name="expertise">[Optional] See the list of Expertise Codes</param>
        /// <param name="proofreading">[Optional] 0 | 1</param>
        /// <param name="stringCurrency">[Optional] USD | EUR</param>
        /// <returns></returns>
        public GetQuoteResult GetQuote(string resources, string wordcount, string sourceLanguage, string targetLanguage
                                       , StringService service = StringService.None, string expertise = "", StringProofreading proofreading = StringProofreading.None, StringCurrency stringCurrency = StringCurrency.None)
        {
            var r = new GetQuoteResult();

            try
            {
                if (GetQuoteProvider == null)
                {
                    GetQuoteProvider = new GetQuoteProvider();
                }
                var json = GetQuoteProvider.Get(Url, _proxy, KeyPublic, KeySecret, resources, wordcount, sourceLanguage, targetLanguage, service, expertise, proofreading, stringCurrency);
                r = JsonConvert.DeserializeObject <GetQuoteResult>(json.Replace("\"results\":[", "\"resultsArray\":["));
            }
            catch (Exception err)
            {
                r.Status.Code = -1;
                r.Status.Msg  = err.Message;
            }
            return(r);
        }
Пример #2
0
 /// <summary>
 /// Get the summary of an order
 /// </summary>
 /// <param name="resources">a comma (,) separated list of resource_uuid</param>
 /// <param name="wordcount">word count </param>
 /// <param name="sourceLanguage">See the list of Language Codes</param>
 /// <param name="targetLanguage">See the list of Language Codes</param>
 /// <param name="service">[Optional] translation | proofreading | transproof | transcription (defaults to translation)</param>
 /// <param name="expertise">[Optional] See the list of Expertise Codes</param>
 /// <param name="proofreading">[Optional] 0 | 1</param>
 /// <param name="stringCurrency">[Optional] USD | EUR</param>
 /// <returns></returns>
 public GetQuoteResult GetQuote(string resources, string wordcount, string sourceLanguage, string targetLanguage
     , StringService service = StringService.None, string expertise = "", StringProofreading proofreading = StringProofreading.None, StringCurrency stringCurrency = StringCurrency.None)
 {
     var r = new GetQuoteResult();
     try
     {
         if (GetQuoteProvider == null)
             GetQuoteProvider = new GetQuoteProvider();
         var json = GetQuoteProvider.Get(Url, _proxy, KeyPublic, KeySecret, resources, wordcount, sourceLanguage, targetLanguage, service, expertise, proofreading, stringCurrency);
         r = JsonConvert.DeserializeObject<GetQuoteResult>(json.Replace("\"results\":[", "\"resultsArray\":["));
     }
     catch (Exception err)
     {
         r.Status.Code = -1;
         r.Status.Msg = err.Message;
     }
     return r;
 }