Ejemplo n.º 1
0
 public IActionResult Modify(string id, Policeman policeman)
 {
     (Sheep sheep, Shepard shepard) = Sheep.FindAShepard(id);
     if (sheep != null)
     {
         shepard.Policemen.Add(policeman);
         return(PartialView("../Shepard/_ListPolicemen", shepard.Policemen));
     }
     return(RedirectResult("Index", "Home"));
 }
Ejemplo n.º 2
0
 public IActionResult Delete(string id)
 {
     (Sheep sheep, Shepard shepard) = Sheep.FindAShepard(id);
     if (sheep != null)
     {
         sheep.Shepards.Remove(shepard);
         //Sheep.UpdateASheep(sheep);
         return(PartialView("../Home/_ListShepard", sheep.Shepards));
     }
     return(RedirectResult("Index", "Home"));
 }
Ejemplo n.º 3
0
 public IActionResult Update([Bind] Shepard shepard)
 {
     (Sheep sheep, Shepard shepard2) = Sheep.FindAShepard(shepard.Name);
     ViewBag.SheepId = sheep.Id;
     return(PartialView("Create", shepard2));
 }