public ActionResult Edit([Bind(Include = "CountryID,CountryName,Flag")] Country country) { if (ModelState.IsValid) { db.Entry(country).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(country)); }
public ActionResult Edit([Bind(Include = "UserID,FirstName,LastName,Email,UserPassword,RoleID,StatusID")] Users users) { if (ModelState.IsValid) { db.Entry(users).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RoleID = new SelectList(db.RoleType, "RoleID", "RoleName", users.RoleID); ViewBag.StatusID = new SelectList(db.UserStatus, "StatusID", "StatusDesc", users.StatusID); return(View(users)); }
public ActionResult Edit([Bind(Include = "ClubID,ClubName,ClubFullName,CountryID,FoundationDate,CityClub,PriceMerch,ImageShield,ClubHistory,President,Stadium,WebSite")] Club club, HttpPostedFileBase imageEdit) { if (imageEdit != null) { club.ImageShield = new byte[imageEdit.ContentLength]; imageEdit.InputStream.Read(club.ImageShield, 0, imageEdit.ContentLength); } if (ModelState.IsValid) { db.Entry(club).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CountryID = new SelectList(db.Country, "CountryID", "CountryName", club.CountryID); return(View(club)); }
public ActionResult Edit([Bind(Include = "ManagerID,FirstName,LastName,NickName,DateOfBirth,CountryID,ClubID,Photo")] Manager manager, HttpPostedFileBase photoEdit) { if (photoEdit != null) { manager.Photo = new byte[photoEdit.ContentLength]; photoEdit.InputStream.Read(manager.Photo, 0, photoEdit.ContentLength); } if (ModelState.IsValid) { db.Entry(manager).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClubID = new SelectList(db.Club, "ClubID", "ClubName", manager.ClubID); ViewBag.CountryID = new SelectList(db.Country, "CountryID", "CountryName", manager.CountryID); return(View(manager)); }
public ActionResult Edit([Bind(Include = "PlayerID,FirstName,LastName,NickName,DateOfBirth,CountryID,PositionID,ClubID,PlayerStatusID,Photo,Appearances,YellowCard,RedCard,GoalsScored,Height,PricePass,Number")] Player player, HttpPostedFileBase photoEdit) { if (photoEdit != null) { player.Photo = new byte[photoEdit.ContentLength]; photoEdit.InputStream.Read(player.Photo, 0, photoEdit.ContentLength); } if (ModelState.IsValid) { db.Entry(player).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClubID = new SelectList(db.Club, "ClubID", "ClubName", player.ClubID); ViewBag.CountryID = new SelectList(db.Country, "CountryID", "CountryName", player.CountryID); ViewBag.PlayerStatusID = new SelectList(db.PlayerStatus, "PlayerStatusID", "NameStatus", player.PlayerStatusID); ViewBag.PositionID = new SelectList(db.Position, "PositionID", "Position1", player.PositionID); return(View(player)); }