public ActionResult DeleteConfirmed(int id)
        {
            tblDivision tblDivision = db.tblDivisions.Find(id);

            db.tblDivisions.Remove(tblDivision);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "DivCode,Division")] tblDivision tblDivision)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblDivision).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tblDivision));
 }
        public ActionResult Create([Bind(Include = "DivCode,Division")] tblDivision tblDivision)
        {
            if (ModelState.IsValid)
            {
                db.tblDivisions.Add(tblDivision);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tblDivision));
        }
        // GET: Divisions/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblDivision tblDivision = db.tblDivisions.Find(id);

            if (tblDivision == null)
            {
                return(HttpNotFound());
            }
            return(View(tblDivision));
        }
 //Divion
 public static DivisionModel ToModel(this tblDivision entity)
 {
     return(Mapper.Map <tblDivision, DivisionModel>(entity));
 }