public ActionResult Create([Bind(Include = "DroidName,DroidClass,Accuracy,MovementRating,RequiresLevel5ProgrammingAbility,ReviewofDroid")] Droids droids) { if (ModelState.IsValid) { db.Droids.Add(droids); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(droids)); }
public ActionResult Create([Bind(Include = "AvailableForDarksideOnly,SaberType,SaberColor,SaberLength,LightSaberReview")] LightSabers lightSabers) { if (ModelState.IsValid) { db.LightSabers.Add(lightSabers); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lightSabers)); }
public ActionResult Create([Bind(Include = "YazarId,YazarAdiSoyadi,YazarDogumTarihi")] yazar yazar) { if (ModelState.IsValid) { db.yazars.Add(yazar); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(yazar)); }
public ActionResult Create([Bind(Include = "ShipName,ShipType,MainWeapons,SecondaryWeapons,EquippedWithShield,ShipReview")] Ships ships) { if (ModelState.IsValid) { db.Ships.Add(ships); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ships)); }
public ActionResult Create([Bind(Include = "Id,Nom,Degats")] Arme arme) { if (ModelState.IsValid) { db.Armes.Add(arme); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(arme)); }
public ActionResult Create(SamouraiViewModel samouraivm) { if (ModelState.IsValid) { if (samouraivm.armeId != null) { samouraivm.Samourai.Arme = db.Armes.FirstOrDefault(a => a.Id == samouraivm.armeId.Value); } db.Samourais.Add(samouraivm.Samourai); db.SaveChanges(); return(RedirectToAction("Index")); } samouraivm.Armes = db.Armes.ToList(); return(View(samouraivm)); }