コード例 #1
0
        public ActionResult Create([Bind(Include = "TrainNo,TrainName,Departure,Destination")] tblTrain tblTrain)
        {
            if (ModelState.IsValid)
            {
                db.tblTrains.Add(tblTrain);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tblTrain));
        }