I have the following @HtmlAction link in Razor view/Bootstrap button which checks a user role and a Boolean flag to see if a routed current record is received for processing. The solution is using ASP.NET MVC4 and C#.
<div class="panel-heading">
<span>
Production Submission Summary
<span class="pull-right" style="margin-top:-8px">
@if (User.IsInRole("Admin") && !ProdHeader.Received)
{
@Html.ActionLink("Receive Shipment", "ReceiveSubmission", new { ProdHeaderId = Model.ProdHeader.Id }, new { @class = "btn btn-default" })
}
</span>
</span>
</div>
I want to add another comparison that will check the status of a Boolean field called PaymentReceived and if Paymentreceived is true I want to disable the PaymentReceived action link button and enable Shipment received action link above. So the Shipmentreceived button should be disabled until the Paymentreceived button is clicked and then the PaymentReceived should be disabled and the shipmentreceived button should be activated. I have the Action link for the Paymentreceived set up like above but not sure where to check the Boolean comparison. Should it be in the same div as the ReceiveSubmission action link or by itself and which comparison should be done first? Thanks so much
HERE is the full code segment. Can I just use a id in a div and make the one that needs to be hidden toggle ?
@if (User.IsInRole("Admin") || User.IsInRole("Prod") && (!Model.ProdTypeHeader.ReceivedPayment))
{
@Html.ActionLink("Receive Payment", "ReceivePayment", new { prodTypeHeaderId = Model.ProdTypingHeader.Id}, new { @class = "btn btn-default" })
@Html.ActionLink("Receive Shipment", "ReceivePayment", new { prodTypeHeaderId = Model.ProdTypingHeader.Id}, new { @class = "btn btn-default", disabled = "disabled" }) *@
}
@if (User.IsInRole("Admin") || User.IsInRole("Finance") && (!ModelProdTypeHeader.Received))
{
@Html.ActionLink("Receive Shipment", "ReceiveSubmission", new { prodTypeHeaderId = Model.ProdTypeHeader.Id}, new { @class = "btn btn-default" })
@Html.ActionLink("Receive Payment", "ReceivePayment", new { prodTypeHeaderId = Model.ProdTypeHeader.Id}, new { @class = "btn btn-default" , disabled = "disabled"})
}