public ActionResult DeleteConfirmed(int id) { trDonasiUang trDonasiUang = db.trDonasiUangs.Find(id); db.trDonasiUangs.Remove(trDonasiUang); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id_trans,tgl_trans,id_donatur,id_bank,total_donasi,status,created_date,created_by,modified_date,modified_by")] trDonasiUang trDonasiUang) { if (ModelState.IsValid) { db.Entry(trDonasiUang).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_bank = new SelectList(db.msBanks, "id_bank", "nama_bank", trDonasiUang.id_bank); ViewBag.id_donatur = new SelectList(db.msDonaturs, "id_donatur", "nama", trDonasiUang.id_donatur); return(View(trDonasiUang)); }
// GET: trDonasiUangs/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } trDonasiUang trDonasiUang = db.trDonasiUangs.Find(id); if (trDonasiUang == null) { return(HttpNotFound()); } return(View(trDonasiUang)); }
// GET: trDonasiUangs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } trDonasiUang trDonasiUang = db.trDonasiUangs.Find(id); if (trDonasiUang == null) { return(HttpNotFound()); } ViewBag.id_bank = new SelectList(db.msBanks, "id_bank", "nama_bank", trDonasiUang.id_bank); ViewBag.id_donatur = new SelectList(db.msDonaturs, "id_donatur", "nama", trDonasiUang.id_donatur); return(View(trDonasiUang)); }
public ActionResult Create([Bind(Include = "id_trans,tgl_trans,id_donatur,id_bank,total_donasi,status,created_date,created_by,modified_date,modified_by")] trDonasiUang trDonasiUang) { if (ModelState.IsValid) { trDonasiUang.tgl_trans = DateTime.Now; trDonasiUang.id_donatur = Convert.ToInt32(Session["id"]); trDonasiUang.status = 1; trDonasiUang.created_date = DateTime.Now; trDonasiUang.created_by = Session["nama"].ToString(); trDonasiUang.modified_date = DateTime.Now; trDonasiUang.modified_by = Session["nama"].ToString(); db.trDonasiUangs.Add(trDonasiUang); db.SaveChanges(); msDonatur donatur = db.msDonaturs.Find(Convert.ToInt32(Session["id"])); return(View("~/Views/msDonaturs/Details.cshtml", donatur)); } ViewBag.id_bank = new SelectList(db.msBanks, "id_bank", "nama_bank", trDonasiUang.id_bank); ViewBag.id_donatur = new SelectList(db.msDonaturs, "id_donatur", "nama", trDonasiUang.id_donatur); return(RedirectToAction("Index")); }