public ActionResult Edit([Bind(Include = "idmatricula,fecha,costo,estado,tipo,idalumno,idmateria")] Matricula matricula) { if (ModelState.IsValid) { matricula = MatriculaBLL.TransforEnumCreate(matricula); MatriculaBLL.Update(matricula); return(RedirectToAction("Index")); } MatriculaBLL.TransforEnum(matricula); ViewBag.tipo = new SelectList(MatriculaBLL.ListEnum("tipo"), matricula.tipo); ViewBag.estado = new SelectList(MatriculaBLL.ListEnum("estado"), matricula.estado); ViewBag.idalumno = new SelectList(AlumnoBLL.List(), "idalumno", "nombres", matricula.idalumno); ViewBag.idmateria = new SelectList(MateriaBLL.List(), "idmateria", "nombre", matricula.idmateria); return(View(matricula)); }
// GET: Matriculas/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Matricula matricula = MatriculaBLL.Get(id); if (matricula == null) { return(HttpNotFound()); } MatriculaBLL.TransforEnum(matricula); ViewBag.tipo = new SelectList(MatriculaBLL.ListEnum("tipo"), matricula.tipo); ViewBag.estado = new SelectList(MatriculaBLL.ListEnum("estado"), matricula.estado); ViewBag.idalumno = new SelectList(AlumnoBLL.List(), "idalumno", "nombres", matricula.idalumno); ViewBag.idmateria = new SelectList(MateriaBLL.List(), "idmateria", "nombre", matricula.idmateria); return(View(matricula)); }