Beispiel #1
0
        public IDictionary<string, string> Inject(Dictionary<string, object> param)
        {
            var prjService = new ProjectService();
            var codes = new Dictionary<string, string>();
            var jsonParam = new object[] { param }.ToJson();
            string r = prjService.CommonQuery("CodeBS", "findCode", jsonParam);

            if (r.Length > 4) {
                var jsonText = r.Substring(1, r.Length - 2);
                var jsonResult = JsonConvert.DeserializeObject<dynamic>(jsonText);
                foreach (JProperty item in jsonResult.options) {
                    codes.Add(item.Name, item.Value.GetJsonValue());
                }
            }

            return codes;
        }