public IActionResult Post([FromBody] Model.tb_Detail_Keranjang.DetailKeranjang_Class value) { var RP = new Model.tb_Detail_Keranjang.DetailKeranjang_Repo(); try { RP.insertDetailKeranjang(value); return(Created("", value)); } catch (Exception e) { return(BadRequest()); } }
public IActionResult GetDetailKeranjangByIDKrj(int id) { List <Model.tb_Detail_Keranjang.DetailKeranjang_Class> value = new List <Model.tb_Detail_Keranjang.DetailKeranjang_Class>(); var RP = new Model.tb_Detail_Keranjang.DetailKeranjang_Repo(); value = RP.getByIdKeranjang(id); if (value != null) { return(Ok(value)); } else { return(NotFound()); } }
public IActionResult Get(int id) { var value = new Model.tb_Detail_Keranjang.DetailKeranjang_Class(); var RP = new Model.tb_Detail_Keranjang.DetailKeranjang_Repo(); value = RP.getById(id); if (value != null) { return(Ok(value)); } else { return(NotFound()); } }
public IActionResult Delete(int id) { var RP = new Model.tb_Detail_Keranjang.DetailKeranjang_Repo(); var value = new Model.tb_Detail_Keranjang.DetailKeranjang_Class(); if (RP.getById(id) != null) { RP.DeleteDetailKeranjang(id); return(Ok("ID Terhapus")); } else { return(NotFound()); } }
public IActionResult GetAllDetailKeranjang() { var listdetailkeranjang = new List <Model.tb_Detail_Keranjang.DetailKeranjang_Class>(); var repositorydetailkeranjang = new Model.tb_Detail_Keranjang.DetailKeranjang_Repo(); try { listdetailkeranjang = repositorydetailkeranjang.getAllDetailKeranjang(); } catch (Exception ex) { } if (listdetailkeranjang == null) { return(NotFound()); } else { return(Ok(listdetailkeranjang)); } }