public IActionResult Delete([FromBody] leave_statistics ec) { string myurl = url + "api/v1/configuration/lpm/overtime_statistics?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 Add([FromBody] leave_statistics ec) { string myurl = url + "api/v1/configuration/lpm/overtime_statistics"; var postData = JsonConvert.SerializeObject(ec); string result = PostUrl(myurl, postData); JObject jo = (JObject)JsonConvert.DeserializeObject(result); switch (Convert.ToInt32(jo["code"])) { case 200: return(Json("Success")); case 400: return(Json("fail")); } return(Json("fail")); }