1
How to create a mechanism for when the user clicks to try to change a date that is like datepicker
and display a popup for authentication or something like that to make that change? If he has permission, he can, otherwise, he can’t do it.
<script type="text/javascript">
jQuery(function ($) {
$.datepicker.regional['pt-BR'] = {
closeText: 'Fechar',
prevText: '<Anterior',
nextText: 'Próximo>',
currentText: 'Hoje',
monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho',
'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
monthNamesShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun',
'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
dayNames: ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sabado'],
dayNamesShort: ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'],
dayNamesMin: ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'],
weekHeader: 'Sm',
dateFormat: 'dd/mm/yy',
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''
};
$.datepicker.setDefaults($.datepicker.regional['pt-BR']);
});
</script>
<script type="text/javascript">
$(document).ready(function () {
$("#txtNovaDtVenc").datepicker(
{ changeMonth: true, changeYear: true }).attr('readonly', 'readonly');
});
</script>
@using (Html.BeginForm("Detalhes", "Faturas", FormMethod.Post, new { target = "_blank" }))
{
<div class="div-detalhes">
<label>
@Html.Hidden("NumeroDoc", Model.NumeroDocumento)
@Html.DisplayNameFor(model => model.NumeroDocumento) :
@Html.DisplayFor(model => model.NumeroDocumento)
</label>
<label>
Sacado :
@Html.DisplayFor(model => model.sacado.Nome)
</label>
<label>
@Html.DisplayNameFor(model => model.ValorBoleto) :
@Html.DisplayFor(model => model.ValorBoleto)
</label>
<label>
@Html.DisplayNameFor(model => model.DataVencimento) :
@Html.DisplayFor(model => model.DataVencimento)
</label>
<label>
@Html.DisplayNameFor(model => model.DataDocumento) :
@Html.DisplayFor(model => model.DataDocumento)
</label>
<label>
Nova dt. de vencimento :
@Html.TextBox("txtNovaDtVenc", "", new { @class = "form-control form-control-custom", style="width:100px" })
</label>
<label>
<input class="btn btn-padrao-bv" type="submit" id="btnImprimir" value="Imprimir"/> |
<button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
</label>
</div>
}
You already have some form of authentication in your application?
– Randrade
@Randrade Cara, had, but the staff asked to take and now asked to put only for those who change this date that in the case is a due date of a billet.
– AndreeH