public ActionResult Edit(OtherTarantulas other) { if (ModelState.IsValid) { repository.EditOtherTarantula(other); return(RedirectToAction("Others", "Breeder")); } else { return(RedirectToAction("Edit", "OtherTarantula", new { tarantulaID = other.OtherTarantulaID })); } }
public ActionResult AddOtherTarantula(OtherTarantulas other) { if (other != null) { var user = userRepository.Users.Where(u => u.Username == Session["uname"].ToString()).FirstOrDefault(); other.UserID = user.UserID; repository.AddOtherTarantula(other); return(RedirectToAction("Others", "Breeder")); } else { return(View()); } }
public void EditOtherTarantula(OtherTarantulas other) { context.Entry(other).State = EntityState.Modified; context.SaveChanges(); }
public void AddOtherTarantula(OtherTarantulas other) { context.OtherTarantulas.Add(other); context.SaveChanges(); }