Skip to content

Commit

Permalink
Desenvolvimento do Listar - Funcionario, via View.
Browse files Browse the repository at this point in the history
  • Loading branch information
glaucia86 committed Dec 10, 2017
1 parent 54ebdbd commit cfdce27
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ funcionarioApp.controller('funcionarioCtrl', function ($scope, funcionarioServic
function carregarFuncionarios() {
var listarFuncionarios = funcionarioService.getTodosFuncionarios();


listarFuncionarios.then(function (d) {
//se tudo der certo:
$scope.Funcionarios = d.data;
Expand Down
3 changes: 3 additions & 0 deletions Emp_XPTO/CRUD_MVC5_AngularJs/App_Start/BundleConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public static void RegisterBundles(BundleCollection bundles)
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));

bundles.Add(new ScriptBundle("~/bundles/angular").Include(
"~/Scripts/angular.js"));
}
}
}
63 changes: 35 additions & 28 deletions Emp_XPTO/CRUD_MVC5_AngularJs/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
@{
ViewBag.Title = "Home Page";
}
<div class="container" ng-controller="funcionarioCtrl">
<div class="panel panel-info">
<div class="panel-heading">Listar Funcionários</div>

<div class="jumbotron">
<h1>ASP.NET</h1>
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
<p><a href="https://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
</div>
<table class="table table-bordered center">
<thead style="background-color: burlywood;">
<tr>
<th class="text-center">Id Funcionário</th>
<th class="text-center">Nome</th>
<th class="text-center">Email</th>
<th class="text-center">Departamento</th>
<th class="text-center">Cargo</th>
<th class="text-center">Ação</th>
</tr>
</thead>

<div class="row">
<div class="col-md-4">
<h2>Getting started</h2>
<p>
ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that
enables a clean separation of concerns and gives you full control over markup
for enjoyable, agile development.
</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301865">Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Get more libraries</h2>
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301866">Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Web Hosting</h2>
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301867">Learn more &raquo;</a></p>
<tbody>
<tr ng-repeat="func in Funcionarios">
<td class="text-center">{{func.FuncionarioId}}</td>
<td class="text-center">{{func.Nome}}</td>
<td class="text-center">{{func.Email}}</td>
<td class="text-center">{{func.Departamento}}</td>
<td class="text-center">{{func.Cargo}}</td>
<td class="text-center" style="width: 200px">
<a href="#" class="btn btn-info"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="#" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

@section scripts {
<script src="~/AngularJsApp/Funcionario/Modulejs.js"></script>
<script src="~/AngularJsApp/Funcionario/Service.js"></script>
<script src="~/AngularJsApp/Funcionario/Controller.js"></script>
}
26 changes: 18 additions & 8 deletions Emp_XPTO/CRUD_MVC5_AngularJs/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - My ASP.NET Application</title>
<title>@ViewBag.Title - Tutorial CRUD: MVC 5 + EF + AngularJs</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<body ng-app="funcionarios">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
Expand All @@ -27,16 +27,26 @@
</div>
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
</footer>
<div class="container body-content">
<div class="jumbotron">
<h1 class="text-center"><span class="glyphicon glyphicon-log-out" aria-hidden="true"></span>&nbsp;Tutorial CRUD: MVC 5 + EF + AngularJs</h1>
<h2 class="text-center">Glaucia Lemos</h2>
<h3 class="text-center">Software Engineer</h3>
<h4 class="text-center">Desenvolvido com muito <span class="glyphicon glyphicon-heart" aria-hidden="true"></span> Brasil, Rio de Janeiro <a href="http://www.code4coders.wordpress.com" target="_blank"> @DateTime.Now.Year</a> </h4>

</div>

@RenderBody()
<hr/>
<footer>
<p class="text-center">&copy; @DateTime.Now.Year - My ASP.NET Application by Glaucia Lemos</p>
</footer>
</div>

@Scripts.Render("~/bundles/angular")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)

</body>
</html>

0 comments on commit cfdce27

Please sign in to comment.