Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            msDonatur msDonatur = db.msDonaturs.Find(id);

            db.msDonaturs.Remove(msDonatur);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "id_donatur,nama,no_ktp,tempat_lahir,tanggal_lahir,jenis_kelamin,alamat,agama,pekerjaan,kewarganegaraan,username,password,email,created_date,modified_date")] msDonatur msDonatur)
 {
     if (ModelState.IsValid)
     {
         db.Entry(msDonatur).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(msDonatur));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "id_donatur,nama,no_ktp,tempat_lahir,tanggal_lahir,jenis_kelamin,alamat,agama,pekerjaan,kewarganegaraan,username,password,email,created_date,modified_date")] msDonatur msDonatur)
        {
            if (ModelState.IsValid)
            {
                msDonatur.created_date  = DateTime.Now;
                msDonatur.modified_date = DateTime.Now;
                db.msDonaturs.Add(msDonatur);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(msDonatur));
        }
Esempio n. 4
0
        // GET: msDonaturs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            msDonatur msDonatur = db.msDonaturs.Find(id);

            if (msDonatur == null)
            {
                return(HttpNotFound());
            }
            return(View(msDonatur));
        }
Esempio n. 5
0
 public ActionResult LoginDonatur(msDonatur donatur)
 {
     if (ModelState.IsValid)
     {
         using (danasuraEntities db = new danasuraEntities())
         {
             var obj = db.msDonaturs.Where(x => x.username == donatur.username && x.password == donatur.password).FirstOrDefault();
             if (obj != null)
             {
                 Session["id"]   = obj.id_donatur.ToString();
                 Session["nama"] = obj.nama.ToString();
                 //return RedirectToAction("DonaturMenu");
                 return(View("~/Views/msDonaturs/Details.cshtml", obj));
             }
         }
     }
     return(View(donatur));
 }
        public ActionResult Create([Bind(Include = "id_trans,tgl_trans,nama_barang,id_donatur,id_kategori,kondisi,keterangan,status,created_date,created_by,modified_date,modified_by")] trDonasiBarang trDonasiBarang)
        {
            if (ModelState.IsValid)
            {
                trDonasiBarang.tgl_trans     = DateTime.Now;
                trDonasiBarang.id_donatur    = Convert.ToInt32(Session["id"]);
                trDonasiBarang.status        = 1;
                trDonasiBarang.created_date  = DateTime.Now;
                trDonasiBarang.created_by    = Session["nama"].ToString();
                trDonasiBarang.modified_date = DateTime.Now;
                trDonasiBarang.modified_by   = Session["nama"].ToString();
                db.trDonasiBarangs.Add(trDonasiBarang);
                db.SaveChanges();

                msDonatur donatur = db.msDonaturs.Find(Convert.ToInt32(Session["id"]));

                return(View("~/Views/msDonaturs/Details.cshtml", donatur));
            }

            ViewBag.id_donatur  = new SelectList(db.msDonaturs, "id_donatur", "nama", trDonasiBarang.id_donatur);
            ViewBag.id_kategori = new SelectList(db.msKategoriBarangs, "id_kategori", "nama", trDonasiBarang.id_kategori);
            return(View(trDonasiBarang));
        }
        public ActionResult Create(int?id_barang)
        {
            msBarang msBarang = db.msBarangs.Find(id_barang);

            trDonasiBarang trDonasiBarang = new trDonasiBarang();

            trDonasiBarang.tgl_trans     = DateTime.Now;
            trDonasiBarang.nama_barang   = msBarang.nama;
            trDonasiBarang.id_donatur    = Convert.ToInt32(Session["id"]);
            trDonasiBarang.id_kategori   = msBarang.id_kategori;
            trDonasiBarang.kondisi       = msBarang.kondisi;
            trDonasiBarang.keterangan    = msBarang.keterangan;
            trDonasiBarang.status        = 1;
            trDonasiBarang.created_date  = DateTime.Now;
            trDonasiBarang.created_by    = Session["nama"].ToString();
            trDonasiBarang.modified_date = DateTime.Now;
            trDonasiBarang.modified_by   = Session["nama"].ToString();
            db.trDonasiBarangs.Add(trDonasiBarang);
            db.SaveChanges();

            msDonatur donatur = db.msDonaturs.Find(Convert.ToInt32(Session["id"]));

            return(View("~/Views/msDonaturs/Details.cshtml", donatur));
        }
Esempio n. 8
0
        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"));
        }