Beispiel #1
0
        public ActionResult Edit(Post p)
        {
            p.Dato = DateTime.Now;

            if (ModelState.IsValid)
            {
                postFac.Update(p);
            }

            return View(postFac.Get(p.ID));
        }
Beispiel #2
0
        public ActionResult Create(Post p)
        {
            p.Dato = DateTime.Now;

            if (ModelState.IsValid)
            {
                postFac.Insert(p);
                ViewBag.MSG = "Posten er oprettet!";
            }
            else
            {
                ViewBag.MSG = "Der opstod en fejl!";
            }

            return View();
        }