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));
        }
示例#2
0
        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));
        }
示例#5
0
        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));
        }
示例#6
0
 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));
 }