public ActionResult Create([Bind(Include = "id_trans,tgl_trans,id_provider,id_siswa,jml_kuota,total_biaya,status,created_date,created_by,modified_date,modified_by")] trPencairanKuota trPencairanKuota)
        {
            //msProvider provider = db.msProviders.Find(Convert.ToInt32(trPencairanKuota.id_provider));
            if (ModelState.IsValid)
            {
                trPencairanKuota.jml_kuota     = 1;
                trPencairanKuota.total_biaya   = 50000;
                trPencairanKuota.tgl_trans     = DateTime.Now;
                trPencairanKuota.id_siswa      = Convert.ToInt32(Session["id"]);
                trPencairanKuota.status        = 1;
                trPencairanKuota.created_date  = DateTime.Now;
                trPencairanKuota.created_by    = Session["nama"].ToString();
                trPencairanKuota.modified_date = DateTime.Now;
                trPencairanKuota.modified_by   = Session["nama"].ToString();
                db.trPencairanKuotas.Add(trPencairanKuota);
                db.SaveChanges();
                //return RedirectToAction("Index");


                //trPencairanKuota.total_biaya = provider.harga;

                //db.Entry(trPencairanKuota).State = EntityState.Modified;


                msSiswa siswa = db.msSiswas.Find(Convert.ToInt32(Session["id"]));

                return(View("~/Views/msSiswas/Details.cshtml", siswa));
            }

            ViewBag.id_provider = new SelectList(db.msProviders, "id_provider", "nama_provider", trPencairanKuota.id_provider);
            ViewBag.id_siswa    = new SelectList(db.msSiswas, "id_siswa", "nisn", trPencairanKuota.id_siswa);
            return(View(trPencairanKuota));
        }
Exemple #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            msSiswa msSiswa = db.msSiswas.Find(id);

            msSiswa.status          = 0;
            msSiswa.modified_date   = DateTime.Now;
            msSiswa.modified_by     = "Fikri Adriansyah";
            db.Entry(msSiswa).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #3
0
        // GET: msSiswas/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            msSiswa msSiswa = db.msSiswas.Find(id);

            if (msSiswa == null)
            {
                return(HttpNotFound());
            }
            return(View(msSiswa));
        }
Exemple #4
0
 public ActionResult Edit([Bind(Include = "id_siswa,nisn,nama,jenis_kelamin,tempat_lahir,tanggal_lahir,alamat,no_telp,nomor_kip,jenjang,id_sekolah,semester_awal,status,nama_ayah,pekerjaan_ayah,nama_ibu,pekerjaan_ibu,sb_kuota,sb_seragam,username,password,created_date,created_by,modified_date,modified_by")] msSiswa msSiswa)
 {
     if (ModelState.IsValid)
     {
         msSiswa.status          = 1;
         msSiswa.modified_date   = DateTime.Now;
         msSiswa.modified_by     = "Fikri Adriansyah";
         db.Entry(msSiswa).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.nisn       = new SelectList(db.dtNISNKJPs, "nisn", "no_kip", msSiswa.nisn);
     ViewBag.id_sekolah = new SelectList(db.msSekolahs, "id_sekolah", "nama_sekolah", msSiswa.id_sekolah);
     return(View(msSiswa));
 }
Exemple #5
0
        // GET: msSiswas/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            msSiswa msSiswa = db.msSiswas.Find(id);

            if (msSiswa == null)
            {
                return(HttpNotFound());
            }
            ViewBag.nisn       = new SelectList(db.dtNISNKJPs, "nisn", "no_kip", msSiswa.nisn);
            ViewBag.id_sekolah = new SelectList(db.msSekolahs, "id_sekolah", "nama_sekolah", msSiswa.id_sekolah);
            return(View(msSiswa));
        }
 public ActionResult LoginSiswa(msSiswa siswa)
 {
     if (ModelState.IsValid)
     {
         using (danasuraEntities db = new danasuraEntities())
         {
             var obj = db.msSiswas.Where(x => x.username == siswa.username && x.password == siswa.password).FirstOrDefault();
             if (obj != null)
             {
                 Session["id"]      = obj.id_siswa.ToString();
                 Session["nama"]    = obj.nama.ToString();
                 Session["jenjang"] = obj.jenjang.ToString();
                 //return RedirectToAction("DonaturMenu");
                 return(View("~/Views/msSiswas/Details.cshtml", obj));
             }
         }
     }
     return(View(siswa));
 }
Exemple #7
0
        public ActionResult Create([Bind(Include = "id_trans,tgl_trans,id_siswa,id_staff,ukuran,keterangan,total_biaya,status,created_date,created_by,modified_date,modified_by")] trPengajuanSeragam trPengajuanSeragam)
        {
            if (ModelState.IsValid)
            {
                trPengajuanSeragam.tgl_trans     = DateTime.Now;
                trPengajuanSeragam.id_siswa      = Convert.ToInt32(Session["id"]);
                trPengajuanSeragam.status        = 1;
                trPengajuanSeragam.created_date  = DateTime.Now;
                trPengajuanSeragam.created_by    = Session["nama"].ToString();
                trPengajuanSeragam.modified_date = DateTime.Now;
                trPengajuanSeragam.modified_by   = Session["nama"].ToString();
                db.trPengajuanSeragams.Add(trPengajuanSeragam);
                db.SaveChanges();
                return(RedirectToAction("Index"));

                msSiswa siswa = db.msSiswas.Find(Convert.ToInt32(Session["id"]));

                return(View("~/Views/msSiswas/Details.cshtml", siswa));
            }

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