Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            DonateMoney donateMoney = db.DonateMoneys.Find(id);

            db.DonateMoneys.Remove(donateMoney);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Phone,Mode")] DonateMoney donateMoney)
 {
     if (ModelState.IsValid)
     {
         db.Entry(donateMoney).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(donateMoney));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,Name,Phone,Mode")] DonateMoney donateMoney)
        {
            if (ModelState.IsValid)
            {
                db.DonateMoneys.Add(donateMoney);
                db.SaveChanges();
                return(RedirectToAction("Success"));
            }

            return(View(donateMoney));
        }
Ejemplo n.º 4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DonateMoney donateMoney = db.DonateMoneys.Find(id);

            if (donateMoney == null)
            {
                return(HttpNotFound());
            }
            return(View(donateMoney));
        }