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

            db.LateFines.Remove(lateFine);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,RollNumber,DisciplineType,DisciplineAmount,SubmitTime")] LateFine lateFine)
 {
     if (ModelState.IsValid)
     {
         db.Entry(lateFine).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(lateFine));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "Id,RollNumber,DisciplineType,DisciplineAmount,SubmitTime")] LateFine lateFine)
        {
            if (ModelState.IsValid)
            {
                lateFine.SubmitTime = DateTime.Now;
                db.LateFines.Add(lateFine);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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