prasadnarwadkar_ASPNETCorePostgreSQL/ASPNETIdentityPostgres/Areas/ADT/Views/Patients/ReadTheAnswerAndRateIt.cshtml
@model ASPNETIdentityPostgres.Areas.ADT.Models.ReviewAndAnswerTask

@{
    ViewData["Title"] = "Review and Answer Claim";
    Layout = "_Layout";

    var username = User.Identity.Name;

    var bpmRole = "";

    var mapping = ASPNETIdentityPostgres.Areas.ADT.Models.WebAppAndBPMUserMap.mappings.FirstOrDefault(m => m.UserNameOnWebApp.ToLower() == username.ToLower());

    if (mapping != null)
    {
        bpmRole = mapping.UserRoleOnBPMEngineOrApp;
    }
}

<h3>Read the answer to your claim by the reviewer and rate how satisfied you are.</h3><p class="text-info">Please use authorize attribute to restrict certain role(s) from doing this task. Or you can also do this programmatically. </p>

<hr />
<div class="row">
    <div class="col-md-4">
        @if (bpmRole == "claim_initiator")
        {
            <p class="alert-info small">You are a claim initiator (a customer). You can raise claims and review the answer/comments from the claim reviewer and rate how satisfied you are with the service.</p>
        }
        <form asp-action="ReadTheAnswerAndRateIt">
            <div asp-validation-summary="All" class="text-danger"></div>
            @Html.HiddenFor(model => model.TaskId)
            <div class="form-group">
                <label asp-for="description" class="control-label">Description</label>
                <input asp-for="description" class="form-control" readonly />
                <span asp-validation-for="description" class="text-danger"></span>
            </div>

            <div class="form-group">
                <label asp-for="answer" class="control-label">Answer</label>
                <input asp-for="answer" class="form-control" readonly />
                <span asp-validation-for="answer" class="text-danger"></span>
            </div>

            <div class="form-group">
                <label asp-for="satisfactionLevel" class="control-label">Satisfaction Level</label>
                <input asp-for="satisfactionLevel" class="form-control" value="1" type="number" min="1" max="5" />
                <span asp-validation-for="satisfactionLevel" class="text-danger"></span>
            </div>
            <div class="form-group">
                <input type="submit" value="Rate it" class="btn btn-primary" />
            </div>
        </form>
    </div>
</div>

@*<div>
        <a asp-action="Index">Back to List</a>
    </div>*@

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
