71 lines
2.8 KiB
Plaintext
71 lines
2.8 KiB
Plaintext
@model EnVisage.Models.CreditDepartmentModel
|
|
|
|
@{
|
|
ViewBag.Title = Model != null && Model.Id != Guid.Empty ? "Edit " + Model.Name : "Add New Cost Center";
|
|
}
|
|
|
|
@section Scripts
|
|
{
|
|
<script type="text/javascript">
|
|
emulateNavUrl = "/CreditDepartment";
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
init.push(function () {
|
|
@if (Model.Id != Guid.Empty)
|
|
{
|
|
<text>
|
|
StartEdit('CreditDepartment', '@Model.Id', "#btnDelete", "#btnsave", "erorMsgPlaceholder");
|
|
</text>
|
|
}
|
|
$('#btnsave').click(function () {
|
|
if ($(this).parents('form').valid())
|
|
blockUI();
|
|
});
|
|
});
|
|
</script>
|
|
|
|
}
|
|
|
|
<div id="erorMsgPlaceholder"></div>
|
|
|
|
@using (Html.BeginForm("Edit", "CreditDepartment", FormMethod.Post, new { @class = "panel form-horizontal" }))
|
|
{
|
|
@Html.HiddenFor(model => model.Id)
|
|
@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>
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.CreditNumber, new { @class = "col-sm-2 control-label" })
|
|
<div class="col-sm-10">
|
|
@Html.TextBoxFor(model => model.CreditNumber, new { @class = "form-control" })
|
|
@Html.ValidationMessageFor(model => model.CreditNumber)
|
|
</div>
|
|
</div>
|
|
@Html.ValidationSummary(false, "The cost center 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", "CreditDepartment")"><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.ExpenditureCategoryCount > 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", "CreditDepartment", new { @id = Model.Id })"><i class="fa fa-trash-o"></i> Delete</a>
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
} |