Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TopFootballersTable football = db.TopFootballersTables.Find(id);

            //deleting database record here
            db.TopFootballersTables.Remove(football);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Id, Player_Name, Age, Place_of_Birth, Height, Playing_Position, Current_Team, National_Team, Description, Picture")] TopFootballersTable football)
 {
     if (ModelState.IsValid)
     {
         //Editing database record here
         db.Entry(football).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(football));
 }
Exemple #3
0
        public ActionResult Add([Bind(Include = "Id, Player_Name, Age, Place_of_Birth, Height, Playing_Position, Current_Team, National_Team, Description, Picture")] TopFootballersTable football)
        {
            if (ModelState.IsValid)
            {
                //adding database record here
                db.TopFootballersTables.Add(football);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            return(View(football));
        }
Exemple #4
0
        //Delete View
        public ActionResult Delete(int?id)
        {
            TopFootballersTable movie = db.TopFootballersTables.Find(id);

            return(View(movie));
        }
Exemple #5
0
        //Edit View
        public ActionResult Edit(int?id)
        {
            TopFootballersTable football = db.TopFootballersTables.Find(id);

            return(View(football));
        }