EnVisageOnline/Beta/Source/EnVisage/Views/GLAccount/Edit.cshtml

74 lines
3.0 KiB
Plaintext

@model EnVisage.Models.GLAccountModel
@{
ViewBag.Title = Model != null ? "Edit " + Model.Name : "Add New GL Account";
}
@section Scripts
{
<script type="text/javascript">
emulateNavUrl = "/GLAccount";
</script>
<script type="text/javascript">
init.push(function() {
@if (Model.Id != Guid.Empty)
{
<text>
StartEdit('GLAccount', '@Model.Id', "#btnDelete", "#btnsave", "erorMsgPlaceholder");
</text>
}
$('#btnsave').click(function () {
if ($(this).parents('form').valid())
blockUI();
});
});
</script>
}
<div id="erorMsgPlaceholder"></div>
@using (Html.BeginForm("Edit", "GLAccount", FormMethod.Post, new { @class = "panel form-horizontal" }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(t => t.Id)
<div class="panel-body">
<fieldset id="fsBasic">
<legend class="text-bold">Account Information</legend>
<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>
<div class="form-group">
@Html.LabelFor(model => model.GLNumber, new { @class = "col-sm-2 control-label" })
<div class="col-sm-10">
@Html.TextBoxFor(model => model.GLNumber, new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.GLNumber)
</div>
</div>
</fieldset>
@Html.ValidationSummary(false, "The GL Account 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", "GLAccount")"><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.ExpenditureCount > 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", "GLAccount", new { @id = Model.Id })"><i class="fa fa-trash-o"></i> Delete</a>
}
}
</div>
</div>
<div><span class="h1">&nbsp;</span></div>
<div><span class="h1">&nbsp;</span></div>
</div>
}