コード例 #1
0
        public IActionResult Delete([FromBody] notice_logic ec)
        {
            string  myurl  = url + "api/v1/configuration/ehs/notice_logic?id=" + ec.id.ToString();
            string  result = DeleteUrl(myurl);
            JObject jo     = (JObject)JsonConvert.DeserializeObject(result);

            switch (Convert.ToInt32(jo["code"]))
            {
            case 200:
                Json("Success");
                break;

            case 400:
                break;

            case 410:
                break;

            case 411:
                break;

            default:
                break;
            }
            return(Json("Success"));
        }
コード例 #2
0
        public IActionResult Update([FromBody] notice_logic ec)
        {
            string  msg      = "";
            string  myurl    = url + "api/v1/configuration/ehs/notice_logic";
            var     postData = JsonConvert.SerializeObject(ec);
            string  result   = PutUrl(myurl, postData);
            JObject jo       = (JObject)JsonConvert.DeserializeObject(result);

            switch (Convert.ToInt32(jo["code"]))
            {
            case 200:
                msg = "Success";
                break;

            case 400:
                msg = "fail";
                break;
            }
            return(Json(msg));
        }