public async Task <ActionResult> DeleteConfirmed(int id) { Cupo cupo = await db.Cupos.FindAsync(id); db.Cupos.Remove(cupo); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,CODIGO_IES,NOMBRE_IES,ANO,SEMESTRE,PRO_CONSECUTIVO,PROGRAM_NOMBRE,CODIGO_MUNICIPIO,NOMBRE_MUNICIPIO,CUPOS_NUEVOS_PROYECTADOS,CUPOS_TOTALES_PROYECTADOS,MATRICULA_TOTAL_ESPERADA,FUENTE,FECHA_PERIODO")] Cupo cupo) { if (ModelState.IsValid) { db.Entry(cupo).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(cupo)); }
// GET: Cupo/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Cupo cupo = await db.Cupos.FindAsync(id); if (cupo == null) { return(HttpNotFound()); } return(View(cupo)); }
// GET: /Alumno/Create public ActionResult Create() { using (education_systemEntities1 db = new education_systemEntities1()) { var listaq = db.quota.Where(m => m.alumno_id == null && m.subject.max_alumnos > 0).OrderBy(c => c.subject.codigo_subject).ToList(); List <Cupo> listaCupo = new List <Cupo>(); foreach (quota q in listaq) { var profesor = db.person.Find(q.profesor_id); Cupo c = new Cupo(); c.id_cupo = q.id_quota; c.MateriaString = q.subject.nombre_subject; c.ProfesorString = profesor.first_name + " " + profesor.last_name; c.maxAlumnos = q.subject.max_alumnos; c.descripcion = q.subject.descripcion; listaCupo.Add(c); } return(View("Create", listaCupo)); } }