コード例 #1
0
        //
        // GET: /Home/Create

        public ActionResult Create()
        {
            ViewData["myid"] = User.Identity.Name;
            RKSurvey model = new RKSurvey
            {
                name = User.Identity.Name
            };

            return View(model);
        } 
コード例 #2
0
        public ActionResult Create(RKSurvey rksurvey)
        {
            if (ModelState.IsValid)
            {
                db.rksurveylist.Add(rksurvey);
                db.SaveChanges();
                return RedirectToAction("Index");  
            }

            return View(rksurvey);
        }
コード例 #3
0
 public ActionResult Edit(RKSurvey rksurvey)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rksurvey).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(rksurvey);
 }