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")); }
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)); }