public ActionResult Editar(int id) { this.ViewBag.TituloPagina = "Editar editorial"; Editoriale editorial = this.db.Editoriales.Find(id); return(View(editorial)); }
public ActionResult Editar(Editoriale editorial) { this.db.Editoriales.Attach(editorial); this.db.Entry(editorial).State = System.Data.Entity.EntityState.Modified; this.db.SaveChanges(); return(RedirectToAction("Listar")); }
public ActionResult Eliminar(int id) { Editoriale editorial = this.db.Editoriales.Find(id); this.db.Editoriales.Remove(editorial); this.db.SaveChanges(); return(RedirectToAction("Listar")); }
public async Task <ResponseBase <Editoriale> > Create(EditorialeDTO data) { var exist_editorial = await Repository.GetAsync(predicate : p => p.Nombre == data.Nombre || p.Correo == data.Correo); if (exist_editorial != null) { return(new ResponseBase <Editoriale>(message: "Ya existe una Editorial con el nombre o el correo registrado")); } Editoriale editorial = ConstructModel(data); await Repository.AddAsync(editorial); return(new ResponseBase <Editoriale>(message: "Solicitud Ok", data: editorial, count: 1)); }
public ActionResult Agregar(Editoriale editorial) { this.db.Editoriales.Add(editorial); this.db.SaveChanges(); return(RedirectToAction("Listar")); }