How do I make the View
of request only appear to the user, when the confirmation of class Aprovacao
is true
.
Follow logic:
The user creates the request and registers,
2- User waits for confirmation of request made
3- if the request is approved
4 user can see the registered request
Models:
public class Solicitacao
{
public int SolicitacaoId { get; set; }
public bool Status { get; set; }
public string servico { get; set; }
}
I would like this class to confirm the request
public class Aprovacao
{
public int AprovacaoId { get; set; }
public string Aprova { get; set; }
public int SolicitacaoId { get; set; }
public virtual Solicitacao _Solicitacao{ get; set; }
}
View:
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>Solicitacao</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.Status, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
<div class="checkbox">
@Html.EditorFor(model => model.Status)
@Html.ValidationMessageFor(model => model.Status, "", new { @class = "text-danger" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Servico, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Servico, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Servico, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
</div>
}
What method would I use to make this commit in%% of Approval?