Exemplo n.º 1
0
        public string ExecuteUrl(string ApiUrl, IDictionary <string, string> parameters)
        {
            string result = string.Empty;

            try
            {
                SDKUtils sdk = new SDKUtils();
                result = sdk.DoPost(ApiUrl, parameters);
            }
            catch (Exception e)
            {
                DataResult dataResult = new DataResult()
                {
                    Code = (int)EResponseCode.Exception, Message = e.Message
                };
                result = JsonHelper.SerializeObject(dataResult);
            }
            return(result);
        }
Exemplo n.º 2
0
        public string Execute(string ApiName, IDictionary <string, string> parameters)
        {
            string result = string.Empty;

            try
            {
                string   UPS_URL_RATE = ConfigurationManager.AppSettings["UPS_URL_RATE"];
                SDKUtils sdk          = new SDKUtils();
                string   ApiUrl       = string.Format("{0}{1}", UPS_URL_RATE, ApiName);
                result = sdk.DoPost(ApiUrl, parameters);
            }
            catch (Exception e)
            {
                DataResult dataResult = new DataResult()
                {
                    Code = (int)EResponseCode.Exception, Message = e.Message
                };
                result = JsonHelper.SerializeObject(dataResult);
            }
            return(result);
        }