From dc52170421f06f575d1b8f4bb68a13ed37004f2b Mon Sep 17 00:00:00 2001 From: Angel Arciniega Date: Thu, 2 Mar 2017 17:41:44 -0800 Subject: [PATCH] Se agrego y configuro para registro de alumnos --- .../Renova/Controllers/alumnoesController.cs | 127 +++++++++++++++++ .../Controllers/asistenciasController.cs | 132 ++++++++++++++++++ Renova/Renova/Renova.csproj | 16 ++- Renova/Renova/Views/Shared/_Layout.cshtml | 11 +- Renova/Renova/Views/alumnoes/Create.cshtml | 75 ++++++++++ Renova/Renova/Views/alumnoes/Delete.cshtml | 80 +++++++++++ Renova/Renova/Views/alumnoes/Details.cshtml | 74 ++++++++++ Renova/Renova/Views/alumnoes/Edit.cshtml | 90 ++++++++++++ Renova/Renova/Views/alumnoes/Index.cshtml | 64 +++++++++ Renova/Renova/Views/asistencias/Create.cshtml | 128 +++++++++++++++++ Renova/Renova/Views/asistencias/Delete.cshtml | 118 ++++++++++++++++ .../Renova/Views/asistencias/Details.cshtml | 110 +++++++++++++++ Renova/Renova/Views/asistencias/Edit.cshtml | 120 ++++++++++++++++ Renova/Renova/Views/asistencias/Index.cshtml | 95 +++++++++++++ 14 files changed, 1232 insertions(+), 8 deletions(-) create mode 100644 Renova/Renova/Controllers/alumnoesController.cs create mode 100644 Renova/Renova/Controllers/asistenciasController.cs create mode 100644 Renova/Renova/Views/alumnoes/Create.cshtml create mode 100644 Renova/Renova/Views/alumnoes/Delete.cshtml create mode 100644 Renova/Renova/Views/alumnoes/Details.cshtml create mode 100644 Renova/Renova/Views/alumnoes/Edit.cshtml create mode 100644 Renova/Renova/Views/alumnoes/Index.cshtml create mode 100644 Renova/Renova/Views/asistencias/Create.cshtml create mode 100644 Renova/Renova/Views/asistencias/Delete.cshtml create mode 100644 Renova/Renova/Views/asistencias/Details.cshtml create mode 100644 Renova/Renova/Views/asistencias/Edit.cshtml create mode 100644 Renova/Renova/Views/asistencias/Index.cshtml diff --git a/Renova/Renova/Controllers/alumnoesController.cs b/Renova/Renova/Controllers/alumnoesController.cs new file mode 100644 index 0000000..232126d --- /dev/null +++ b/Renova/Renova/Controllers/alumnoesController.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.Entity; +using System.Linq; +using System.Net; +using System.Web; +using System.Web.Mvc; +using Renova.Models; + +namespace RenoEnergy.Controllers +{ + public class alumnoesController : Controller + { + private RenoContext db = new RenoContext(); + + // GET: alumnoes + public ActionResult Index() + { + return View(db.alumnos.ToList()); + } + + // GET: alumnoes/Details/5 + public ActionResult Details(int? id) + { + if (id == null) + { + return new HttpStatusCodeResult(HttpStatusCode.BadRequest); + } + alumno alumno = db.alumnos.Find(id); + if (alumno == null) + { + return HttpNotFound(); + } + return View(alumno); + } + + // GET: alumnoes/Create + public ActionResult Create() + { + return View(); + } + + // POST: alumnoes/Create + // Para protegerse de ataques de publicación excesiva, habilite las propiedades específicas a las que desea enlazarse. Para obtener + // más información vea https://go.microsoft.com/fwlink/?LinkId=317598. + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult Create([Bind(Include = "IDAlumno,nombre,apellidos,universidad,carrera,matricula,correo,fechareg")] alumno alumno) + { + if (ModelState.IsValid) + { + db.alumnos.Add(alumno); + db.SaveChanges(); + return RedirectToAction("Index"); + } + + return View(alumno); + } + + // GET: alumnoes/Edit/5 + public ActionResult Edit(int? id) + { + if (id == null) + { + return new HttpStatusCodeResult(HttpStatusCode.BadRequest); + } + alumno alumno = db.alumnos.Find(id); + if (alumno == null) + { + return HttpNotFound(); + } + return View(alumno); + } + + // POST: alumnoes/Edit/5 + // Para protegerse de ataques de publicación excesiva, habilite las propiedades específicas a las que desea enlazarse. Para obtener + // más información vea https://go.microsoft.com/fwlink/?LinkId=317598. + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult Edit([Bind(Include = "IDAlumno,nombre,apellidos,universidad,carrera,matricula,correo,fechareg")] alumno alumno) + { + if (ModelState.IsValid) + { + db.Entry(alumno).State = EntityState.Modified; + db.SaveChanges(); + return RedirectToAction("Index"); + } + return View(alumno); + } + + // GET: alumnoes/Delete/5 + public ActionResult Delete(int? id) + { + if (id == null) + { + return new HttpStatusCodeResult(HttpStatusCode.BadRequest); + } + alumno alumno = db.alumnos.Find(id); + if (alumno == null) + { + return HttpNotFound(); + } + return View(alumno); + } + + // POST: alumnoes/Delete/5 + [HttpPost, ActionName("Delete")] + [ValidateAntiForgeryToken] + public ActionResult DeleteConfirmed(int id) + { + alumno alumno = db.alumnos.Find(id); + db.alumnos.Remove(alumno); + db.SaveChanges(); + return RedirectToAction("Index"); + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + db.Dispose(); + } + base.Dispose(disposing); + } + } +} diff --git a/Renova/Renova/Controllers/asistenciasController.cs b/Renova/Renova/Controllers/asistenciasController.cs new file mode 100644 index 0000000..d01559a --- /dev/null +++ b/Renova/Renova/Controllers/asistenciasController.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.Entity; +using System.Linq; +using System.Net; +using System.Web; +using System.Web.Mvc; +using Renova.Models; + +namespace RenoEnergy.Controllers +{ + public class asistenciasController : Controller + { + private RenoContext db = new RenoContext(); + + // GET: asistencias + public ActionResult Index() + { + var asistencias = db.asistencias.Include(a => a.alumno); + return View(asistencias.ToList()); + } + + // GET: asistencias/Details/5 + public ActionResult Details(int? id) + { + if (id == null) + { + return new HttpStatusCodeResult(HttpStatusCode.BadRequest); + } + asistencia asistencia = db.asistencias.Find(id); + if (asistencia == null) + { + return HttpNotFound(); + } + return View(asistencia); + } + + // GET: asistencias/Create + public ActionResult Create() + { + ViewBag.IDAlumno = new SelectList(db.alumnos, "IDAlumno", "nombre"); + return View(); + } + + // POST: asistencias/Create + // Para protegerse de ataques de publicación excesiva, habilite las propiedades específicas a las que desea enlazarse. Para obtener + // más información vea https://go.microsoft.com/fwlink/?LinkId=317598. + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult Create([Bind(Include = "IDAsistencia,IDAlumno,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,estado")] asistencia asistencia) + { + if (ModelState.IsValid) + { + db.asistencias.Add(asistencia); + db.SaveChanges(); + return RedirectToAction("Index"); + } + + ViewBag.IDAlumno = new SelectList(db.alumnos, "IDAlumno", "nombre", asistencia.IDAlumno); + return View(asistencia); + } + + // GET: asistencias/Edit/5 + public ActionResult Edit(int? id) + { + if (id == null) + { + return new HttpStatusCodeResult(HttpStatusCode.BadRequest); + } + asistencia asistencia = db.asistencias.Find(id); + if (asistencia == null) + { + return HttpNotFound(); + } + ViewBag.IDAlumno = new SelectList(db.alumnos, "IDAlumno", "nombre", asistencia.IDAlumno); + return View(asistencia); + } + + // POST: asistencias/Edit/5 + // Para protegerse de ataques de publicación excesiva, habilite las propiedades específicas a las que desea enlazarse. Para obtener + // más información vea https://go.microsoft.com/fwlink/?LinkId=317598. + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult Edit([Bind(Include = "IDAsistencia,IDAlumno,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,estado")] asistencia asistencia) + { + if (ModelState.IsValid) + { + db.Entry(asistencia).State = EntityState.Modified; + db.SaveChanges(); + return RedirectToAction("Index"); + } + ViewBag.IDAlumno = new SelectList(db.alumnos, "IDAlumno", "nombre", asistencia.IDAlumno); + return View(asistencia); + } + + // GET: asistencias/Delete/5 + public ActionResult Delete(int? id) + { + if (id == null) + { + return new HttpStatusCodeResult(HttpStatusCode.BadRequest); + } + asistencia asistencia = db.asistencias.Find(id); + if (asistencia == null) + { + return HttpNotFound(); + } + return View(asistencia); + } + + // POST: asistencias/Delete/5 + [HttpPost, ActionName("Delete")] + [ValidateAntiForgeryToken] + public ActionResult DeleteConfirmed(int id) + { + asistencia asistencia = db.asistencias.Find(id); + db.asistencias.Remove(asistencia); + db.SaveChanges(); + return RedirectToAction("Index"); + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + db.Dispose(); + } + base.Dispose(disposing); + } + } +} diff --git a/Renova/Renova/Renova.csproj b/Renova/Renova/Renova.csproj index 6d96f2c..446a2a9 100644 --- a/Renova/Renova/Renova.csproj +++ b/Renova/Renova/Renova.csproj @@ -141,6 +141,8 @@ + + Global.asax @@ -178,11 +180,21 @@ - - + + + + + + + + + + + + diff --git a/Renova/Renova/Views/Shared/_Layout.cshtml b/Renova/Renova/Views/Shared/_Layout.cshtml index 74abcff..2925be5 100644 --- a/Renova/Renova/Views/Shared/_Layout.cshtml +++ b/Renova/Renova/Views/Shared/_Layout.cshtml @@ -4,7 +4,7 @@ - @ViewBag.Title - Mi aplicación ASP.NET + Energias Renovables @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") @@ -17,13 +17,12 @@ - @Html.ActionLink("Nombre de aplicación", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) + @Html.ActionLink("Energias Renovables", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) @@ -32,7 +31,7 @@ @RenderBody()
-

© @DateTime.Now.Year - Mi aplicación ASP.NET

+

© @DateTime.Now.Year - Energias Renovables

diff --git a/Renova/Renova/Views/alumnoes/Create.cshtml b/Renova/Renova/Views/alumnoes/Create.cshtml new file mode 100644 index 0000000..eb2d37f --- /dev/null +++ b/Renova/Renova/Views/alumnoes/Create.cshtml @@ -0,0 +1,75 @@ +@model RenoEnergy.Models.alumno +

Registro

+ + +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() + +
+

Alumno

+
+ @Html.ValidationSummary(true, "", new { @class = "text-danger" }) +
+ @Html.LabelFor(model => model.nombre, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.nombre, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.nombre, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.apellidos, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.apellidos, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.apellidos, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.universidad, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.universidad, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.universidad, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.carrera, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.carrera, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.carrera, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.matricula, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.matricula, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.matricula, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.correo, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.correo, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.correo, "", new { @class = "text-danger" }) +
+
+ +
+
+ +
+
+
+} + +
+ @Html.ActionLink("Lista", "Index") +
+ +@section Scripts { + @Scripts.Render("~/bundles/jqueryval") +} diff --git a/Renova/Renova/Views/alumnoes/Delete.cshtml b/Renova/Renova/Views/alumnoes/Delete.cshtml new file mode 100644 index 0000000..9937723 --- /dev/null +++ b/Renova/Renova/Views/alumnoes/Delete.cshtml @@ -0,0 +1,80 @@ +@model RenoEnergy.Models.alumno + +@{ + ViewBag.Title = "Delete"; +} + +

Delete

+ +

Are you sure you want to delete this?

+
+

alumno

+
+
+
+ @Html.DisplayNameFor(model => model.nombre) +
+ +
+ @Html.DisplayFor(model => model.nombre) +
+ +
+ @Html.DisplayNameFor(model => model.apellidos) +
+ +
+ @Html.DisplayFor(model => model.apellidos) +
+ +
+ @Html.DisplayNameFor(model => model.universidad) +
+ +
+ @Html.DisplayFor(model => model.universidad) +
+ +
+ @Html.DisplayNameFor(model => model.carrera) +
+ +
+ @Html.DisplayFor(model => model.carrera) +
+ +
+ @Html.DisplayNameFor(model => model.matricula) +
+ +
+ @Html.DisplayFor(model => model.matricula) +
+ +
+ @Html.DisplayNameFor(model => model.correo) +
+ +
+ @Html.DisplayFor(model => model.correo) +
+ +
+ @Html.DisplayNameFor(model => model.fechareg) +
+ +
+ @Html.DisplayFor(model => model.fechareg) +
+ +
+ + @using (Html.BeginForm()) { + @Html.AntiForgeryToken() + +
+ | + @Html.ActionLink("Back to List", "Index") +
+ } +
diff --git a/Renova/Renova/Views/alumnoes/Details.cshtml b/Renova/Renova/Views/alumnoes/Details.cshtml new file mode 100644 index 0000000..bb59c69 --- /dev/null +++ b/Renova/Renova/Views/alumnoes/Details.cshtml @@ -0,0 +1,74 @@ +@model RenoEnergy.Models.alumno + +@{ + ViewBag.Title = "Details"; +} + +

Details

+ +
+

alumno

+
+
+
+ @Html.DisplayNameFor(model => model.nombre) +
+ +
+ @Html.DisplayFor(model => model.nombre) +
+ +
+ @Html.DisplayNameFor(model => model.apellidos) +
+ +
+ @Html.DisplayFor(model => model.apellidos) +
+ +
+ @Html.DisplayNameFor(model => model.universidad) +
+ +
+ @Html.DisplayFor(model => model.universidad) +
+ +
+ @Html.DisplayNameFor(model => model.carrera) +
+ +
+ @Html.DisplayFor(model => model.carrera) +
+ +
+ @Html.DisplayNameFor(model => model.matricula) +
+ +
+ @Html.DisplayFor(model => model.matricula) +
+ +
+ @Html.DisplayNameFor(model => model.correo) +
+ +
+ @Html.DisplayFor(model => model.correo) +
+ +
+ @Html.DisplayNameFor(model => model.fechareg) +
+ +
+ @Html.DisplayFor(model => model.fechareg) +
+ +
+
+

+ @Html.ActionLink("Edit", "Edit", new { id = Model.IDAlumno }) | + @Html.ActionLink("Back to List", "Index") +

diff --git a/Renova/Renova/Views/alumnoes/Edit.cshtml b/Renova/Renova/Views/alumnoes/Edit.cshtml new file mode 100644 index 0000000..f88fd58 --- /dev/null +++ b/Renova/Renova/Views/alumnoes/Edit.cshtml @@ -0,0 +1,90 @@ +@model RenoEnergy.Models.alumno + +@{ + ViewBag.Title = "Edit"; +} + +

Edit

+ + +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() + +
+

alumno

+
+ @Html.ValidationSummary(true, "", new { @class = "text-danger" }) + @Html.HiddenFor(model => model.IDAlumno) + +
+ @Html.LabelFor(model => model.nombre, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.nombre, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.nombre, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.apellidos, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.apellidos, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.apellidos, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.universidad, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.universidad, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.universidad, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.carrera, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.carrera, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.carrera, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.matricula, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.matricula, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.matricula, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.correo, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.correo, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.correo, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.fechareg, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.fechareg, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.fechareg, "", new { @class = "text-danger" }) +
+
+ +
+
+ +
+
+
+} + +
+ @Html.ActionLink("Back to List", "Index") +
+ +@section Scripts { + @Scripts.Render("~/bundles/jqueryval") +} diff --git a/Renova/Renova/Views/alumnoes/Index.cshtml b/Renova/Renova/Views/alumnoes/Index.cshtml new file mode 100644 index 0000000..d982b8c --- /dev/null +++ b/Renova/Renova/Views/alumnoes/Index.cshtml @@ -0,0 +1,64 @@ +@model IEnumerable + + + +

Alumnos registrados

+ + + + + + + + + + + + + +@foreach (var item in Model) { + + + + + + + + + + +} + +
+ @Html.DisplayNameFor(model => model.nombre) + + @Html.DisplayNameFor(model => model.apellidos) + + @Html.DisplayNameFor(model => model.universidad) + + @Html.DisplayNameFor(model => model.carrera) + + @Html.DisplayNameFor(model => model.matricula) + + @Html.DisplayNameFor(model => model.correo) + + @Html.DisplayNameFor(model => model.fechareg) +
+ @Html.DisplayFor(modelItem => item.nombre) + + @Html.DisplayFor(modelItem => item.apellidos) + + @Html.DisplayFor(modelItem => item.universidad) + + @Html.DisplayFor(modelItem => item.carrera) + + @Html.DisplayFor(modelItem => item.matricula) + + @Html.DisplayFor(modelItem => item.correo) + + @Html.DisplayFor(modelItem => item.fechareg) +
diff --git a/Renova/Renova/Views/asistencias/Create.cshtml b/Renova/Renova/Views/asistencias/Create.cshtml new file mode 100644 index 0000000..ae32c54 --- /dev/null +++ b/Renova/Renova/Views/asistencias/Create.cshtml @@ -0,0 +1,128 @@ +@model RenoEnergy.Models.asistencia + +@{ + ViewBag.Title = "Create"; +} + +

Create

+ + +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() + +
+

asistencia

+
+ @Html.ValidationSummary(true, "", new { @class = "text-danger" }) +
+ @Html.LabelFor(model => model.IDAlumno, "IDAlumno", htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DropDownList("IDAlumno", null, htmlAttributes: new { @class = "form-control" }) + @Html.ValidationMessageFor(model => model.IDAlumno, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A1, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A1, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A1, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A2, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A2, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A2, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A3, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A3, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A3, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A4, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A4, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A4, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A5, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A5, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A5, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A6, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A6, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A6, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A7, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A7, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A7, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A8, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A8, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A8, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A9, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A9, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A9, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A10, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A10, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A10, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.estado, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.estado, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.estado, "", new { @class = "text-danger" }) +
+
+ +
+
+ +
+
+
+} + +
+ @Html.ActionLink("Back to List", "Index") +
+ +@section Scripts { + @Scripts.Render("~/bundles/jqueryval") +} diff --git a/Renova/Renova/Views/asistencias/Delete.cshtml b/Renova/Renova/Views/asistencias/Delete.cshtml new file mode 100644 index 0000000..bc880aa --- /dev/null +++ b/Renova/Renova/Views/asistencias/Delete.cshtml @@ -0,0 +1,118 @@ +@model RenoEnergy.Models.asistencia + + + +

Eliminar

+ +

Esta usted seguro de eliminar este alumno?

+
+

Asistencias

+
+
+
+ @Html.DisplayNameFor(model => model.alumno.nombre) +
+ +
+ @Html.DisplayFor(model => model.alumno.nombre) +
+ +
+ @Html.DisplayNameFor(model => model.A1) +
+ +
+ @Html.DisplayFor(model => model.A1) +
+ +
+ @Html.DisplayNameFor(model => model.A2) +
+ +
+ @Html.DisplayFor(model => model.A2) +
+ +
+ @Html.DisplayNameFor(model => model.A3) +
+ +
+ @Html.DisplayFor(model => model.A3) +
+ +
+ @Html.DisplayNameFor(model => model.A4) +
+ +
+ @Html.DisplayFor(model => model.A4) +
+ +
+ @Html.DisplayNameFor(model => model.A5) +
+ +
+ @Html.DisplayFor(model => model.A5) +
+ +
+ @Html.DisplayNameFor(model => model.A6) +
+ +
+ @Html.DisplayFor(model => model.A6) +
+ +
+ @Html.DisplayNameFor(model => model.A7) +
+ +
+ @Html.DisplayFor(model => model.A7) +
+ +
+ @Html.DisplayNameFor(model => model.A8) +
+ +
+ @Html.DisplayFor(model => model.A8) +
+ +
+ @Html.DisplayNameFor(model => model.A9) +
+ +
+ @Html.DisplayFor(model => model.A9) +
+ +
+ @Html.DisplayNameFor(model => model.A10) +
+ +
+ @Html.DisplayFor(model => model.A10) +
+ +
+ @Html.DisplayNameFor(model => model.estado) +
+ +
+ @Html.DisplayFor(model => model.estado) +
+ +
+ + @using (Html.BeginForm()) { + @Html.AntiForgeryToken() + +
+ | + @Html.ActionLink("Lista", "Index") +
+ } +
diff --git a/Renova/Renova/Views/asistencias/Details.cshtml b/Renova/Renova/Views/asistencias/Details.cshtml new file mode 100644 index 0000000..d3c941a --- /dev/null +++ b/Renova/Renova/Views/asistencias/Details.cshtml @@ -0,0 +1,110 @@ +@model RenoEnergy.Models.asistencia + +

Detalles

+ +
+

Asistencias

+
+
+
+ @Html.DisplayNameFor(model => model.alumno.nombre) +
+ +
+ @Html.DisplayFor(model => model.alumno.nombre) +
+ +
+ @Html.DisplayNameFor(model => model.A1) +
+ +
+ @Html.DisplayFor(model => model.A1) +
+ +
+ @Html.DisplayNameFor(model => model.A2) +
+ +
+ @Html.DisplayFor(model => model.A2) +
+ +
+ @Html.DisplayNameFor(model => model.A3) +
+ +
+ @Html.DisplayFor(model => model.A3) +
+ +
+ @Html.DisplayNameFor(model => model.A4) +
+ +
+ @Html.DisplayFor(model => model.A4) +
+ +
+ @Html.DisplayNameFor(model => model.A5) +
+ +
+ @Html.DisplayFor(model => model.A5) +
+ +
+ @Html.DisplayNameFor(model => model.A6) +
+ +
+ @Html.DisplayFor(model => model.A6) +
+ +
+ @Html.DisplayNameFor(model => model.A7) +
+ +
+ @Html.DisplayFor(model => model.A7) +
+ +
+ @Html.DisplayNameFor(model => model.A8) +
+ +
+ @Html.DisplayFor(model => model.A8) +
+ +
+ @Html.DisplayNameFor(model => model.A9) +
+ +
+ @Html.DisplayFor(model => model.A9) +
+ +
+ @Html.DisplayNameFor(model => model.A10) +
+ +
+ @Html.DisplayFor(model => model.A10) +
+ +
+ @Html.DisplayNameFor(model => model.estado) +
+ +
+ @Html.DisplayFor(model => model.estado) +
+ +
+
+

+ @Html.ActionLink("Editar", "Edit", new { id = Model.IDAsistencia }) | + @Html.ActionLink("Lista", "Index") +

diff --git a/Renova/Renova/Views/asistencias/Edit.cshtml b/Renova/Renova/Views/asistencias/Edit.cshtml new file mode 100644 index 0000000..09b1dbe --- /dev/null +++ b/Renova/Renova/Views/asistencias/Edit.cshtml @@ -0,0 +1,120 @@ +@model RenoEnergy.Models.asistencia + + + +

Editar

+ + +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() + +
+

Asistencias

+
+ @Html.ValidationSummary(true, "", new { @class = "text-danger" }) + @Html.HiddenFor(model => model.IDAsistencia) + +
+ @Html.LabelFor(model => model.IDAlumno, "Alumno", htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DisplayFor(model=> model.alumno.nombre, new { htmlAttributes = new { @class = "form-control" } }) + @Html.HiddenFor(model =>model.IDAlumno) +
+
+ +
+ @Html.LabelFor(model => model.A1, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ + @Html.EditorFor(model => model.A1, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A1, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A2, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A2, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A2, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A3, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A3, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A3, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A4, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A4, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A4, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A5, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A5, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A5, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A6, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A6, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A6, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A7, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A7, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A7, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A8, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A8, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A8, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A9, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A9, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A9, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.A10, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.A10, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.A10, "", new { @class = "text-danger" }) +
+
+
+
+ +
+
+
+} + +
+ @Html.ActionLink("Back to List", "Index") +
+ +@section Scripts { + @Scripts.Render("~/bundles/jqueryval") +} diff --git a/Renova/Renova/Views/asistencias/Index.cshtml b/Renova/Renova/Views/asistencias/Index.cshtml new file mode 100644 index 0000000..fa13215 --- /dev/null +++ b/Renova/Renova/Views/asistencias/Index.cshtml @@ -0,0 +1,95 @@ +@model IEnumerable + +@{ + ViewBag.Title = "Index"; +} + +

Asistencias

+ + + + + + + + + + + + + + + + + + +@foreach (var item in Model) { + + + + + + + + + + + + + + + +} + +
+ @Html.DisplayNameFor(model => model.alumno.nombre) + + @Html.DisplayNameFor(model => model.A1) + + @Html.DisplayNameFor(model => model.A2) + + @Html.DisplayNameFor(model => model.A3) + + @Html.DisplayNameFor(model => model.A4) + + @Html.DisplayNameFor(model => model.A5) + + @Html.DisplayNameFor(model => model.A6) + + @Html.DisplayNameFor(model => model.A7) + + @Html.DisplayNameFor(model => model.A8) + + @Html.DisplayNameFor(model => model.A9) + + @Html.DisplayNameFor(model => model.A10) + + @Html.DisplayNameFor(model => model.estado) +
+ @Html.DisplayFor(modelItem => item.alumno.nombre) @Html.DisplayFor(modelItem => item.alumno.apellidos) + + @Html.DisplayFor(modelItem => item.A1) + + @Html.DisplayFor(modelItem => item.A2) + + @Html.DisplayFor(modelItem => item.A3) + + @Html.DisplayFor(modelItem => item.A4) + + @Html.DisplayFor(modelItem => item.A5) + + @Html.DisplayFor(modelItem => item.A6) + + @Html.DisplayFor(modelItem => item.A7) + + @Html.DisplayFor(modelItem => item.A8) + + @Html.DisplayFor(modelItem => item.A9) + + @Html.DisplayFor(modelItem => item.A10) + + @Html.DisplayFor(modelItem => item.estado) + + @Html.ActionLink("Editar", "Edit", new { id=item.IDAsistencia }) | + @Html.ActionLink("Detalles", "Details", new { id=item.IDAsistencia }) +