public ActionResult Edit([Bind(Include = "idmateria,nombre,nrc,creditos,idarea")] Materia materia) { if (ModelState.IsValid) { MateriaBLL.Update(materia); return(RedirectToAction("Index")); } ViewBag.idarea = new SelectList(AreaBLL.List(), "idarea", "nombre", materia.idarea); return(View(materia)); }
public IHttpActionResult Put(Materia materia) { try { MateriaBLL.Update(materia); return(Content(HttpStatusCode.OK, "Materia actualizado correctamente")); } catch (Exception ex) { return(BadRequest(ex.Message)); } }