Ven a la U

En esta sección se atenderán las dudas relacionadas con sistemas de gestión de la calidad, procedimientos, buenas prácticas, normas y todo lo relacionado con aseguramiento de la calidad

Moderator: julianmartinez16

User avatar
MariaIAF
Posts: 25
Joined: Thu Jul 26, 2018 12:12 pm

Preentrega Ven a la U

Post by MariaIAF » Thu Sep 20, 2018 11:04 am

Maria Isabel Arcila Franco
maria.arcilaf@upb.edu.co

Gestión de Calidad de Software
Aplicaciones Móviles

User avatar
Sergio Rodríguez
Posts: 18
Joined: Thu Jul 26, 2018 12:12 pm

Re: Ven a la U

Post by Sergio Rodríguez » Mon Sep 24, 2018 8:27 pm

Sprint 8: 20 de Septiembre- 26 de Septiembre

Sprint Planning

Retroalimentación y corrección de errores
  • Detalle de cursos promocionales 1/7
  • Selección de colores 1/7
  • Corrección de Master Page 1/7
  • Re diseño de los menú de opciones 1/7
  • Cambio de Interfaz de detalle 1/7
  • Pantalla inicio 1/7
  • Imágenes de Implementos 1/7
Backend
  • Creación de proyecto MVC para administración de API por Web 4

Velocidad esperada: 11

¿ Qué hemos hecho?
  • Detalle de cursos promocionales 1/7
  • Selección de colores 1/7
  • Corrección de Master Page 1/7
  • Re diseño de los menú de opciones 1/7
  • Cambio de Interfaz de detalle 1/7
  • Pantalla inicio 1/7
  • Imágenes de Implementos 1/7
¿ Qué vamos a hacer?
Continuar con el sprint planeado

¿Qué dificultades hemos tenido?
Ninguna por el momento

Burndown Chart
Image

Paleta de colores seleccionada
Image

Diagrama de flujo
Image

Evidencias

Detalles
Image

Imágenes de los implementos
Image

Master
Image

Menú
Image

Pantalla inicio y nuevo Login
Image
Gestión de Calidad de Software
Sergio Andrés Rodríguez Galeano
sergio.rodriguezg@upb.edu.co

User avatar
Sergio Rodríguez
Posts: 18
Joined: Thu Jul 26, 2018 12:12 pm

Re: Ven a la U

Post by Sergio Rodríguez » Wed Sep 26, 2018 10:04 pm

Sprint 8: 20 de Septiembre- 26 de Septiembre

¿ Qué hemos hecho?
Creación de proyecto MVC para administración de API por Web

¿ Qué vamos a hacer?
Continuar con las actividades del siguiente sprint

¿Qué dificultades hemos tenido?
Ninguna por el momento

Burndown Chart
Image

Check-list Código
Image

Evidencias

Controladores MVC

CursosPromocionalesController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class CursoPromocionalesController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: CursoPromocionales
        public async Task<ActionResult> Index()
        {
            return View(await db.CursoPromocionals.ToListAsync());
        }

        // GET: CursoPromocionales/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            CursoPromocional cursoPromocional = await db.CursoPromocionals.FindAsync(id);
            if (cursoPromocional == null)
            {
                return HttpNotFound();
            }
            return View(cursoPromocional);
        }

        // GET: CursoPromocionales/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: CursoPromocionales/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "Id,Nombre,IdDia,Hora,IdEspacioCurso,IdInstructor")] CursoPromocional cursoPromocional)
        {
            if (ModelState.IsValid)
            {
                db.CursoPromocionals.Add(cursoPromocional);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(cursoPromocional);
        }

        // GET: CursoPromocionales/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            CursoPromocional cursoPromocional = await db.CursoPromocionals.FindAsync(id);
            if (cursoPromocional == null)
            {
                return HttpNotFound();
            }
            return View(cursoPromocional);
        }

        // POST: CursoPromocionales/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "Id,Nombre,IdDia,Hora,IdEspacioCurso,IdInstructor")] CursoPromocional cursoPromocional)
        {
            if (ModelState.IsValid)
            {
                db.Entry(cursoPromocional).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(cursoPromocional);
        }

        // GET: CursoPromocionales/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            CursoPromocional cursoPromocional = await db.CursoPromocionals.FindAsync(id);
            if (cursoPromocional == null)
            {
                return HttpNotFound();
            }
            return View(cursoPromocional);
        }

        // POST: CursoPromocionales/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            CursoPromocional cursoPromocional = await db.CursoPromocionals.FindAsync(id);
            db.CursoPromocionals.Remove(cursoPromocional);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
DiasController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class DiasController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: Dias
        public async Task<ActionResult> Index()
        {
            return View(await db.Dias.ToListAsync());
        }

        // GET: Dias/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Dia dia = await db.Dias.FindAsync(id);
            if (dia == null)
            {
                return HttpNotFound();
            }
            return View(dia);
        }

        // GET: Dias/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: Dias/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdDia,Dia1")] Dia dia)
        {
            if (ModelState.IsValid)
            {
                db.Dias.Add(dia);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(dia);
        }

        // GET: Dias/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Dia dia = await db.Dias.FindAsync(id);
            if (dia == null)
            {
                return HttpNotFound();
            }
            return View(dia);
        }

        // POST: Dias/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdDia,Dia1")] Dia dia)
        {
            if (ModelState.IsValid)
            {
                db.Entry(dia).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(dia);
        }

        // GET: Dias/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Dia dia = await db.Dias.FindAsync(id);
            if (dia == null)
            {
                return HttpNotFound();
            }
            return View(dia);
        }

        // POST: Dias/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            Dia dia = await db.Dias.FindAsync(id);
            db.Dias.Remove(dia);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
EspacioCursosController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class EspacioCursosController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: EspacioCursos
        public async Task<ActionResult> Index()
        {
            return View(await db.EspacioCursoes.ToListAsync());
        }

        // GET: EspacioCursos/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            EspacioCurso espacioCurso = await db.EspacioCursoes.FindAsync(id);
            if (espacioCurso == null)
            {
                return HttpNotFound();
            }
            return View(espacioCurso);
        }

        // GET: EspacioCursos/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: EspacioCursos/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdEspacioCurso,EspacioCurso1")] EspacioCurso espacioCurso)
        {
            if (ModelState.IsValid)
            {
                db.EspacioCursoes.Add(espacioCurso);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(espacioCurso);
        }

        // GET: EspacioCursos/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            EspacioCurso espacioCurso = await db.EspacioCursoes.FindAsync(id);
            if (espacioCurso == null)
            {
                return HttpNotFound();
            }
            return View(espacioCurso);
        }

        // POST: EspacioCursos/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdEspacioCurso,EspacioCurso1")] EspacioCurso espacioCurso)
        {
            if (ModelState.IsValid)
            {
                db.Entry(espacioCurso).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(espacioCurso);
        }

        // GET: EspacioCursos/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            EspacioCurso espacioCurso = await db.EspacioCursoes.FindAsync(id);
            if (espacioCurso == null)
            {
                return HttpNotFound();
            }
            return View(espacioCurso);
        }

        // POST: EspacioCursos/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            EspacioCurso espacioCurso = await db.EspacioCursoes.FindAsync(id);
            db.EspacioCursoes.Remove(espacioCurso);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
EspaciosController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class EspaciosController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: Espacios
        public async Task<ActionResult> Index()
        {
            return View(await db.Espacios.ToListAsync());
        }

        // GET: Espacios/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Espacio espacio = await db.Espacios.FindAsync(id);
            if (espacio == null)
            {
                return HttpNotFound();
            }
            return View(espacio);
        }

        // GET: Espacios/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: Espacios/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdEspacio,IdTipoEspacio,Disponible,Nombre")] Espacio espacio)
        {
            if (ModelState.IsValid)
            {
                db.Espacios.Add(espacio);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(espacio);
        }

        // GET: Espacios/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Espacio espacio = await db.Espacios.FindAsync(id);
            if (espacio == null)
            {
                return HttpNotFound();
            }
            return View(espacio);
        }

        // POST: Espacios/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdEspacio,IdTipoEspacio,Disponible,Nombre")] Espacio espacio)
        {
            if (ModelState.IsValid)
            {
                db.Entry(espacio).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(espacio);
        }

        // GET: Espacios/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Espacio espacio = await db.Espacios.FindAsync(id);
            if (espacio == null)
            {
                return HttpNotFound();
            }
            return View(espacio);
        }

        // POST: Espacios/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            Espacio espacio = await db.Espacios.FindAsync(id);
            db.Espacios.Remove(espacio);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
EventosController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class EventosController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: Eventos
        public async Task<ActionResult> Index()
        {
            return View(await db.Eventoes.ToListAsync());
        }

        // GET: Eventos/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Evento evento = await db.Eventoes.FindAsync(id);
            if (evento == null)
            {
                return HttpNotFound();
            }
            return View(evento);
        }

        // GET: Eventos/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: Eventos/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "Id,IdTipoEvento,FechaEvento,Lugar,DetalleEvento,Nombre,URLImagen,PublicoDirigido")] Evento evento)
        {
            if (ModelState.IsValid)
            {
                db.Eventoes.Add(evento);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(evento);
        }

        // GET: Eventos/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Evento evento = await db.Eventoes.FindAsync(id);
            if (evento == null)
            {
                return HttpNotFound();
            }
            return View(evento);
        }

        // POST: Eventos/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "Id,IdTipoEvento,FechaEvento,Lugar,DetalleEvento,Nombre,URLImagen,PublicoDirigido")] Evento evento)
        {
            if (ModelState.IsValid)
            {
                db.Entry(evento).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(evento);
        }

        // GET: Eventos/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Evento evento = await db.Eventoes.FindAsync(id);
            if (evento == null)
            {
                return HttpNotFound();
            }
            return View(evento);
        }

        // POST: Eventos/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            Evento evento = await db.Eventoes.FindAsync(id);
            db.Eventoes.Remove(evento);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
ImplementosController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class ImplementosController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: Implementos
        public async Task<ActionResult> Index()
        {
            return View(await db.Implementoes.ToListAsync());
        }

        // GET: Implementos/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Implemento implemento = await db.Implementoes.FindAsync(id);
            if (implemento == null)
            {
                return HttpNotFound();
            }
            return View(implemento);
        }

        // GET: Implementos/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: Implementos/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdImplemento,IdTipoImplemento,Nombre,Cantidad,URLImagen")] Implemento implemento)
        {
            if (ModelState.IsValid)
            {
                db.Implementoes.Add(implemento);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(implemento);
        }

        // GET: Implementos/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Implemento implemento = await db.Implementoes.FindAsync(id);
            if (implemento == null)
            {
                return HttpNotFound();
            }
            return View(implemento);
        }

        // POST: Implementos/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdImplemento,IdTipoImplemento,Nombre,Cantidad,URLImagen")] Implemento implemento)
        {
            if (ModelState.IsValid)
            {
                db.Entry(implemento).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(implemento);
        }

        // GET: Implementos/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Implemento implemento = await db.Implementoes.FindAsync(id);
            if (implemento == null)
            {
                return HttpNotFound();
            }
            return View(implemento);
        }

        // POST: Implementos/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            Implemento implemento = await db.Implementoes.FindAsync(id);
            db.Implementoes.Remove(implemento);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
InstructoresController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class InstructoresController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: Instructores
        public async Task<ActionResult> Index()
        {
            return View(await db.Instructors.ToListAsync());
        }

        // GET: Instructores/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Instructor instructor = await db.Instructors.FindAsync(id);
            if (instructor == null)
            {
                return HttpNotFound();
            }
            return View(instructor);
        }

        // GET: Instructores/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: Instructores/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdInstructor,Nombre")] Instructor instructor)
        {
            if (ModelState.IsValid)
            {
                db.Instructors.Add(instructor);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(instructor);
        }

        // GET: Instructores/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Instructor instructor = await db.Instructors.FindAsync(id);
            if (instructor == null)
            {
                return HttpNotFound();
            }
            return View(instructor);
        }

        // POST: Instructores/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdInstructor,Nombre")] Instructor instructor)
        {
            if (ModelState.IsValid)
            {
                db.Entry(instructor).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(instructor);
        }

        // GET: Instructores/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Instructor instructor = await db.Instructors.FindAsync(id);
            if (instructor == null)
            {
                return HttpNotFound();
            }
            return View(instructor);
        }

        // POST: Instructores/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            Instructor instructor = await db.Instructors.FindAsync(id);
            db.Instructors.Remove(instructor);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
PersonasController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class PersonasController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: Personas
        public async Task<ActionResult> Index()
        {
            return View(await db.Personas.ToListAsync());
        }

        // GET: Personas/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Persona persona = await db.Personas.FindAsync(id);
            if (persona == null)
            {
                return HttpNotFound();
            }
            return View(persona);
        }

        // GET: Personas/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: Personas/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdPersona,IdInstitucional,IdVinculo,Nombre,Apellido,Correo,CantidadMultas,Telefono")] Persona persona)
        {
            if (ModelState.IsValid)
            {
                db.Personas.Add(persona);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(persona);
        }

        // GET: Personas/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Persona persona = await db.Personas.FindAsync(id);
            if (persona == null)
            {
                return HttpNotFound();
            }
            return View(persona);
        }

        // POST: Personas/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdPersona,IdInstitucional,IdVinculo,Nombre,Apellido,Correo,CantidadMultas,Telefono")] Persona persona)
        {
            if (ModelState.IsValid)
            {
                db.Entry(persona).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(persona);
        }

        // GET: Personas/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Persona persona = await db.Personas.FindAsync(id);
            if (persona == null)
            {
                return HttpNotFound();
            }
            return View(persona);
        }

        // POST: Personas/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            Persona persona = await db.Personas.FindAsync(id);
            db.Personas.Remove(persona);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
PisicinasControllers.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class PiscinasController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: Piscinas
        public async Task<ActionResult> Index()
        {
            return View(await db.Piscinas.ToListAsync());
        }

        // GET: Piscinas/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Piscina piscina = await db.Piscinas.FindAsync(id);
            if (piscina == null)
            {
                return HttpNotFound();
            }
            return View(piscina);
        }

        // GET: Piscinas/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: Piscinas/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "Id,IdDia,Hora,EspacioDispoible,Observacion")] Piscina piscina)
        {
            if (ModelState.IsValid)
            {
                db.Piscinas.Add(piscina);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(piscina);
        }

        // GET: Piscinas/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Piscina piscina = await db.Piscinas.FindAsync(id);
            if (piscina == null)
            {
                return HttpNotFound();
            }
            return View(piscina);
        }

        // POST: Piscinas/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "Id,IdDia,Hora,EspacioDispoible,Observacion")] Piscina piscina)
        {
            if (ModelState.IsValid)
            {
                db.Entry(piscina).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(piscina);
        }

        // GET: Piscinas/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Piscina piscina = await db.Piscinas.FindAsync(id);
            if (piscina == null)
            {
                return HttpNotFound();
            }
            return View(piscina);
        }

        // POST: Piscinas/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            Piscina piscina = await db.Piscinas.FindAsync(id);
            db.Piscinas.Remove(piscina);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
ReservasController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class ReservasController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: Reservas
        public async Task<ActionResult> Index()
        {
            return View(await db.Reservas.ToListAsync());
        }

        // GET: Reservas/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Reserva reserva = await db.Reservas.FindAsync(id);
            if (reserva == null)
            {
                return HttpNotFound();
            }
            return View(reserva);
        }

        // GET: Reservas/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: Reservas/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdReserva,HoraFechaReserva,IdPersona,IdEspacio,IdImplemento,Estado")] Reserva reserva)
        {
            if (ModelState.IsValid)
            {
                db.Reservas.Add(reserva);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(reserva);
        }

        // GET: Reservas/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Reserva reserva = await db.Reservas.FindAsync(id);
            if (reserva == null)
            {
                return HttpNotFound();
            }
            return View(reserva);
        }

        // POST: Reservas/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdReserva,HoraFechaReserva,IdPersona,IdEspacio,IdImplemento,Estado")] Reserva reserva)
        {
            if (ModelState.IsValid)
            {
                db.Entry(reserva).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(reserva);
        }

        // GET: Reservas/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Reserva reserva = await db.Reservas.FindAsync(id);
            if (reserva == null)
            {
                return HttpNotFound();
            }
            return View(reserva);
        }

        // POST: Reservas/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            Reserva reserva = await db.Reservas.FindAsync(id);
            db.Reservas.Remove(reserva);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
TipoEspaciosController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class TipoEspaciosController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: TipoEspacios
        public async Task<ActionResult> Index()
        {
            return View(await db.TipoEspacios.ToListAsync());
        }

        // GET: TipoEspacios/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            TipoEspacio tipoEspacio = await db.TipoEspacios.FindAsync(id);
            if (tipoEspacio == null)
            {
                return HttpNotFound();
            }
            return View(tipoEspacio);
        }

        // GET: TipoEspacios/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: TipoEspacios/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdTipoEspacio,TipoEspacio1")] TipoEspacio tipoEspacio)
        {
            if (ModelState.IsValid)
            {
                db.TipoEspacios.Add(tipoEspacio);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(tipoEspacio);
        }

        // GET: TipoEspacios/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            TipoEspacio tipoEspacio = await db.TipoEspacios.FindAsync(id);
            if (tipoEspacio == null)
            {
                return HttpNotFound();
            }
            return View(tipoEspacio);
        }

        // POST: TipoEspacios/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdTipoEspacio,TipoEspacio1")] TipoEspacio tipoEspacio)
        {
            if (ModelState.IsValid)
            {
                db.Entry(tipoEspacio).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(tipoEspacio);
        }

        // GET: TipoEspacios/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            TipoEspacio tipoEspacio = await db.TipoEspacios.FindAsync(id);
            if (tipoEspacio == null)
            {
                return HttpNotFound();
            }
            return View(tipoEspacio);
        }

        // POST: TipoEspacios/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            TipoEspacio tipoEspacio = await db.TipoEspacios.FindAsync(id);
            db.TipoEspacios.Remove(tipoEspacio);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
TipoEventosController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class TipoEventosController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: TipoEventos
        public async Task<ActionResult> Index()
        {
            return View(await db.TipoEventoes.ToListAsync());
        }

        // GET: TipoEventos/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            TipoEvento tipoEvento = await db.TipoEventoes.FindAsync(id);
            if (tipoEvento == null)
            {
                return HttpNotFound();
            }
            return View(tipoEvento);
        }

        // GET: TipoEventos/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: TipoEventos/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdTipoEvento,TipoEvento1")] TipoEvento tipoEvento)
        {
            if (ModelState.IsValid)
            {
                db.TipoEventoes.Add(tipoEvento);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(tipoEvento);
        }

        // GET: TipoEventos/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            TipoEvento tipoEvento = await db.TipoEventoes.FindAsync(id);
            if (tipoEvento == null)
            {
                return HttpNotFound();
            }
            return View(tipoEvento);
        }

        // POST: TipoEventos/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdTipoEvento,TipoEvento1")] TipoEvento tipoEvento)
        {
            if (ModelState.IsValid)
            {
                db.Entry(tipoEvento).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(tipoEvento);
        }

        // GET: TipoEventos/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            TipoEvento tipoEvento = await db.TipoEventoes.FindAsync(id);
            if (tipoEvento == null)
            {
                return HttpNotFound();
            }
            return View(tipoEvento);
        }

        // POST: TipoEventos/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            TipoEvento tipoEvento = await db.TipoEventoes.FindAsync(id);
            db.TipoEventoes.Remove(tipoEvento);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
TipoImplementosController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class TipoImplementosController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: TipoImplementos
        public async Task<ActionResult> Index()
        {
            return View(await db.TipoImplementoes.ToListAsync());
        }

        // GET: TipoImplementos/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            TipoImplemento tipoImplemento = await db.TipoImplementoes.FindAsync(id);
            if (tipoImplemento == null)
            {
                return HttpNotFound();
            }
            return View(tipoImplemento);
        }

        // GET: TipoImplementos/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: TipoImplementos/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdTipoImplemento,TipoImplemento1")] TipoImplemento tipoImplemento)
        {
            if (ModelState.IsValid)
            {
                db.TipoImplementoes.Add(tipoImplemento);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(tipoImplemento);
        }

        // GET: TipoImplementos/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            TipoImplemento tipoImplemento = await db.TipoImplementoes.FindAsync(id);
            if (tipoImplemento == null)
            {
                return HttpNotFound();
            }
            return View(tipoImplemento);
        }

        // POST: TipoImplementos/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdTipoImplemento,TipoImplemento1")] TipoImplemento tipoImplemento)
        {
            if (ModelState.IsValid)
            {
                db.Entry(tipoImplemento).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(tipoImplemento);
        }

        // GET: TipoImplementos/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            TipoImplemento tipoImplemento = await db.TipoImplementoes.FindAsync(id);
            if (tipoImplemento == null)
            {
                return HttpNotFound();
            }
            return View(tipoImplemento);
        }

        // POST: TipoImplementos/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            TipoImplemento tipoImplemento = await db.TipoImplementoes.FindAsync(id);
            db.TipoImplementoes.Remove(tipoImplemento);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
VinculosController.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class VinculosController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: Vinculos
        public async Task<ActionResult> Index()
        {
            return View(await db.Vinculoes.ToListAsync());
        }

        // GET: Vinculos/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Vinculo vinculo = await db.Vinculoes.FindAsync(id);
            if (vinculo == null)
            {
                return HttpNotFound();
            }
            return View(vinculo);
        }

        // GET: Vinculos/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: Vinculos/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdVinculo,Vinculo1")] Vinculo vinculo)
        {
            if (ModelState.IsValid)
            {
                db.Vinculoes.Add(vinculo);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(vinculo);
        }

        // GET: Vinculos/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Vinculo vinculo = await db.Vinculoes.FindAsync(id);
            if (vinculo == null)
            {
                return HttpNotFound();
            }
            return View(vinculo);
        }

        // POST: Vinculos/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdVinculo,Vinculo1")] Vinculo vinculo)
        {
            if (ModelState.IsValid)
            {
                db.Entry(vinculo).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(vinculo);
        }

        // GET: Vinculos/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Vinculo vinculo = await db.Vinculoes.FindAsync(id);
            if (vinculo == null)
            {
                return HttpNotFound();
            }
            return View(vinculo);
        }

        // POST: Vinculos/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            Vinculo vinculo = await db.Vinculoes.FindAsync(id);
            db.Vinculoes.Remove(vinculo);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}
Gestión de Calidad de Software
Sergio Andrés Rodríguez Galeano
sergio.rodriguezg@upb.edu.co

User avatar
MariaIAF
Posts: 25
Joined: Thu Jul 26, 2018 12:12 pm

Re: Ven a la U

Post by MariaIAF » Thu Sep 27, 2018 5:50 pm

Sprint 9: Septiembre 27-Octubre 10

Sprint Planning
Para este sprint realizaremos todas las funcionalidades de reservas (Crear, modificar, eliminar y consultar). Que se dividen en dos módulos

Módulo de Reservas: 7
  • Creación de la interfaz para reservar: 1/7
  • Creación de controladores para CRUD de reservas: 2/7
  • Implementación de las funcionalidades de reserva: 2/7
  • Implementación de la funcionalidad confirmación de reserva. 1/7
  • Asociar implementos a reservas: 1/7
Módulo de estado de cuenta: 5
  • Creación de la interfaz de estado de cuenta: 1/5
  • Consulta de reservas activas, pasadas y canceladas: 1/5
  • Consulta de implementos prestados y multas:1/5
  • Opción de cancelar reserva: 1/5
  • Opción de modificar reserva: 1/5
Velocidad esperada: 12
Maria Isabel Arcila Franco
maria.arcilaf@upb.edu.co

Gestión de Calidad de Software
Aplicaciones Móviles

User avatar
MariaIAF
Posts: 25
Joined: Thu Jul 26, 2018 12:12 pm

Re: Ven a la U

Post by MariaIAF » Mon Oct 01, 2018 8:03 pm

Sprint 9: Septiembre 27-Octubre 10
Velocidad: 12

¿Qué hemos hecho?
  • Interfaz de reserva
  • Interfaz de estado de cuenta
  • Controladores de reserva
¿Qué vamos a hacer?
Continuar con las actividades del backlog: Implementación de las diferentes funcionalidades de Reservas y Estado de Cuenta

¿Qué dificultades hemos tenido?
Ninguna

Burndown Chart
Image

Checklist
Diseño
Image
Código
Image

Diagramas
Diagrama de Casos de Uso: Reservas
Image

Diagrama de Casos de Uso: Estado de Cuenta
Image

Diagrama Entidad Relación
Image

Diagrama de Flujo: Reservas
Image

Diagrama de Flujo: Estado de Cuenta
Image

Diagrama de Secuencias: Reservas
Image

Diagrama de Secuencias: Estado de Cuenta
Image

Evidencias

Interfaz Reservas
Image
Interfaz Estado de Cuenta
Image

Controlador Espacios

Code: Select all

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http;
using System.Web.Http.Description;
using VenALaU.Common.Models;
using VenALaU.Domain.Models;

namespace VenALaU.API.Controllers
{
    [RoutePrefix("api/Espacio")]
    public class EspaciosController : ApiController
    {
        private DataContext db = new DataContext();
        /// <summary>
        /// Método para consultar todos los Espacios deportivos
        /// </summary>
        /// <returns>Mensaje satisfactorio y todos los espacios en caso de que logre consultar
        /// Mensaje de error en caso de que no logre consultar todos los espacios</returns>
        [HttpGet]
        [Route("findall")]
        public HttpResponseMessage findAll()
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.Espacios.Select(p => new { p.IdEspacio, p.IdTipoEspacio,p.Nombre}).ToList()));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }

        /// <summary>
        /// Método para consultar un Espacio
        /// </summary>
        /// <param name="id">id del espacio</param>
        /// <returns>Mensaje satisfactorio y todos los espacios en caso de que logre
        /// consultar un espacio.
        /// Mensaje de error en caso de que no logre consultar un espacio</returns>
        [HttpGet]
        [Route("find/{id}")]
        public HttpResponseMessage find(int id)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.Espacios.Select(p => new { p.IdEspacio, p.IdTipoEspacio, p.Nombre }).Where(p => p.IdEspacio == id)));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }
        /// <summary>
        /// Obtener un espacio por tipo de espacio
        /// </summary>
        /// <param name="idTipoEspacio">ID del tipo de espacio</param>
        /// <returns>Mensaje satisfactorio con lo datos si logra obtenerlos
        /// Mensaje de error si no logra obtenerlos</returns>
        [HttpGet]
        [Route("findByType/{idTipoEspacio}")]
        public HttpResponseMessage findByType(int idTipoEspacio)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.Espacios.Select(p => new { p.IdEspacio, p.IdTipoEspacio, p.Nombre }).Where(p => p.IdTipoEspacio == idTipoEspacio)));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }


    }
}
Controlador Horas

Code: Select all

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http;
using System.Web.Http.Description;
using VenALaU.Common.Models;
using VenALaU.Domain.Models;

namespace VenALaU.API.Controllers
{
    [RoutePrefix("api/Hora")]
    public class HorasController : ApiController
    {
        private DataContext db = new DataContext();
        /// <summary>
        /// Método para consultar todas las horas 
        /// </summary>
        /// <returns>Mensaje satisfactorio y todas las horas en caso de que logre
        /// consultar todas las horas
        /// Mensaje de error en caso de que no logre consultar todas las horas</returns>
        [HttpGet]
        [Route("findall")]
        public HttpResponseMessage findAll()
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.Horas.Select(p => new { p.IdHora,p.Hora1 }).ToList()));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }

        /// <summary>
        /// Método para consultar una hora
        /// </summary>
        /// <param name="id">id de la hora</param>
        /// <returns>Mensaje satisfactorio y todas las horas en caso de que logre consultarlas
        /// Mensaje de error en caso de que no logre consultar una hora</returns>
        [HttpGet]
        [Route("find/{id}")]
        public HttpResponseMessage find(int id)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.Horas.Select(p => new { p.IdHora, p.Hora1 }).Where(p => p.IdHora == id)));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }

    }
}
Controlador Implementos

Code: Select all

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http;
using System.Web.Http.Description;
using VenALaU.Common.Models;
using VenALaU.Domain.Models;

namespace VenALaU.API.Controllers
{
    [RoutePrefix("api/Implemento")]
    public class ImplementosController : ApiController
    {
        private DataContext db = new DataContext();

        /// <summary>
        /// Método que encuentra todos los Implementos
        /// </summary>
        /// <returns>Retorna un mensaje satisfactorio y despliega toda la lista en caso
        /// de que se consulten todos los registros.
        /// Retorna un mensaje de error en caso de que no se logre consultar</returns>
        [HttpGet]
        [Route("findall")]
        public HttpResponseMessage findAll()
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.Implementoes.Select(p => new { p.IdImplemento, p.IdTipoImplemento, p.Nombre, p.Cantidad, p.URLImagen }).ToList()));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }

        /// <summary>
        /// Método para consultar por id del implemento
        /// </summary>
        /// <param name="id">id del implemento a consultar</param>
        /// <returns>Mensaje de satisfacción y el evento respectivo si logra consultarlo
        /// Mensaje de error si no logra consultar</returns>
        [HttpGet]
        [Route("find/{id}")]
        public HttpResponseMessage find(int id)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.Implementoes.Select(p => new { p.IdImplemento, p.IdTipoImplemento, p.Nombre, p.Cantidad, p.URLImagen }).Where(p => p.IdImplemento == id)));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }
        /// <summary>
        /// Obtener un curso por el tipo de implemento
        /// </summary>
        /// <param name="idTipoImplemento">id del tipo implemento</param>
        /// <returns>Mensaje satisfactorio con lo datos si logra obtenerlos
        /// Mensaje de error si no logra obtenerlos</returns>
        [HttpGet]
        [Route("findByType/{idTipoImplemento}")]
        public HttpResponseMessage findByType(int idTipoImplemento)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.Implementoes.Select(p => new { p.IdImplemento, p.IdTipoImplemento, p.Nombre, p.Cantidad, p.URLImagen }).Where(p => p.IdTipoImplemento == idTipoImplemento)));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }
        /// <summary>
        /// Método para crear un implemento
        /// </summary>
        /// <param name="implemento">implemento a crear</param>
        /// <returns>Retorna error en caso de que no se inserte, o correcto si se inserta</returns>
        [HttpPost]
        [Route("create")]
        public HttpResponseMessage create(Implemento imlpemento)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                db.Implementoes.Add(new Implemento
                {
                    IdImplemento = imlpemento.IdImplemento,
                    IdTipoImplemento = imlpemento.IdTipoImplemento,
                    Nombre = imlpemento.Nombre,
                    Cantidad = imlpemento.Cantidad,
                    URLImagen = imlpemento.URLImagen,

                });
                db.SaveChanges();
                return response;

            }
            catch
            {

                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }

        }
    }
}
Controlador info Reservas

Code: Select all

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http;
using System.Web.Http.Description;
using VenALaU.Common.Models;
using VenALaU.Domain.Models;

namespace VenALaU.API.Controllers
{
    [RoutePrefix("api/InfoReserva")]
    public class InfoReservasController : ApiController
    {
        private DataContext db = new DataContext();
        [HttpGet]
        [Route("findall")]
        public HttpResponseMessage findAll()
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.InfoReservas.Select(p => new { p.Id, p.IdPrestamoImplemento, p.IdPersona, p.IdReserva}).ToList()));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }

        /// <summary>
        /// Método para consultar una Reserva asociada a una persona
        /// </summary>
        /// <param name="id">id de la reserva</param>
        /// <returns>Mensaje satisfactorio y todos las reservas en caso de que logre
        /// consultar una reserva.
        /// Mensaje de error en caso de que no logre consultar una reserva</returns>
        [HttpGet]
        [Route("find/{id}")]
        public HttpResponseMessage find(int id)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.InfoReservas.Select(p => new { p.Id, p.IdPrestamoImplemento, p.IdPersona, p.IdReserva }).Where(p => p.Id == id)));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }

        /// <summary>
        /// Método para crear una reserva a una persona
        /// </summary>
        /// <param name="infoReserva">Reserva del modelo</param>
        /// <returns>Retorna mensaje positivo si logra insertar el modelo.
        /// Mensaje negativo si no lo lora insertar</returns>
        [HttpPost]
        [Route("create")]
        public HttpResponseMessage create(InfoReserva infoReserva)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                db.InfoReservas.Add(new InfoReserva
                {

                    Id = infoReserva.IdReserva,
                    IdPrestamoImplemento = infoReserva.IdPrestamoImplemento,
                    IdPersona = infoReserva.IdPersona,
                    IdReserva = infoReserva.IdReserva,
                });
                db.SaveChanges();
                return response;

            }
            catch
            {

                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }

        }

        [HttpDelete]
        [Route("delete")]
        public HttpResponseMessage delete(int idRes)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                db.InfoReservas.Remove(db.InfoReservas.SingleOrDefault(p => p.Id == idRes));
                return response;
            }
            catch
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }

    }
}
Controlador Reservas

Code: Select all

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http;
using System.Web.Http.Description;
using VenALaU.Common.Models;
using VenALaU.Domain.Models;

namespace VenALaU.API.Controllers
{
    [RoutePrefix("api/Reserva")]
    public class ReservasController : ApiController
    {
        private DataContext db = new DataContext();
        [HttpGet]
        [Route("findall")]
        public HttpResponseMessage findAll()
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.Reservas.Select(p => new { p.IdReserva, p.IdEspacio, p.Disponible, p.IdHora, p.Fecha}).ToList()));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }

        /// <summary>
        /// Método para consultar una Reserva
        /// </summary>
        /// <param name="id">id de la reserva</param>
        /// <returns>Mensaje satisfactorio y todos las reservas en caso de que logre
        /// consultar una reserva.
        /// Mensaje de error en caso de que no logre consultar una reserva</returns>
        [HttpGet]
        [Route("find/{id}")]
        public HttpResponseMessage find(int id)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.Reservas.Select(p => new { p.IdReserva, p.IdEspacio, p.Disponible, p.IdHora, p.Fecha }).Where(p => p.IdReserva == id)));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }

        /// <summary>
        /// Método para crear una reserva
        /// </summary>
        /// <param name="reserva">Vinculo del modelo</param>
        /// <returns>Retorna mensaje positivo si logra insertar el modelo.
        /// Mensaje negativo si no lo lora insertar</returns>
        [HttpPost]
        [Route("create")]
        public HttpResponseMessage create(Reserva reserva)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                db.Reservas.Add(new Reserva
                {
                    
                    IdReserva = reserva.IdReserva,
                    IdEspacio = reserva.IdEspacio,
                    Disponible = reserva.Disponible,
                    IdHora = reserva.IdHora,
                    Fecha = reserva.Fecha
                });
                db.SaveChanges();
                return response;

            }
            catch
            {

                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }

        }

    }    
}
Controlador Préstamo Implementos

Code: Select all

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http;
using System.Web.Http.Description;
using VenALaU.Common.Models;
using VenALaU.Domain.Models;

namespace VenALaU.API.Controllers
{
    [RoutePrefix("api/PrestamoImplemento")]
    public class PrestamoImplementosController : ApiController
    {
        private DataContext db = new DataContext();

        /// <summary>
        /// Método para consultar todos los implementos prestados en una reserva
        /// </summary>
        /// <returns>Mensaje satisfactorio y todos los implementos en caso de que logre consultar
        /// Mensaje de error en caso de que no logre consultar todos los implementos</returns>
        [HttpGet]
        [Route("findall")]
        public HttpResponseMessage findAll()
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.PrestamoImplementoes.Select(p => new { p.IdPrestamoImplemento,p.IdImplemento,p.CantidadPrestada }).ToList()));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }

        /// <summary>
        /// Método para consultar un implemento
        /// </summary>
        /// <param name="id">id del implemento prestado</param>
        /// <returns>Mensaje satisfactorio y todos los implementos prestados en caso de que logre
        /// consultar un implemento
        /// Mensaje de error en caso de que no logre consultar un implemento</returns>
        [HttpGet]
        [Route("find/{id}")]
        public HttpResponseMessage find(int id)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.PrestamoImplementoes.Select(p => new { p.IdPrestamoImplemento, p.IdImplemento, p.CantidadPrestada }).Where(p => p.IdPrestamoImplemento == id)));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }
        /// <summary>
        /// Obtener un espacio por Implemento
        /// </summary>
        /// <param name="idImplemento">ID del implemento</param>
        /// <returns>Mensaje satisfactorio con lo datos si logra obtenerlos
        /// Mensaje de error si no logra obtenerlos</returns>
        [HttpGet]
        [Route("findByType/{idImplemento}")]
        public HttpResponseMessage findByType(int idImplemento)
        {
            try
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(db.PrestamoImplementoes.Select(p => new { p.IdPrestamoImplemento, p.IdImplemento, p.CantidadPrestada }).Where(p => p.IdImplemento == idImplemento)));

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                return response;
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadGateway);
            }
        }
    }
}
Maria Isabel Arcila Franco
maria.arcilaf@upb.edu.co

Gestión de Calidad de Software
Aplicaciones Móviles

User avatar
MariaIAF
Posts: 25
Joined: Thu Jul 26, 2018 12:12 pm

Re: Ven a la U

Post by MariaIAF » Thu Oct 04, 2018 10:46 am

Sprint 9: Septiembre 27-Octubre 10
Velocidad: 12

¿Qué hemos hecho?
Hemos adelantado trabajo de las funcionalidades de reserva y estado de cuenta

¿Qué vamos a hacer?
Continuar con el trabajo de las funcionalidades

¿Qué dificultades hemos tenido?
Esta semana hemos tenido alta carga académica en otras materias, por lo que no hemos podido presentar un avance significativo en el sprint.

Burndown Chart
Image

Evidencias
Picker con las horas
Image
Maria Isabel Arcila Franco
maria.arcilaf@upb.edu.co

Gestión de Calidad de Software
Aplicaciones Móviles

User avatar
Sergio Rodríguez
Posts: 18
Joined: Thu Jul 26, 2018 12:12 pm

Re: Ven a la U

Post by Sergio Rodríguez » Tue Oct 09, 2018 12:44 am

Sprint 9: Septiembre 27-Octubre 10
Velocidad: 12

¿Qué hemos hecho?
  • Implementación de las funcionalidades de reserva
  • Asociar un implemento a una reserva
  • Desplegar reservas activas de un usuario en el estado de cuenta
¿Qué vamos a hacer?
Continuar con las actividades del backlog: Implementación de las diferentes funcionalidades de Reservas y Estado de Cuenta

¿Qué dificultades hemos tenido?
Ninguna

Burndown Chart
Image

Evidencias

Picker con Espacios
Image

Picker con implementos
Image

Estado de cuenta
Image

Reservas activas
Image

Reserva satisfactoria
Image

Estado de cuenta y reservas activas
Image

ReservationViewModel

Code: Select all

using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text;
using System.Windows.Input;
using VenALaU.Models;
using VenALaU.Services;
using VenALaU.Views;
using Xamarin.Forms;

namespace VenALaU.ViewModels
{
    public class ReservationViewModel : BaseViewModel
    {
        #region Services
        private ApiService apiService;
        #endregion

        #region Attributes
        private ObservableCollection<HourViewModel> hours;
        private ObservableCollection<SpacesViewModel> spaces;
        private ObservableCollection<ImplementItemViewModel> implements;
        private DialogService dialogService;
        private int hourId;
        private string hour1;
        private int selectedHour;
        private int spaceId;
        private string spaceName;
        private int selectedSpace;
        private int implementId;
        private string implementName;
        private int selectedImplement;
        private bool isRunning;
        private bool isEnabled;
        private string date;
        private int reservationId;
        private int takenQuantity;
        #endregion
        #region Events
        public event PropertyChangedEventHandler PropertyChanged;
        #endregion
        #region Properties
        public ObservableCollection<HourViewModel> Hours
        {
            get { return this.hours; }
            set { SetValue(ref this.hours, value); }
        }
        public ObservableCollection<SpacesViewModel> Spaces
        {
            get { return this.spaces; }
            set { SetValue(ref this.spaces, value); }
        }
        public ObservableCollection<ImplementItemViewModel> Implements
        {
            get { return this.implements; }
            set { SetValue(ref this.implements, value); }
        }
        public int HourId
        {
            set
            {
                if (hourId != value)
                {
                    hourId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("HourId"));
                }
            }
            get
            {
                return hourId;
            }
        }
        public string Hour1
        {
            set
            {
                if (hour1 != value)
                {
                    hour1 = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Hour1"));
                }
            }
            get
            {
                return hour1;
            }
        }
        public string Date
        {
            set
            {
                if (date != value)
                {
                    date = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Date"));
                }
            }
            get
            {
                return date;
            }
        }
        public int SpaceId
        {
            set
            {
                if (spaceId != value)
                {
                    spaceId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SpaceId"));
                }
            }
            get
            {
                return spaceId;
            }
        }
        public string SpaceName
        {
            set
            {
                if (spaceName != value)
                {
                    spaceName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SpaceName"));
                }
            }
            get
            {
                return spaceName;
            }
        }
        public int ImplementId
        {
            set
            {
                if (implementId != value)
                {
                    implementId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ImplementId"));
                }
            }
            get
            {
                return implementId;
            }
        }
        public string ImplementName
        {
            set
            {
                if (implementName != value)
                {
                    implementName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ImplementName"));
                }
            }
            get
            {
                return implementName;
            }
        }
        public int SelectedHour
        {
            set
            {
                if (selectedHour != value)
                {
                    selectedHour = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedHour"));
                }


            }
            get
            {
                return (selectedHour + 1);
            }
        }
        public int  SelectedSpace
        {
            set
            {
                if (selectedSpace != value)
                {
                    selectedSpace = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedSpace"));
                }


            }
            get
            {
                return (selectedSpace + 1);
            }
        }
        public int SelectedImplement
        {
            set
            {
                if (selectedImplement != value)
                {
                    selectedImplement = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedImplement"));
                }


            }
            get
            {
                return (selectedImplement + 1);
            }
        }
        public bool IsRunning
        {
            set
            {
                if (isRunning != value)
                {
                    isRunning = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsRunning"));
                }
            }
            get
            {
                return isRunning;
            }
        }
        public bool IsEnabled
        {
            set
            {
                if (isEnabled != value)
                {
                    isEnabled = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsEnabled"));
                }
            }
            get
            {
                return isEnabled;
            }
        }
        public int ReservationId
        {
            set
            {
                if (reservationId != value)
                {
                    reservationId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ReservationId"));
                }
            }
            get
            {
                return reservationId;
            }
        }
        public int TakenQuantity
        {
            set
            {
                if (takenQuantity != value)
                {
                    takenQuantity = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("TakenQuantity"));
                }
            }
            get
            {
                return takenQuantity;
            }
        }
        #endregion

        #region Constructors
        public ReservationViewModel()
        {
            this.apiService = new ApiService();
            Hours = new ObservableCollection<HourViewModel>();
            Spaces = new ObservableCollection<SpacesViewModel>();
            Implements = new ObservableCollection<ImplementItemViewModel>();


            dialogService = new DialogService();
            LoadHour();
            LoadSpace();
            LoadImplement();
        }




        #endregion

        #region Commands
        public ICommand NewReservationCommand
        {
            get
            {
                return new RelayCommand(NewReservation);
            }
        }

       
        #endregion

        #region Methods
        private async void LoadHour()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                //this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Ok");
                return;
            }
            //this.IsRefreshing = true;
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Get<Hour>(apiVenALaU, "api/Hora", "/findall");
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage(
                    "Error",
                    response.Message);
                return;
            }
            ReloadHour((List<Hour>)response.Result);
        }

       
        private void ReloadHour(List<Hour> hour)
        {
            Hours.Clear();
            foreach (var hr in hour)
            {

                Hours.Add(new HourViewModel
                {
                    Hour1=hr.Hour1
                });
            }
            //this.IsRefreshing = false;

        }

        private async void LoadImplement()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                //this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Ok");
                return;
            }
            //this.IsRefreshing = true;
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Get<Implement>(apiVenALaU, "/api/Implemento", "/findall");
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage(
                    "Error",
                    response.Message);
                return;
            }
            ReloadImplement((List<Implement>)response.Result);
        }

        private void ReloadImplement(List<Implement> result)
        {
            Implements.Clear();
            foreach (var imp in result)
            {

                Implements.Add(new ImplementItemViewModel
                {

                    ImplementName = imp.ImplementName
                });
            }
            //this.IsRefreshing = false;
        }

        private async void LoadSpace()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                //this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Ok");
                return;
            }
            //this.IsRefreshing = true;
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Get<Space>(apiVenALaU, "/api/Espacio", "/findall");
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage(
                    "Error",
                    response.Message);
                return;
            }
            ReloadSpace((List<Space>)response.Result);
        }

        private void ReloadSpace(List<Space> result)
        {
            Spaces.Clear();
            foreach (var sp in result)
            {

                Spaces.Add(new SpacesViewModel
                {

                    SpaceName = sp.SpaceName
                });
            }
            //this.IsRefreshing = false;
        }

        private async void NewReservation()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                this.IsRunning = false;
                this.IsEnabled = true;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Aceptar");
                return;
            }

            var reservation = new Reservation
            {
                
                Available = false,
                SpaceId = selectedSpace.ToString(),
                HourId = selectedHour,
                Date = date
            };
            var implementInfo = new TakenImplement
            {
                ImplementId=selectedImplement,
                TakenQuantity=takenQuantity,
            };
            var mainViewModel = MainViewModel.GetInstance();
            var user=mainViewModel.User.IdPersona;
            var reservationInfo = new ReservationInfo
            {
                PersonId = user,
                ReservationId = 1,
                ImplementTakenId=2,
            };


            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var serviceApiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Post<Reservation>(apiVenALaU, "/api", "/Reserva/create", reservation);
            var response2 = await apiService.Post<ReservationInfo>(serviceApiVenALaU, "/api", "/InfoReserva/create", reservationInfo);
            var response3 = await apiService.Post<TakenImplement>(serviceApiVenALaU, "/api", "/PrestamoImplemento/create", implementInfo);
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage("Error", response.Message);
                return;
            }
            if (!response2.IsSuccess)
            {
                await dialogService.ShowMessage("Error", response.Message);
                return;
            }
            if (!response3.IsSuccess)
            {
                await dialogService.ShowMessage("Error", response.Message);
                return;
            }



            IsRunning = false;
            IsEnabled = true;

            //IsRunning = false;
            //IsEnabled = true;


            await Application.Current.MainPage.DisplayAlert(
                     "Correcto",
                     "La reserva se realizó correctamente",
                     "Aceptar");
            Application.Current.MainPage = new NavigationPage(new PrincipalMenuPage());
        }


        #endregion
    }
}
ReserveStatusViewModel

Code: Select all

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using VenALaU.Models;
using VenALaU.Services;
using Xamarin.Forms;

namespace VenALaU.ViewModels
{
    public class ReserveStatusViewModel : BaseViewModel
    {
        #region Services
        private ApiService apiService;
        #endregion

        #region Attributes
        private DialogService dialogService;
        private string date;
        private int spaceId;
        private bool isRefreshing;
        private string spaceName;
        private ObservableCollection<ReserveStatusItemViewModel> reserves;
        #endregion

        #region Events
        public event PropertyChangedEventHandler PropertyChanged;
        #endregion

        #region Properties

        public ObservableCollection<ReserveStatusItemViewModel> Reserves
        {
            get { return this.reserves; }
            set { SetValue(ref this.reserves, value); }
        }
        public bool IsRefreshing
        {
            get { return this.isRefreshing; }
            set { SetValue(ref this.isRefreshing, value); }
        }

        public int SpaceId
        {
            set
            {
                if (spaceId != value)
                {
                    spaceId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SpaceId"));
                }
            }
            get
            {
                return spaceId;
            }
        }
        public String Date
        {
            set
            {
                if (date != value)
                {
                    date = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Date"));
                }
            }
            get
            {
                return date;
            }
        }

        public String SpaceName
        {
            set
            {
                if (spaceName != value)
                {
                    spaceName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SpaceName"));
                }
            }
            get
            {
                return spaceName;
            }
        }
        #endregion

        #region Constructors
        /// <summary>
        /// Constructor de la clase CoursesViewModel
        /// Instancia las ObservableCollection que servirán para mostrar los cursos
        /// en la ListView de la vista. 
        /// Se llaman a los métodos para cargar los días al Picker y los cursos al
        /// ListView
        /// </summary>
        public ReserveStatusViewModel()
        {
            this.apiService = new ApiService();
            dialogService = new DialogService();
            Reserves = new ObservableCollection<ReserveStatusItemViewModel>();
            LoadReserve();

        }
        #endregion

        #region Methods
        private async void LoadReserve()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Ok");
                return;
            }
            this.IsRefreshing = true;
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var mainViewModel = MainViewModel.GetInstance();
            var user = mainViewModel.User.IdPersona;
            var course = await apiService.Get<ReservationInfo>(apiVenALaU, "/api/InfoReserva", "/findIdPersona/" + user);
            this.IsRefreshing = false;
            if (!course.IsSuccess)
            {
                await dialogService.ShowMessage("Error", course.Message);
                return;
            }
            ReloadReserve((List<ReservationInfo>)course.Result);
        }

        /// <summary>
        /// Método que recibe una lista de cursos y selecciona los datos necesarios para añadirlos a la 
        /// ObservableCollection Courses, que posteriormente los añadirá al control asociado
        /// en la Vista
        /// </summary>
        /// <param name="course">Lista con los cursos</param>
        private async void ReloadReserve(List<ReservationInfo> reservation)
        {
            //Reserves.Clear();
            var reserva = "";
            foreach (var reserves in reservation)
            {
                var reservaActiva= reserves.ReservationId;
                var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
                var activeReserve = await apiService.Get<Reservation>(apiVenALaU, "/api/Reserva", "/find/" + reservaActiva);
                ReloadReserve((List<Reservation>)activeReserve.Result);
            }
            this.IsRefreshing = false;
        }

        private async void ReloadReserve(List<Reservation> reserve)
        {
            this.IsRefreshing = true;
            //Reserves.Clear();
            var reserva = "";
            foreach (var reserves in reserve)
            {
                var fechaActiva = "";
                var espacioActivo = reserves.SpaceId;
                fechaActiva = reserves.Date;
                var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
                var activeSpace = await apiService.Get<Space>(apiVenALaU, "/api/Espacio", "/find/" + espacioActivo);
                reserva = ReloadSpace((List<Space>)activeSpace.Result);
                Reserves.Add(new ReserveStatusItemViewModel
                {
                    SpaceId = reserva,
                    Date = fechaActiva
                });
            }
            this.IsRefreshing = false;
        }

        private string ReloadSpace(List<Space> space)
        {
            //Courses.Clear();
            foreach (var spaces in space)
            {

                SpaceName = spaces.SpaceName;

            }

            return spaceName;
        }
        #endregion


    }
}
Gestión de Calidad de Software
Sergio Andrés Rodríguez Galeano
sergio.rodriguezg@upb.edu.co

User avatar
Sergio Rodríguez
Posts: 18
Joined: Thu Jul 26, 2018 12:12 pm

Re: Ven a la U

Post by Sergio Rodríguez » Thu Oct 11, 2018 12:58 am

Sprint 9: Septiembre 27-Octubre 10
Velocidad: 12

¿Qué hemos hecho?
  • Control de reservas
  • Reserva de implementos
  • Desplegar implementos prestados por una persona
  • Opción Actualizar Reserva
  • Opción Eliminar Reserva
¿Qué vamos a hacer?
Continuar con las actividades del siguiente sprint correspondiente a la implementación del módulo administrador

¿Qué dificultades hemos tenido?
Ninguna

Burndown
Image

Evidencias

Control de reservas
Image

Reserva de Implementos
Image

Implementos prestados por una persona
Image

Modificar y Eliminar Reserva
Image


ImplementSatusViewModel.cs

Code: Select all

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text;
using VenALaU.Models;
using VenALaU.Services;
using Xamarin.Forms;

namespace VenALaU.ViewModels
{
    public class ImplementStatusViewModel:BaseViewModel
    {
        #region Services
        private ApiService apiService;
        #endregion

        #region Attributes
        private DialogService dialogService;
        private string implementName;
        private int takenQuantity;
        private bool isRefreshing;
        private ObservableCollection<ImplementStatusItemViewModel> implements;
        #endregion

        #region Events
        public event PropertyChangedEventHandler PropertyChanged;
        #endregion

        #region Properties

        public ObservableCollection<ImplementStatusItemViewModel> Implements
        {
            get { return this.implements; }
            set { SetValue(ref this.implements, value); }
        }
        public bool IsRefreshing
        {
            get { return this.isRefreshing; }
            set { SetValue(ref this.isRefreshing, value); }
        }

        public string ImplementName
        {
            set
            {
                if (implementName != value)
                {
                    implementName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ImplementName"));
                }
            }
            get
            {
                return implementName;
            }
        }

        public int TakenQuantity
        {
            set
            {
                if (takenQuantity != value)
                {
                    takenQuantity = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("TakenQuantity"));
                }
            }
            get
            {
                return takenQuantity;
            }
        }
        
        #endregion

        #region Constructors
        /// <summary>
        /// Constructor de la clase CoursesViewModel
        /// Instancia las ObservableCollection que servirán para mostrar los cursos
        /// en la ListView de la vista. 
        /// Se llaman a los métodos para cargar los días al Picker y los cursos al
        /// ListView
        /// </summary>
        public ImplementStatusViewModel()
        {
            this.apiService = new ApiService();
            dialogService = new DialogService();
            Implements = new ObservableCollection<ImplementStatusItemViewModel>();
            LoadReserve();

        }
        #endregion
        #region Methods
        private async void LoadReserve()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Ok");
                return;
            }
            this.IsRefreshing = true;
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var mainViewModel = MainViewModel.GetInstance();
            var user = mainViewModel.User.IdPersona;
            var course = await apiService.Get<TakenImplement>(apiVenALaU, "/api/PrestamoImplemento", "/findByPerson/" + user);
            this.IsRefreshing = false;
            if (!course.IsSuccess)
            {
                await dialogService.ShowMessage("Error", course.Message);
                return;
            }
            ReloadImplement((List<TakenImplement>)course.Result);
        }

        /// <summary>
        /// Método que recibe una lista de cursos y selecciona los datos necesarios para añadirlos a la 
        /// ObservableCollection Courses, que posteriormente los añadirá al control asociado
        /// en la Vista
        /// </summary>
        /// <param name="course">Lista con los cursos</param>


        private async void ReloadImplement(List<TakenImplement> reserve)
        {
            this.IsRefreshing = true;
            var reserva = "";
            var hora = "";
            foreach (var reserves in reserve)
            {
                var cantidad = reserves.TakenQuantity;
                var idImplemento = reserves.ImplementId;
                var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
                var activeImplement = await apiService.Get<Implement>(apiVenALaU, "/api/Implemento", "/find/" + idImplemento);
                reserva = ReloadImplement((List<Implement>)activeImplement.Result);
                Implements.Add(new ImplementStatusItemViewModel
                {
                    ImplementName = reserva,
                    TakenQuantity = cantidad
                    
                });
            }
            this.IsRefreshing = false;
        }

        private string ReloadImplement(List<Implement> implement)
        {
            //Courses.Clear();
            foreach (var implements in implement)
            {

                ImplementName = implements.ImplementName;

            }

            return ImplementName;
        }

        
        #endregion
    }
}
ReserveDetailViewModel.cs

Code: Select all

using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text;
using System.Windows.Input;
using VenALaU.Models;
using VenALaU.Services;
using VenALaU.Views;
using Xamarin.Forms;

namespace VenALaU.ViewModels
{
    public class ReserveDetailViewModel : BaseViewModel
    {
        #region Services
        private ApiService apiService;
        #endregion

        #region Attributes
        private ObservableCollection<HourViewModel> hours;
        private ObservableCollection<SpacesViewModel> spaces;
        private DialogService dialogService;
        private int hourId;
        private string hour1;
        private int selectedHour;
        private int spaceId;
        private string spaceName;
        private string hourName;
        private int selectedSpace;
        private int implementId;
        private string implementName;
        private int selectedImplement;
        private bool isRunning;
        private bool isEnabled;
        private string date;
        private int reservationId;
        private int takenQuantity;
        #endregion
        #region Events
        public event PropertyChangedEventHandler PropertyChanged;
        #endregion

        #region Properties
        public Reservation Reserve
        {
            get;
            set;
        }
        public ObservableCollection<HourViewModel> Hours
        {
            get { return this.hours; }
            set { SetValue(ref this.hours, value); }
        }
        public ObservableCollection<SpacesViewModel> Spaces
        {
            get { return this.spaces; }
            set { SetValue(ref this.spaces, value); }
        }
        public int HourId
        {
            set
            {
                if (hourId != value)
                {
                    hourId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("HourId"));
                }
            }
            get
            {
                return hourId;
            }
        }
        public string Hour1
        {
            set
            {
                if (hour1 != value)
                {
                    hour1 = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Hour1"));
                }
            }
            get
            {
                return hour1;
            }
        }
        public string Date
        {
            set
            {
                if (date != value)
                {
                    date = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Date"));
                }
            }
            get
            {
                return date;
            }
        }
        public int SpaceId
        {
            set
            {
                if (spaceId != value)
                {
                    spaceId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SpaceId"));
                }
            }
            get
            {
                return spaceId;
            }
        }
        public string SpaceName
        {
            set
            {
                if (spaceName != value)
                {
                    spaceName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SpaceName"));
                }
            }
            get
            {
                return spaceName;
            }
        }
        public int ImplementId
        {
            set
            {
                if (implementId != value)
                {
                    implementId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ImplementId"));
                }
            }
            get
            {
                return implementId;
            }
        }
        public string ImplementName
        {
            set
            {
                if (implementName != value)
                {
                    implementName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ImplementName"));
                }
            }
            get
            {
                return implementName;
            }
        }
        public string HourName
        {
            set
            {
                if (hourName != value)
                {
                    hourName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("HourName"));
                }
            }
            get
            {
                return hourName;
            }
        }
        public int SelectedHour
        {
            set
            {
                if (selectedHour != value)
                {
                    selectedHour = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedHour"));
                }


            }
            get
            {
                return (selectedHour + 1);
            }
        }

        public int SelectedSpace
        {
            set
            {
                if (selectedSpace != value)
                {
                    selectedSpace = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedSpace"));
                }


            }
            get
            {
                return (selectedSpace + 1);
            }
        }
        public int SelectedImplement
        {
            set
            {
                if (selectedImplement != value)
                {
                    selectedImplement = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedImplement"));
                }


            }
            get
            {
                return (selectedImplement + 1);
            }
        }
        public bool IsRunning
        {
            set
            {
                if (isRunning != value)
                {
                    isRunning = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsRunning"));
                }
            }
            get
            {
                return isRunning;
            }
        }
        public bool IsEnabled
        {
            set
            {
                if (isEnabled != value)
                {
                    isEnabled = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsEnabled"));
                }
            }
            get
            {
                return isEnabled;
            }
        }
        public int ReservationId
        {
            set
            {
                if (reservationId != value)
                {
                    reservationId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ReservationId"));
                }
            }
            get
            {
                return reservationId;
            }
        }
        public int TakenQuantity
        {
            set
            {
                if (takenQuantity != value)
                {
                    takenQuantity = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("TakenQuantity"));
                }
            }
            get
            {
                return takenQuantity;
            }
        }
        #endregion

        #region Constructor
        public ReserveDetailViewModel(Reservation theReserve)
        {
            this.Reserve = theReserve;
            ReservationId = theReserve.ReservationId;
            SpaceId = theReserve.SpaceId;
            HourId = theReserve.HourId;
            Date = theReserve.Date;
            this.apiService = new ApiService();
            Hours = new ObservableCollection<HourViewModel>();
            Spaces = new ObservableCollection<SpacesViewModel>();


            dialogService = new DialogService();
            LoadHour();
            LoadSpace();
        }
        #endregion

        #region Commands
        public ICommand SaveCommand
        {
            get
            {
                return new RelayCommand(Save);
            }
        }

        public ICommand DeleteCommand
        {
            get
            {
                return new RelayCommand(Delete);
            }
        }
        #endregion

        private async void LoadHour()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                //this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Ok");
                return;
            }
            //this.IsRefreshing = true;
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Get<Hour>(apiVenALaU, "api/Hora", "/findall");
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage(
                    "Error",
                    response.Message);
                return;
            }
            ReloadHour((List<Hour>)response.Result);
        }


        private void ReloadHour(List<Hour> hour)
        {
            //Hours.Clear();
            foreach (var hr in hour)
            {

                Hours.Add(new HourViewModel
                {
                    Hour1 = hr.Hour1
                });
            }
            //this.IsRefreshing = false;

        }
        private async void LoadSpace()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                //this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Ok");
                return;
            }
            //this.IsRefreshing = true;
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Get<Space>(apiVenALaU, "/api/Espacio", "/findall");
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage(
                    "Error",
                    response.Message);
                return;
            }
            ReloadSpace((List<Space>)response.Result);
        }

        private void ReloadSpace(List<Space> result)
        {
            Spaces.Clear();
            foreach (var sp in result)
            {

                Spaces.Add(new SpacesViewModel
                {

                    SpaceName = sp.SpaceName
                });
            }
            //this.IsRefreshing = false;
        }

        private async void Save()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                this.IsRunning = false;
                this.IsEnabled = true;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Aceptar");
                return;
            }

            var reserva = new Reservation
            {
                ReservationId = ReservationId,
                SpaceId = SelectedSpace +1,
                HourId = SelectedHour + 1,
                Date = Date
            };

            IsRunning = true;
            IsEnabled = false;

            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Put(apiVenALaU, "/api/Reserva", "/update", reserva);
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage("Error", response.Message);
                return;
            }
            IsRunning = false;
            IsEnabled = true;


            await Application.Current.MainPage.DisplayAlert(
                     "Correcto",
                     "La reserva se actualizó",
                     "Aceptar");
            var mainViewModel = MainViewModel.GetInstance();
            Application.Current.MainPage = new NavigationPage(new PrincipalMenuPage());

        }

        private async void Delete()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                this.IsRunning = false;
                this.IsEnabled = true;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Aceptar");
                return;
            }

            var reserva = new Reservation
            {
                ReservationId = ReservationId,
                SpaceId = SpaceId,
                HourId = HourId,
                Date = Date
            };

            IsRunning = true;
            IsEnabled = false;

            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Delete(apiVenALaU, "/api/Reserva", "/delete", reserva);
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage("Error", response.Message);
                return;
            }
            IsRunning = false;
            IsEnabled = true;


            await Application.Current.MainPage.DisplayAlert(
                     "Correcto",
                     "La reserva se eliminó",
                     "Aceptar");
            var mainViewModel = MainViewModel.GetInstance();
            Application.Current.MainPage = new NavigationPage(new PrincipalMenuPage());

        }
    }
}
ReservationViewModel.cs

Code: Select all

using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text;
using System.Windows.Input;
using VenALaU.Models;
using VenALaU.Services;
using VenALaU.Views;
using Xamarin.Forms;

namespace VenALaU.ViewModels
{
    public class ReservationViewModel : BaseViewModel
    {
        #region Services
        private ApiService apiService;
        #endregion

        #region Attributes
        private ObservableCollection<HourViewModel> hours;
        private ObservableCollection<SpacesViewModel> spaces;
        private ObservableCollection<ImplementItemViewModel> implements;
        private DialogService dialogService;
        private int hourId;
        private string hour1;
        private int selectedHour;
        private int spaceId;
        private string spaceName;
        private int selectedSpace;
        private int implementId;
        private string implementName;
        private int selectedImplement;
        private bool isRunning;
        private bool isEnabled;
        private string date;
        private int reservationId;
        private int takenQuantity;
        #endregion
        #region Events
        public event PropertyChangedEventHandler PropertyChanged;
        #endregion
        #region Properties
        public ObservableCollection<HourViewModel> Hours
        {
            get { return this.hours; }
            set { SetValue(ref this.hours, value); }
        }
        public ObservableCollection<SpacesViewModel> Spaces
        {
            get { return this.spaces; }
            set { SetValue(ref this.spaces, value); }
        }
        public ObservableCollection<ImplementItemViewModel> Implements
        {
            get { return this.implements; }
            set { SetValue(ref this.implements, value); }
        }
        public int HourId
        {
            set
            {
                if (hourId != value)
                {
                    hourId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("HourId"));
                }
            }
            get
            {
                return hourId;
            }
        }
        public string Hour1
        {
            set
            {
                if (hour1 != value)
                {
                    hour1 = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Hour1"));
                }
            }
            get
            {
                return hour1;
            }
        }
        public string Date
        {
            set
            {
                if (date != value)
                {
                    date = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Date"));
                }
            }
            get
            {
                return date;
            }
        }
        public int SpaceId
        {
            set
            {
                if (spaceId != value)
                {
                    spaceId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SpaceId"));
                }
            }
            get
            {
                return spaceId;
            }
        }
        public string SpaceName
        {
            set
            {
                if (spaceName != value)
                {
                    spaceName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SpaceName"));
                }
            }
            get
            {
                return spaceName;
            }
        }
        public int ImplementId
        {
            set
            {
                if (implementId != value)
                {
                    implementId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ImplementId"));
                }
            }
            get
            {
                return implementId;
            }
        }
        public string ImplementName
        {
            set
            {
                if (implementName != value)
                {
                    implementName = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ImplementName"));
                }
            }
            get
            {
                return implementName;
            }
        }
        public int SelectedHour
        {
            set
            {
                if (selectedHour != value)
                {
                    selectedHour = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedHour"));
                }


            }
            get
            {
                return (selectedHour + 1);
            }
        }
        public int  SelectedSpace
        {
            set
            {
                if (selectedSpace != value)
                {
                    selectedSpace = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedSpace"));
                }


            }
            get
            {
                return (selectedSpace + 1);
            }
        }
        public int SelectedImplement
        {
            set
            {
                if (selectedImplement != value)
                {
                    selectedImplement = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedImplement"));
                }


            }
            get
            {
                return (selectedImplement + 1);
            }
        }
        public bool IsRunning
        {
            set
            {
                if (isRunning != value)
                {
                    isRunning = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsRunning"));
                }
            }
            get
            {
                return isRunning;
            }
        }
        public bool IsEnabled
        {
            set
            {
                if (isEnabled != value)
                {
                    isEnabled = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsEnabled"));
                }
            }
            get
            {
                return isEnabled;
            }
        }
        public int ReservationId
        {
            set
            {
                if (reservationId != value)
                {
                    reservationId = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ReservationId"));
                }
            }
            get
            {
                return reservationId;
            }
        }
        public int TakenQuantity
        {
            set
            {
                if (takenQuantity != value)
                {
                    takenQuantity = value;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("TakenQuantity"));
                }
            }
            get
            {
                return takenQuantity;
            }
        }
        #endregion

        #region Constructors
        public ReservationViewModel()
        {
            this.apiService = new ApiService();
            Hours = new ObservableCollection<HourViewModel>();
            Spaces = new ObservableCollection<SpacesViewModel>();
            Implements = new ObservableCollection<ImplementItemViewModel>();


            dialogService = new DialogService();
            LoadHour();
            LoadSpace();
            LoadImplement();
        }




        #endregion

        #region Commands
        public ICommand NewReservationCommand
        {
            get
            {
                return new RelayCommand(NewReservation);
            }
        }

       
        #endregion

        #region Methods
        private async void LoadHour()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                //this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Ok");
                return;
            }
            //this.IsRefreshing = true;
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Get<Hour>(apiVenALaU, "api/Hora", "/findall");
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage(
                    "Error",
                    response.Message);
                return;
            }
            ReloadHour((List<Hour>)response.Result);
        }

       
        private void ReloadHour(List<Hour> hour)
        {
            Hours.Clear();
            foreach (var hr in hour)
            {

                Hours.Add(new HourViewModel
                {
                    Hour1=hr.Hour1
                });
            }
            //this.IsRefreshing = false;

        }

        private async void LoadImplement()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                //this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Ok");
                return;
            }
            //this.IsRefreshing = true;
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Get<Implement>(apiVenALaU, "/api/Implemento", "/findall");
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage(
                    "Error",
                    response.Message);
                return;
            }
            ReloadImplement((List<Implement>)response.Result);
        }

        private void ReloadImplement(List<Implement> result)
        {
            Implements.Clear();
            foreach (var imp in result)
            {

                Implements.Add(new ImplementItemViewModel
                {

                    ImplementName = imp.ImplementName
                });
            }
            //this.IsRefreshing = false;
        }

        private async void LoadSpace()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                //this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Ok");
                return;
            }
            //this.IsRefreshing = true;
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Get<Space>(apiVenALaU, "/api/Espacio", "/findall");
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage(
                    "Error",
                    response.Message);
                return;
            }
            ReloadSpace((List<Space>)response.Result);
        }

        private void ReloadSpace(List<Space> result)
        {
            Spaces.Clear();
            foreach (var sp in result)
            {

                Spaces.Add(new SpacesViewModel
                {

                    SpaceName = sp.SpaceName
                });
            }
            //this.IsRefreshing = false;
        }
        private async void NewReservation()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                this.IsRunning = false;
                this.IsEnabled = true;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Aceptar");
                return;
            }
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var response = await apiService.Get<Reservation>(apiVenALaU, "api/Reserva", "/findall");
            if (!response.IsSuccess)
            {
                await dialogService.ShowMessage(
                    "Error",
                    response.Message);
                return;
            }
            InsertReservation((List<Reservation>)response.Result);

            //if(selectedImplement+1!=0 && takenQuantity+1 != 0)
            //{
            //    var response1 = await apiService.Get<TakenImplement>(apiVenALaU, "api/PrestamoImplemento", "/findall");
            //    if (!response1.IsSuccess)
            //    {
            //        await dialogService.ShowMessage(
            //            "Error",
            //            response.Message);
            //        return;
            //    }
            //    InsertImplement((List<TakenImplement>)response1.Result);

            //}

        }

       

        private async void InsertReservation(List<Reservation> result)
        {
            var mainViewModel = MainViewModel.GetInstance();
            var user = mainViewModel.User.IdPersona;
            var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();
            var date1=string.Empty;
            var time1=0 ;
            var personId1=0;
            var spaceId1=0;
            
            //mainViewModel.Implement = implementInfo;

            foreach (var reservation in result)
            {
                date1 = reservation.Date;
                time1 = reservation.HourId;
                personId1 = reservation.PersonId;
                spaceId1 = reservation.SpaceId;

                

            }
            if ((date1 != date) || (time1 != selectedHour) || (spaceId != selectedSpace))
            {
                var reservationInfo = new Reservation
                {
                    PersonId = user,
                    Available = false,
                    SpaceId = selectedSpace+1,
                    HourId = selectedHour+1,
                    Date = date
                };
                var response = await apiService.Post<Reservation>(apiVenALaU, "/api", "/Reserva/create", reservationInfo);
                if (!response.IsSuccess)
                {
                    await dialogService.ShowMessage("Error", response.Message);
                    return;
                }
                IsRunning = false;
                IsEnabled = true;

                //IsRunning = false;
                //IsEnabled = true;

            await Application.Current.MainPage.DisplayAlert(
                             "Correcto",
                             "La reserva se realizó correctamente",
                             "Aceptar");
            Application.Current.MainPage = new NavigationPage(new PrincipalMenuPage());

            }
            else
            {
                await Application.Current.MainPage.DisplayAlert(
                         "Error",
                         "El espacio ya está reservado, intente de nuevo",
                         "Aceptar");
            }
            

        }
        //private async void InsertImplement(List<TakenImplement> result)
        //{
        //    var mainViewModel = MainViewModel.GetInstance();
        //    var user = mainViewModel.User.IdPersona;
        //    var apiVenALaU = Application.Current.Resources["ApiVenALaU"].ToString();

        //    var date1 = string.Empty;
        //    var time1 = 0;
        //    var personId1 = 0;
        //    var implementId1 = 0;

        //    foreach (var implement in result)
        //    {
        //        date1 = implement.TakenDate;
        //        time1 = implement.HourId;
        //        personId1 = implement.PersonId;
        //        implementId1 = implement.ImplementId;
                
        //    }
        //    if ((date1 != date) || (time1 != selectedHour) || (implementId1 != selectedImplement))
        //    {
        //        var implementInfo = new TakenImplement
        //        {
        //            PersonId = user,
        //            ImplementId = selectedImplement+1,
        //            TakenQuantity = takenQuantity,
        //            TakenDate=date,
        //            HourId=selectedHour+1,
        //        };
        //        var response = await apiService.Post<TakenImplement>(apiVenALaU, "/api", "/PrestamoImplemento/create", implementInfo);
        //        if (!response.IsSuccess)
        //        {
        //            await dialogService.ShowMessage("Error", response.Message);
        //            return;
        //        }
        //        await Application.Current.MainPage.DisplayAlert(
        //                   "Correcto",
        //                   "La reserva del implemento se realizó correctamente",
        //                   "Aceptar");
        //        Application.Current.MainPage = new NavigationPage(new PrincipalMenuPage());
        //    }
        //    else
        //    {
        //        await Application.Current.MainPage.DisplayAlert(
        //                 "Error",
        //                 "El implemento no está disponible",
        //                 "Aceptar");
        //    }
           
        //}

        #endregion
    }
}
Gestión de Calidad de Software
Sergio Andrés Rodríguez Galeano
sergio.rodriguezg@upb.edu.co

User avatar
MariaIAF
Posts: 25
Joined: Thu Jul 26, 2018 12:12 pm

Re: Ven a la U

Post by MariaIAF » Thu Oct 11, 2018 8:32 pm

Sprint 10: 11-24 de Octubre
Velocidad Esperada: 12

Sprint Planning
Módulo de Administrador: 8
El módulo de Administrador consiste en una aplicación web en la cual los administradores de deportes y eventos podrán administrar sus respectivas funcionalidades.
  • Login por administradores: (2/8)
  • Creación interfaces administrador de eventos y deportes(1/8)
  • Diseño de interfaces administrador de eventos y deportes(1/8)
  • Controladores para CRUD de reservas: (1/8)
  • Controladores para CRUD de deportes: (1/8)
  • Implementación de funcionalidades de Administración de Eventos: (1/8)
  • Implementación de funcionalidades de Administración de Deportes: (1/8)
Módulo de Perfil de Usuario: 4
  • Diseño de la interfaz de perfil de usuario y cambio de contraseña (1/4)
  • Implementación Pantalla de perfil con información del usuario (1/4)
  • Cambiar contraseña y ¿Olvidaste tu contraseña? (1/4)
  • Controladores de perfil de usuario (1/4)
Maria Isabel Arcila Franco
maria.arcilaf@upb.edu.co

Gestión de Calidad de Software
Aplicaciones Móviles

User avatar
MariaIAF
Posts: 25
Joined: Thu Jul 26, 2018 12:12 pm

Re: Ven a la U

Post by MariaIAF » Mon Oct 15, 2018 7:22 pm

Sprint 10: 11-24 de Octubre
Avance 15 de Octubre

¿Qué hemos hecho?
Módulo de Administrador
  • Diseño de interfaces de Administrador de Eventos y Deportes
  • Controladores para CRUD de Eventos
  • Controladores para CRUD de Deportes
Módulo de estado de Cuenta
  • Diseño de la interfaz de perfil de usuario y recordar contraseña
¿Qué vamos a hacer?
Continuar con las actividades del backlog: Implementación de las funcionalidades de administrador y perfil de usuario.

¿Qué dificultades hemos tenido?
Ninguna hasta el momento

Burndown Chart
Image

Diagramas
Diagrama de casos de uso- Perfil
Image

Diagrama de Casos de Uso- Administrador de Deportes
Image
Diagrama de Casos de Uso- Administrador de Eventos
Image
Diagrama de Secuencias- Perfil
Image
Diagrama de Secuencias- Administrador de Deportes
Image
Diagrama de Secuencias- Administrador de Eventos
Image
Diagrama Entidad-Relación- Perfil
Image
Diagrama Entidad-Relación- Administrador de Deportes
Image
Diagrama Entidad-Relación- Administrador de Eventos
Image

Evidencias
Pantalla Cambiar Contraseña
Image

Pantalla Recordar Contraseña
Image

Pantalla Perfil de Usuario
Image

Login Administrador
Image

Registro Administrador
Image

Home Administrador
Image

Home Administrador de Eventos
Image

Home Administrador Deportes
Image

Home de Ítem
Image

Crear Elemento
Image

Detalle Elemento
Image

Editar Elemento
Image

Controladores
Se pondrá uno de los controladores para no saturar el post con tanta información. En esencia los controladores tienen prácticamente el mismo contenido, cambian algunos nombres

Code: Select all

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VenALaU.Backend.Models;
using VenALaU.Common.Models;

namespace VenALaU.Backend.Controllers
{
    public class ReservasController : Controller
    {
        private LocalDataContext db = new LocalDataContext();

        // GET: Reservas
        public async Task<ActionResult> Index()
        {
            var reservas = db.Reservas.Include(r => r.Espacio).Include(r => r.Hora).Include(r => r.Personas);
            return View(await reservas.ToListAsync());
        }

        // GET: Reservas/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Reserva reserva = await db.Reservas.FindAsync(id);
            if (reserva == null)
            {
                return HttpNotFound();
            }
            return View(reserva);
        }

        // GET: Reservas/Create
        public ActionResult Create()
        {
            ViewBag.IdEspacio = new SelectList(db.Espacios, "IdEspacio", "Nombre");
            ViewBag.IdHora = new SelectList(db.Horas, "IdHora", "Hora1");
            ViewBag.IdPersona = new SelectList(db.Personas, "IdPersona", "Nombre");
            return View();
        }

        // POST: Reservas/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Create([Bind(Include = "IdReserva,IdEspacio,Fecha,Disponible,IdHora,IdPersona")] Reserva reserva)
        {
            if (ModelState.IsValid)
            {
                db.Reservas.Add(reserva);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            ViewBag.IdEspacio = new SelectList(db.Espacios, "IdEspacio", "Nombre", reserva.IdEspacio);
            ViewBag.IdHora = new SelectList(db.Horas, "IdHora", "Hora1", reserva.IdHora);
            ViewBag.IdPersona = new SelectList(db.Personas, "IdPersona", "Nombre", reserva.IdPersona);
            return View(reserva);
        }

        // GET: Reservas/Edit/5
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Reserva reserva = await db.Reservas.FindAsync(id);
            if (reserva == null)
            {
                return HttpNotFound();
            }
            ViewBag.IdEspacio = new SelectList(db.Espacios, "IdEspacio", "Nombre", reserva.IdEspacio);
            ViewBag.IdHora = new SelectList(db.Horas, "IdHora", "Hora1", reserva.IdHora);
            ViewBag.IdPersona = new SelectList(db.Personas, "IdPersona", "Nombre", reserva.IdPersona);
            return View(reserva);
        }

        // POST: Reservas/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit([Bind(Include = "IdReserva,IdEspacio,Fecha,Disponible,IdHora,IdPersona")] Reserva reserva)
        {
            if (ModelState.IsValid)
            {
                db.Entry(reserva).State = EntityState.Modified;
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            ViewBag.IdEspacio = new SelectList(db.Espacios, "IdEspacio", "Nombre", reserva.IdEspacio);
            ViewBag.IdHora = new SelectList(db.Horas, "IdHora", "Hora1", reserva.IdHora);
            ViewBag.IdPersona = new SelectList(db.Personas, "IdPersona", "Nombre", reserva.IdPersona);
            return View(reserva);
        }

        // GET: Reservas/Delete/5
        public async Task<ActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Reserva reserva = await db.Reservas.FindAsync(id);
            if (reserva == null)
            {
                return HttpNotFound();
            }
            return View(reserva);
        }

        // POST: Reservas/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(int id)
        {
            Reserva reserva = await db.Reservas.FindAsync(id);
            db.Reservas.Remove(reserva);
            await db.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}

Maria Isabel Arcila Franco
maria.arcilaf@upb.edu.co

Gestión de Calidad de Software
Aplicaciones Móviles

Post Reply