65 lines
2.4 KiB
Plaintext
65 lines
2.4 KiB
Plaintext
@model EnVisage.Models.ExpenditureModel
|
|
|
|
@{
|
|
ViewBag.Title = Model != null && Model.Id != Guid.Empty ? "Edit " + Model.Name : "Add New Expenditure";
|
|
}
|
|
|
|
@section Scripts
|
|
{
|
|
<script type="text/javascript">
|
|
emulateNavUrl = "/Expenditure";
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
init.push(function () {
|
|
@if (Model != null)
|
|
{
|
|
<text>
|
|
StartEdit('Expenditure', '@Model.Id', "#btnDelete", "#btnsave", "erorMsgPlaceholder"); });
|
|
</text>
|
|
}
|
|
$('#btnsave').click(function () {
|
|
if ($(this).parents('form').valid())
|
|
blockUI();
|
|
});
|
|
</script>
|
|
|
|
}
|
|
|
|
<div id="erorMsgPlaceholder"></div>
|
|
|
|
@using (Html.BeginForm("Edit", "Expenditure", FormMethod.Post, new { @class = "panel form-horizontal" }))
|
|
{
|
|
@Html.AntiForgeryToken()
|
|
|
|
<div class="panel-body">
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.Name, new { @class = "col-sm-2 control-label" })
|
|
<div class="col-sm-10">
|
|
@Html.TextBoxFor(model => model.Name, new { @class = "form-control" })
|
|
@Html.ValidationMessageFor(model => model.Name)
|
|
</div>
|
|
</div>
|
|
@Html.ValidationSummary(false, "The client could not be saved due to the following errors:")
|
|
<div class="form-group" style="margin-bottom: 0;">
|
|
<div class="col-sm-offset-2 col-sm-10">
|
|
<a class="btn btn-primary" href="@Url.Action("Index", "Expenditure")"><i class="fa fa-backward"></i> Back to list</a>
|
|
<button type="submit" class="btn btn-success" id="btnsave"><i class="fa fa-save"></i> Save</button>
|
|
@if (Model != null && Model.Id != Guid.Empty)
|
|
{
|
|
if (Model.CategoriesCount > 0)
|
|
{
|
|
<a id="btnDelete" class="btn btn-danger disabled" href="javascript:void(0);"><i class="fa fa-trash-o"></i> Delete</a>
|
|
}
|
|
else
|
|
{
|
|
<a id="btnDelete" class="btn btn-danger" href="@Url.Action("Delete", "Expenditure", new { @id = Model.Id })"><i class="fa fa-trash-o"></i> Delete</a>
|
|
}
|
|
}
|
|
</div>
|
|
@if (Model != null) { Html.HiddenFor(model => model.Id); }
|
|
</div>
|
|
</div>
|
|
}
|