@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.LabelFor(model => model.LIBELLE, "NOM DU MEDICAMENT", htmlAttributes: new { @class = "control-label " })
@Html.EditorFor(model => model.LIBELLE, new { htmlAttributes = new { @class = "form-control", @required = "true" } })
@Html.ValidationMessageFor(model => model.LIBELLE, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.POSOLOGIE, htmlAttributes: new { @class = "control-label " })
@Html.EditorFor(model => model.POSOLOGIE, new { htmlAttributes = new { @class = "form-control", @required = "true" } })
@Html.ValidationMessageFor(model => model.POSOLOGIE, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.QUANTITE, htmlAttributes: new { @class = "control-label " })
@Html.EditorFor(model => model.QUANTITE, new { htmlAttributes = new { @class = "form-control", @min = "1", @required = "true" } })
@Html.ValidationMessageFor(model => model.QUANTITE, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.PRIXUNITAITRE, "PRIX UNITAIRE", htmlAttributes: new { @class = "control-label " })
@Html.EditorFor(model => model.PRIXUNITAITRE, new { htmlAttributes = new { @class = "form-control", @min = "100", @required = "true" } })
@Html.ValidationMessageFor(model => model.PRIXUNITAITRE, "", new { @class = "text-danger" })
}
@if (ViewData["LISTEMEDICAMENT"] != null)
{
int TOTALPRESTATION = 0;
@Html.DisplayNameFor(model => model.LIBELLE)
|
@Html.DisplayNameFor(model => model.POSOLOGIE)
|
@Html.DisplayNameFor(model => model.QUANTITE)
|
PRIX UNITAIRE
|
TOTAL |
|
@foreach (var item in ViewData["LISTEMEDICAMENT"] as IList)
{
@Html.DisplayFor(modelItem => item.LIBELLE)
|
@Html.DisplayFor(modelItem => item.POSOLOGIE)
|
@Convert.ToInt32(item.QUANTITE).ToString("n0")
|
@Convert.ToInt32(item.PRIXUNITAITRE).ToString("n0")
|
@{
var total = item.PRIXUNITAITRE * item.QUANTITE;
TOTALPRESTATION = TOTALPRESTATION + Convert.ToInt32(total);
}
@Convert.ToInt32(total).ToString("n0")
|
|
}
TOTAL PRESTATION : @Convert.ToInt32(TOTALPRESTATION).ToString("n0")
}