public ActionResult Edit(TKunde tkunde)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tkunde).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(tkunde);
 }
        public ActionResult Create(TKunde tkunde)
        {
            if (ModelState.IsValid)
            {
                db.TKunde.Add(tkunde);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(tkunde);
        }
Пример #3
0
        public ActionResult Index()
        {
            ViewBag.Message = "Willkommen bei ASP.NET MVC";

            var model = new TKunde()
            {
                KuID = 12,
                KuName = "Fleischer",
                KuVorname = "Horst",
                KuEmail = "*****@*****.**"
            };

            return View(model);
        }