Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult EditarMes()
- {
- return View();
- }
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AcceptVerbs(HttpVerbs.Post)]
- public ActionResult EditarMes(IList<ClientePrestacaoViewModel> prestacaoViewModel)
- {
- if (!ModelState.IsValid) return View("Index");
- foreach (var item in prestacaoViewModel.Where(item => item != null))
- {
- _cliente.Atualizar(item);
- TempData["MensagemSuccess"] = "Cliente alterado com sucesso!";
- }
- return Redirect(ControllerContext.HttpContext.Request.UrlReferrer.ToString());
- }
- @using PrestacaoWeb.Application.ViewModels
- @model List<PrestacaoWeb.Application.ViewModels.ClientePrestacaoViewModel>
- @{
- ViewBag.Title = "Obrigações";
- }
- @using (Html.BeginForm("EditarMes", "Cliente", FormMethod.Post))
- {
- @Html.AntiForgeryToken()
- <div class="modal-dialog modal-lg">
- <div class="modal-content-Listar">
- <div class="modal-header">
- <h4 class="modal-title" id="myModalLabel"> </h4>
- </div>
- <div class="row">
- <div class="container">
- <div class="checkBoxTips">
- <div class="form-horizontal">
- <br />
- <table style="width:1149px;" id="tblPrestacao" class="table-striped cell-border tblCompleta ">
- <thead>
- <tr bgcolor="#F1F1F1">
- <th><p align="center">Cliente</p></th>
- @if (ViewBag.Janeiro == true)
- {
- <th bgcolor="#F0E68C"><p align="center">1</p></th>
- }
- else
- {
- <th><p align="center">1</p></th>
- }
- @if (ViewBag.Fevereiro == true)
- {
- <th bgcolor="#F0E68C"><p align="center">2</p></th>
- }
- else
- {
- <th><p align="center">2</p></th>
- }
- @if (ViewBag.Marco == true)
- {
- <th bgcolor="#F0E68C"><p align="center">3</p></th>
- }
- else
- {
- <th><p align="center">3</p></th>
- }
- @if (ViewBag.Abril == true)
- {
- <th bgcolor="#F0E68C"><p align="center">4</p></th>
- }
- else
- {
- <th><p align="center">4</p></th>
- }
- <th><p align="center">Cidade</p></th>
- <th><p align="center">Pendência</p></th>
- <th><p align="center">Responsável</p></th>
- <th><p align="center">Observação</p></th>
- </tr>
- </thead>
- <tbody>
- @if (ViewBag.TipoPrestacao != null)
- {
- @Html.Partial("_MesesQuadrimestralPrestacao")
- }
- </tbody>
- </table>
- </div>
- <hr />
- </div>
- </div>
- </div>
- </div>
- </div>
- }
- <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- @Html.Partial("Atualizar", new ClienteViewModel());
- </div>
- <div class="modal fade" id="myModalAdd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- @Html.Partial("Adicionar", new ClienteViewModel());
- </div>
- @section Scripts {
- <script>
- $(document).ready(function () {
- $('#tblPrestacao').DataTable({
- "scrollCollapse": false,
- "paging": false,
- "info": false,
- "bSort": false,
- language: {
- "search": "Filtrar:",
- "emptyTable": "Nenhum registro encontrado utilizando este filtro.",
- "zeroRecords": "Nenhum registro encontrado utilizando este filtro."
- },
- "columnDefs": [
- {
- "targets": 5,
- "visible": false,
- "searchable": true
- }
- ],
- });
- });
- </script>
- }
- @using PrestacaoWeb.UI.Helpers
- @model List<PrestacaoWeb.Application.ViewModels.ClientePrestacaoViewModel>
- @for (int i = 0; i < Model.Count(); i++)
- {
- <tr>
- @Html.HiddenFor(model => model[i].ClienteId)
- <td style="width: 400px">@Html.DisplayFor(model => model[i].Cliente.NomeEntidade)</td>
- <td><p align="center"> <b>@Html.CheckBoxFor(model => Model[i].EnvioPrestacao.bJaneiro, new { disabled = "disabled" })</b> </p> </td>
- <td><p align="center"> <b>@Html.CheckBoxFor(model => Model[i].EnvioPrestacao.bFevereiro, new { disabled = "disabled" })</b> </p> </td>
- <td><p align="center"> <b>@Html.CheckBoxFor(model => Model[i].EnvioPrestacao.bMarco, new { disabled = "disabled" })</b> </p> </td>
- <td><p align="center"> <b>@Html.CheckBoxFor(model => Model[i].EnvioPrestacao.bAbril, new { disabled = "disabled" })</b> </p> </td>
- <td> @Model[i].Cliente.Cidade.Nome</td>
- <td align="center" style="width: 20px">
- <input type="text" value=" " disabled style="width: 77px" title="Cliente sem pendências." />
- </td>
- <td style="width: 100px">
- <p align="center">@Model[i].Cliente.Responsavel</p>
- </td>
- <td style="width: 210px">
- <p align="center">@Model[i].Cliente.Observacao.DisplayText(30)</p>
- </td>
- </tr>
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement