diff --git a/.vs/GerenciaProjetos/v15/.suo b/.vs/GerenciaProjetos/v15/.suo index c7ff0e5..e5c3cb9 100644 Binary files a/.vs/GerenciaProjetos/v15/.suo and b/.vs/GerenciaProjetos/v15/.suo differ diff --git a/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide b/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide index d768466..198bdeb 100644 Binary files a/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide and b/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide-shm b/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide-shm index aabae24..f6e3d5d 100644 Binary files a/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide-shm and b/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide-shm differ diff --git a/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide-wal b/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide-wal index 0512f8e..a8bd619 100644 Binary files a/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide-wal and b/.vs/GerenciaProjetos/v15/Server/sqlite3/storage.ide-wal differ diff --git a/GerenciaProjetos/Controllers/BugsController.cs b/GerenciaProjetos/Controllers/BugsController.cs new file mode 100644 index 0000000..8e63293 --- /dev/null +++ b/GerenciaProjetos/Controllers/BugsController.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using GerenciaProjetos.Models; +using GerenciaContext = GerenciaProjetos.Data.GerenciaContext; + +namespace GerenciaProjetos.Controllers +{ + public class BugsController : Controller + { + private GerenciaContext ctx; + + public BugsController(GerenciaContext ctx) + { + this.ctx = ctx; + + Desenvolvedor dev = ctx.Desenvolvedores.Find(1); + } + + public IActionResult Index() + { + return View(); + } + } +} \ No newline at end of file diff --git a/GerenciaProjetos/Controllers/DesenvolvedorController.cs b/GerenciaProjetos/Controllers/DesenvolvedorController.cs new file mode 100644 index 0000000..6205c68 --- /dev/null +++ b/GerenciaProjetos/Controllers/DesenvolvedorController.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using GerenciaProjetos.Models; +using GerenciaContext = GerenciaProjetos.Data.GerenciaContext; + +namespace GerenciaProjetos.Controllers +{ + public class DesenvolvedorController : Controller + { + private GerenciaContext ctx; + + public DesenvolvedorController(GerenciaContext ctx) + { + this.ctx = ctx; + + Desenvolvedor dev = ctx.Desenvolvedores.Find(1); + } + + public IActionResult Index() + { + ViewBag.Desenvolvedores = ctx.Desenvolvedores; + + return View(); + } + + public IActionResult New() + { + return View("Form"); + } + + [HttpPost] + public IActionResult New(Desenvolvedor dev) + { + if (ModelState.IsValid) + { + ctx.Desenvolvedores.Add(dev); + ctx.SaveChanges(); + + return RedirectToAction("Index", "Home"); + } + else + { + return View("Form", dev); + } + } + + public IActionResult Edit(int id) + { + Desenvolvedor dev = ctx.Desenvolvedores.Find(id); + + if (dev != null) + { + return View("Form", dev); + } + else + { + return RedirectToAction("Index", "Home"); + } + } + + [HttpPost] + [ValidateAntiForgeryToken] + public IActionResult Edit(Desenvolvedor dev) + { + if (ModelState.IsValid) + { + ctx.Desenvolvedores.Update(dev); + ctx.SaveChanges(); + + return RedirectToAction("Index", "Home"); + } + else + { + return View("Form", dev); + } + } + + public IActionResult Del(int id) + { + Desenvolvedor dev = ctx.Desenvolvedores.Find(id); + + if (dev != null) + { + ctx.Desenvolvedores.Remove(dev); + ctx.SaveChanges(); + } + + return RedirectToAction("Index", "Home"); + } + } +} \ No newline at end of file diff --git a/GerenciaProjetos/Controllers/HomeController.cs b/GerenciaProjetos/Controllers/HomeController.cs index 6fec36d..28aeb65 100644 --- a/GerenciaProjetos/Controllers/HomeController.cs +++ b/GerenciaProjetos/Controllers/HomeController.cs @@ -13,7 +13,6 @@ namespace GerenciaProjetos.Controllers { private GerenciaContext ctx; - public HomeController(GerenciaContext ctx) { this.ctx = ctx; @@ -24,7 +23,8 @@ namespace GerenciaProjetos.Controllers public IActionResult Index() { ViewBag.Desenvolvedores = ctx.Desenvolvedores; - + ViewBag.Projetos = ctx.Projetos; + return View(); } @@ -32,74 +32,7 @@ namespace GerenciaProjetos.Controllers { return View(); } - - /* DESENVOLVEDOR */ - - public IActionResult AddDev() - { - return View(); - } - - [HttpPost] - public IActionResult AddDev(Desenvolvedor dev) - { - if (ModelState.IsValid) - { - ctx.Desenvolvedores.Add(dev); - ctx.SaveChanges(); - - return RedirectToAction("Index", "Home"); - } - else - { - return View("AddDev", dev); - } - } - - public IActionResult EditDev(int id) - { - Desenvolvedor dev = ctx.Desenvolvedores.Find(id); - - if (dev != null) - { - return View("AddDev", dev); - } - else - { - return RedirectToAction("Index", "Home"); - } - } - - [HttpPost] - [ValidateAntiForgeryToken] - public IActionResult EditDev(Desenvolvedor dev) - { - if (ModelState.IsValid) - { - ctx.Desenvolvedores.Update(dev); - ctx.SaveChanges(); - - return RedirectToAction("Index", "Home"); - } - else - { - return View("AddDev", dev); - } - } - - public IActionResult DelDev(int id) - { - Desenvolvedor dev = ctx.Desenvolvedores.Find(id); - - if (dev != null) - { - ctx.Desenvolvedores.Remove(dev); - ctx.SaveChanges(); - } - - return RedirectToAction("Index", "Home"); - } - + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { diff --git a/GerenciaProjetos/Controllers/ProjetosController.cs b/GerenciaProjetos/Controllers/ProjetosController.cs new file mode 100644 index 0000000..60cfb46 --- /dev/null +++ b/GerenciaProjetos/Controllers/ProjetosController.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using GerenciaProjetos.Models; +using GerenciaContext = GerenciaProjetos.Data.GerenciaContext; + +namespace GerenciaProjetos.Controllers +{ + public class ProjetosController : Controller + { + private GerenciaContext ctx; + + public ProjetosController(GerenciaContext ctx) + { + this.ctx = ctx; + + Desenvolvedor dev = ctx.Desenvolvedores.Find(1); + } + + public IActionResult Index() + { + ViewBag.Projetos = ctx.Projetos; + + return View(); + } + + public IActionResult New() + { + return View("Form"); + } + + [HttpPost] + public IActionResult New(Projeto proj) + { + if (ModelState.IsValid) + { + ctx.Projetos.Add(proj); + ctx.SaveChanges(); + + return RedirectToAction("Index", "Home"); + } + else + { + return View("Form", proj); + } + } + + public IActionResult Edit(int id) + { + Projeto proj = ctx.Projetos.Find(id); + + if (proj != null) + { + return View("Form", proj); + } + else + { + return RedirectToAction("Index", "Home"); + } + } + + [HttpPost] + [ValidateAntiForgeryToken] + public IActionResult Edit(Projeto proj) + { + if (ModelState.IsValid) + { + ctx.Projetos.Update(proj); + ctx.SaveChanges(); + + return RedirectToAction("Index", "Home"); + } + else + { + return View("Form", proj); + } + } + + public IActionResult Del(int id) + { + Projeto proj = ctx.Projetos.Find(id); + + if (proj != null) + { + ctx.Projetos.Remove(proj); + ctx.SaveChanges(); + } + + return RedirectToAction("Index", "Home"); + } + } +} \ No newline at end of file diff --git a/GerenciaProjetos/Controllers/RequisitosController.cs b/GerenciaProjetos/Controllers/RequisitosController.cs new file mode 100644 index 0000000..1ed3c7a --- /dev/null +++ b/GerenciaProjetos/Controllers/RequisitosController.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using GerenciaProjetos.Models; +using GerenciaContext = GerenciaProjetos.Data.GerenciaContext; + +namespace GerenciaProjetos.Controllers +{ + public class RequisitosController : Controller + { + private GerenciaContext ctx; + + public RequisitosController(GerenciaContext ctx) + { + this.ctx = ctx; + + Desenvolvedor dev = ctx.Desenvolvedores.Find(1); + } + + public IActionResult Index() + { + return View(); + } + } +} \ No newline at end of file diff --git a/GerenciaProjetos/GerenciaProjetos.csproj b/GerenciaProjetos/GerenciaProjetos.csproj index 954a80f..c3b8f79 100644 --- a/GerenciaProjetos/GerenciaProjetos.csproj +++ b/GerenciaProjetos/GerenciaProjetos.csproj @@ -10,6 +10,7 @@ + diff --git a/GerenciaProjetos/GerenciaProjetos.csproj.user b/GerenciaProjetos/GerenciaProjetos.csproj.user new file mode 100644 index 0000000..0ba9c6e --- /dev/null +++ b/GerenciaProjetos/GerenciaProjetos.csproj.user @@ -0,0 +1,14 @@ + + + + 600 + ~/Views/Shared/_Layout.cshtml + True + False + False + MvcControllerEmptyScaffolder + root/Controller + 600 + False + + \ No newline at end of file diff --git a/GerenciaProjetos/Views/Desenvolvedor/Form.cshtml b/GerenciaProjetos/Views/Desenvolvedor/Form.cshtml new file mode 100644 index 0000000..3136129 --- /dev/null +++ b/GerenciaProjetos/Views/Desenvolvedor/Form.cshtml @@ -0,0 +1,35 @@ + +@{ + ViewData["Title"] = "Novo Desenvolvedor"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} + +@model GerenciaProjetos.Models.Desenvolvedor + +

@ViewData["Title"]

+

Subtitulo.

+ +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ Cancelar + +
+
+
+
+
\ No newline at end of file diff --git a/GerenciaProjetos/Views/Desenvolvedor/Index.cshtml b/GerenciaProjetos/Views/Desenvolvedor/Index.cshtml new file mode 100644 index 0000000..1bdae6c --- /dev/null +++ b/GerenciaProjetos/Views/Desenvolvedor/Index.cshtml @@ -0,0 +1,66 @@ + +@{ + ViewData["Title"] = "Desenvolvedores"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} + +

@ViewData["Title"]

+

Subtitulo.

+ +
+
+
+
+
+ 1 +
+
+
+ + + +
+
+
+
+ + + + + + + + + + + + @foreach (Desenvolvedor d in ViewBag.Desenvolvedores) + { + + + + + + + + } + +
#NomeEmailAdminOpções
@d.Id@d.Nome@d.Email + @if (d.EAdmin == true) + { + Sim + } + else + { + Não + } + + + + + + + +
+
+
\ No newline at end of file diff --git a/GerenciaProjetos/Views/Home/Index.cshtml b/GerenciaProjetos/Views/Home/Index.cshtml index 06a67e0..5205190 100644 --- a/GerenciaProjetos/Views/Home/Index.cshtml +++ b/GerenciaProjetos/Views/Home/Index.cshtml @@ -3,18 +3,18 @@ }

@ViewData["Title"]

-

Manage your account settings, and set up social network integration.

+

Subtitulo.

- Desenvolvedores + Desenvolvedores
@@ -49,10 +49,10 @@ } - + - + @@ -68,11 +68,11 @@
- Projetos + Projetos
@@ -90,20 +90,23 @@ - - 1 - Guilherme - Abril - Kewin - - - - - - - - - + @foreach (Projeto p in ViewBag.Projetos) + { + + @p.Id + @p.Nome + @p.DataEntrega + @p.Solicitante + + + + + + + + + + }
diff --git a/GerenciaProjetos/Views/Projetos/Form.cshtml b/GerenciaProjetos/Views/Projetos/Form.cshtml new file mode 100644 index 0000000..22cf72e --- /dev/null +++ b/GerenciaProjetos/Views/Projetos/Form.cshtml @@ -0,0 +1,35 @@ + +@{ + ViewData["Title"] = "Novo Projeto"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} + +@model GerenciaProjetos.Models.Projeto + +

@ViewData["Title"]

+

Subtitulo.

+ +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ Cancelar + +
+
+
+
+
\ No newline at end of file diff --git a/GerenciaProjetos/Views/Projetos/Index.cshtml b/GerenciaProjetos/Views/Projetos/Index.cshtml new file mode 100644 index 0000000..c11504c --- /dev/null +++ b/GerenciaProjetos/Views/Projetos/Index.cshtml @@ -0,0 +1,57 @@ + +@{ + ViewData["Title"] = "Projetos"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} + +

@ViewData["Title"]

+

Subtitulo.

+ +
+
+
+
+
+ 1 +
+
+
+ + + +
+
+
+
+ + + + + + + + + + + + @foreach (Projeto p in ViewBag.Projetos) + { + + + + + + + + } + +
#NomeData de EntregaSolicitanteOpções
@p.Id@p.Nome@p.DataEntrega@p.Solicitante + + + + + + +
+
+
\ No newline at end of file diff --git a/GerenciaProjetos/Views/Shared/_Layout.cshtml b/GerenciaProjetos/Views/Shared/_Layout.cshtml index e08643e..cbef422 100644 --- a/GerenciaProjetos/Views/Shared/_Layout.cshtml +++ b/GerenciaProjetos/Views/Shared/_Layout.cshtml @@ -21,7 +21,7 @@
-