public ActionResult DeleteConfirmed(int id)
        {
            trPengajuanSPP trPengajuanSPP = db.trPengajuanSPPs.Find(id);

            db.trPengajuanSPPs.Remove(trPengajuanSPP);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id_trans,tgl_trans,id_siswa,id_staff,jml_bulan,total_biaya,status,created_date,created_by,modified_date,modified_by")] trPengajuanSPP trPengajuanSPP)
 {
     if (ModelState.IsValid)
     {
         db.Entry(trPengajuanSPP).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_siswa = new SelectList(db.msSiswas, "id_siswa", "nisn", trPengajuanSPP.id_siswa);
     ViewBag.id_staff = new SelectList(db.msStaffs, "id_staff", "nama_staff", trPengajuanSPP.id_staff);
     return(View(trPengajuanSPP));
 }
        // GET: trPengajuanSPPs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            trPengajuanSPP trPengajuanSPP = db.trPengajuanSPPs.Find(id);

            if (trPengajuanSPP == null)
            {
                return(HttpNotFound());
            }
            return(View(trPengajuanSPP));
        }
        // GET: trPengajuanSPPs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            trPengajuanSPP trPengajuanSPP = db.trPengajuanSPPs.Find(id);

            if (trPengajuanSPP == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_siswa = new SelectList(db.msSiswas, "id_siswa", "nisn", trPengajuanSPP.id_siswa);
            ViewBag.id_staff = new SelectList(db.msStaffs, "id_staff", "nama_staff", trPengajuanSPP.id_staff);
            return(View(trPengajuanSPP));
        }
        public ActionResult Create([Bind(Include = "id_trans,tgl_trans,id_siswa,id_staff,jml_bulan,total_biaya,status,created_date,created_by,modified_date,modified_by")] trPengajuanSPP trPengajuanSPP)
        {
            if (ModelState.IsValid)
            {
                trPengajuanSPP.tgl_trans     = DateTime.Now;
                trPengajuanSPP.id_siswa      = Convert.ToInt32(Session["id"]);
                trPengajuanSPP.status        = 1;
                trPengajuanSPP.created_date  = DateTime.Now;
                trPengajuanSPP.created_by    = Session["nama"].ToString();
                trPengajuanSPP.modified_date = DateTime.Now;
                trPengajuanSPP.modified_by   = Session["nama"].ToString();
                db.trPengajuanSPPs.Add(trPengajuanSPP);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.id_siswa = new SelectList(db.msSiswas, "id_siswa", "nisn", trPengajuanSPP.id_siswa);
            ViewBag.id_staff = new SelectList(db.msStaffs, "id_staff", "nama_staff", trPengajuanSPP.id_staff);
            return(View(trPengajuanSPP));
        }