Exemple #1
0
        //
        // GET: /TestEntities/Create

        public ActionResult Create()
        {
            ViewModelEntity vment = new ViewModelEntity();

            vment.control = true;
            return(View(vment));
        }
Exemple #2
0
 public ActionResult Create(ViewModelEntity testentity)
 {
     if (ModelState.IsValid)
     {
         TestEntity tst = new TestEntity
         {
             Name    = testentity.Name,
             No      = testentity.control ? 1:0,
             Surname = ""
         };
         return(View(tst));
     }
     return(RedirectToAction("Index", "Home"));
 }