コード例 #1
0
        public JsonResult CodeDynamic(string args)
        {
            CallDb callDb = new CallDb();

            JObject json = JObject.Parse(args);
            Dictionary <string, object> paramsDic = SettingParams(json);

            JObject sqlResult = callDb.LoadSqlSingle("pk_atm_sp_code", paramsDic);

            return(Json(sqlResult));
        }
コード例 #2
0
        // public JsonResult CodeDynamic(string args)
        public JsonResult CodeDynamic([FromBody] JObject args)
        {
            CallDb callDb = new CallDb();
            string arg    = Json(JObject.Parse(args["body"].ToString())["args"].ToString()).Value.ToString();

            JObject json = JObject.Parse(arg);
            Dictionary <string, object> paramsDic = SettingParams(json);

            JObject sqlResult = callDb.LoadSqlSingle("pk_atm_sp_code", paramsDic);

            return(Json(sqlResult));
        }
コード例 #3
0
        public JsonResult LoadSqlSingle([FromBody] JObject args)
        {
            CallDb callDb = new CallDb();

            string sql = JObject.Parse(args["body"].ToString())["sql"].ToString();
            string arg = Json(JObject.Parse(args["body"].ToString())["args"].ToString()).Value.ToString();

            arg = arg.Replace("\r\n", "").Replace(" ", "");

            JObject json = new JObject();

            if (arg != "[]" && arg != "{}")
            {
                json = JObject.Parse(arg);
            }

            Dictionary <string, object> paramsDic = SettingParams(json);

            JObject sqlResult = callDb.LoadSqlSingle(sql, paramsDic);

            return(Json(sqlResult));
        }