public ActionResult DeleteConfirmed(int id) { EVALUACION eVALUACION = db.EVALUACION.Find(id); db.EVALUACION.Remove(eVALUACION); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "cod_per,cod_mat,n1p_eva,n2p_eva,n1e_eva,n2e_eva,pro_eva,cod_cur")] EVALUACION eVALUACION) { if (ModelState.IsValid) { db.Entry(eVALUACION).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.cod_cur = new SelectList(db.CURSO, "cod_cur", "nom_cur", eVALUACION.cod_cur); ViewBag.cod_mat = new SelectList(db.MATRICULA, "cod_mat", "cod_mat", eVALUACION.cod_mat); ViewBag.cod_per = new SelectList(db.PERIODO, "cod_per", "des_per", eVALUACION.cod_per); return(View(eVALUACION)); }
// GET: Evaluacion/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EVALUACION eVALUACION = db.EVALUACION.Find(id); if (eVALUACION == null) { return(HttpNotFound()); } return(View(eVALUACION)); }
public void EditarEvaluarEstudiante() { var controller = new RetroalimentacionController(); controller.Request = new HttpRequestMessage(); controller.Configuration = new HttpConfiguration(); EVALUACION obj = new EVALUACION { Id = 1, Observacion = "Prueba", Recomendable = true, HorasLaboradas = 12 }; var response = controller.EditarEvaluarEstudiante(obj); Assert.IsTrue(response.IsSuccessStatusCode); }
public HttpResponseMessage EditarEvaluarEstudiante(EVALUACION evaluacion) { using (HorasBecaEntities entities = new HorasBecaEntities()) { if (ModelState.IsValid) { try { entities.editarAsistente(evaluacion.Id, evaluacion.Observacion, evaluacion.Recomendable, Decimal.ToInt32(evaluacion.HorasLaboradas)); return(Request.CreateResponse(HttpStatusCode.OK)); } catch (DataException) { return(Request.CreateResponse(HttpStatusCode.Conflict)); } } return(Request.CreateResponse(HttpStatusCode.NotAcceptable)); } }
// GET: Evaluacion/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EVALUACION eVALUACION = db.EVALUACION.Find(id); if (eVALUACION == null) { return(HttpNotFound()); } ViewBag.cod_cur = new SelectList(db.CURSO, "cod_cur", "nom_cur", eVALUACION.cod_cur); ViewBag.cod_mat = new SelectList(db.MATRICULA, "cod_mat", "cod_mat", eVALUACION.cod_mat); ViewBag.cod_per = new SelectList(db.PERIODO, "cod_per", "des_per", eVALUACION.cod_per); return(View(eVALUACION)); }