Ejemplo n.º 1
0
        public ActionResult Create()
        {
            ViewBag.Types = new SelectList(_repository.GetTypes(), "Id", "TypeName");

            var model = new Bookmark();
            return View(model);
        }
Ejemplo n.º 2
0
        public ActionResult Create(Bookmark bookmark)
        {
            if (ModelState.IsValid)
            {
                bookmark.Description = Encoder.HtmlEncode(bookmark.Description);

                _repository.InsertOrUpdate(bookmark);
                return RedirectToAction("Index");
            }
            ViewBag.Types = new SelectList(_repository.GetTypes(), "Id", "TypeName");
            return View(bookmark);
        }
Ejemplo n.º 3
0
 public ActionResult Edit(Bookmark bookmark)
 {
     if (ModelState.IsValid)
     {
         _repository.InsertOrUpdate(bookmark);
         return RedirectToAction("Index");
     }
     ViewBag.Types = new SelectList(_repository.GetTypes(), "Id", "TypeName");
     return View(bookmark);
 }