public ActionResult Edit(int id, Comentario collection) { try { // TODO: Add update logic here ComentarioCEN cen = new ComentarioCEN(); cen.Modify(collection.id, collection.comentario, collection.autor, new DateTime(collection.fecha.Year, collection.fecha.Month, collection.fecha.Day)); ComentarioEN en = new ComentarioEN(); en = cen.ReadOID(id); AssemblerComentario ass = new AssemblerComentario(); Comentario sol = ass.ConvertENToModelUI(en); return(RedirectToAction("Details", sol.tipo, new { id = sol.idsup })); } catch { return(View()); } }
public ActionResult Edit(ComentarioViewModel com) { try { // TODO: Add update logic here ComentarioCEN comCEN = new ComentarioCEN(); comCEN.Modify(com.comentario, com.titulo, com.fecha, com.contenido, com.paginasLeidas); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, FormCollection collection) { try { // TODO: Add update logic here ComentarioCEN cen = new ComentarioCEN(); SessionInitialize(); ComentarioModel com = null; ComentarioEN comEN = new ComentarioCAD(session).ReadOIDDefault(id); com = ComentarioAssembler.convertENToModelUI(comEN); VideoModel vid = new VideoModel(); VideoEN vidEN = new VideoCAD(session).ReadOIDDefault(comEN.Video.Id); vid = VideoAssembler.convertENToModelUI(vidEN); SessionClose(); if (!collection["Texto"].Equals("")) { cen.Modify(p_Comentario_OID: com.Id, p_texto: collection["Texto"]); } if (true) { return(RedirectToRoute(new { controller = "Video", action = "Details", id = vid.Id, })); } } catch { return(View()); } }