Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            fine_p fine_p = db.fines.Find(id);

            db.fines.Remove(fine_p);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,Rollno,course,Lastdate,Fine")] fine_p fine_p)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fine_p).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fine_p));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "Id,Rollno,course,Lastdate,Fine")] fine_p fine_p)
        {
            if (ModelState.IsValid)
            {
                db.fines.Add(fine_p);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(fine_p));
        }
Пример #4
0
        // GET: fine_p/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            fine_p fine_p = db.fines.Find(id);

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