Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,Name")] BookElementViewModel bookElementViewModel)
 {
     if (ModelState.IsValid)
     {
         this.bookElementService.EditBookElement(Mapper.ToBookElement(bookElementViewModel));
         return(RedirectToAction("Index"));
     }
     return(View(bookElementViewModel));
 }
Ejemplo n.º 2
0
        // GET: Categories/Delete/5
        public ActionResult Delete(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IBookElementModel     bookElementModel     = this.bookElementService.FindById(id);
            IBookElementViewModel bookElementViewModel = new BookElementViewModel(bookElementModel);

            if (bookElementViewModel == null)
            {
                return(HttpNotFound());
            }
            return(View(bookElementViewModel));
        }