public ActionResult registrarDetalle() { TB_DETALLE_DEMANDA de = new TB_DETALLE_DEMANDA(); TB_DEMANDA d = new TB_DEMANDA(); de.NUM_DEMANDA = d.generarCodigoDetalle(); return(View(de)); }
public ActionResult registrarDetalle(TB_DETALLE_DEMANDA collection) { try { // TODO: Add insert logic here contexto.TB_DETALLE_DEMANDA.Add(collection); contexto.SaveChanges(); return(RedirectToAction("Index", "Home")); } catch { var error = "Error en el registro"; return(Json(error)); } }