public ActionResult Save(Riwayat_Proyek proyek) { proyek.created_by = Convert.ToInt64(Session["foo"]); if (ProyekRepo.Createproyek(proyek)) { return(Json(new { Simpan = "Berhasil" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { Simpan = "Gagal" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Delete(int ID, Riwayat_Proyek proyekmdl) { proyekmdl.deleted_by = Convert.ToInt64(Session["foo"]); if (ProyekRepo.Deleteproyek(ID, proyekmdl)) //non static if ( KeahlianRepo.Deletekeahlian(ID)) { return(Json(new { Hapus = "Berhasil" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { Hapus = "Gagal" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult EditSimpan(Riwayat_Proyek proyek) { proyek.modified_by = Convert.ToInt64(Session["foo"]); if (ProyekRepo.Editproyek(proyek)) { return(Json(new { EditSimpan = "Berhasil" }, JsonRequestBehavior.AllowGet)); //return json digunakan untuk memunculkan alert } else { return(Json(new { EditSimpan = "Gagal" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult AmbilData(int ID) { return(Json(ProyekRepo.GetByID(ID), JsonRequestBehavior.AllowGet)); }
public ActionResult Tampil() { return(Json(ProyekRepo.GetAll(), JsonRequestBehavior.AllowGet)); }