89 lines
3.7 KiB
Plaintext
89 lines
3.7 KiB
Plaintext
@model EnVisage.Models.ContactModel
|
|
|
|
@{
|
|
ViewBag.Title = Model != null && Model.Id != Guid.Empty ? "Edit " + Model.FirstName + " " + Model.LastName : "Add New Contact";
|
|
}
|
|
@section Scripts
|
|
{
|
|
<script type="text/javascript">
|
|
emulateNavUrl = "/Contact";
|
|
</script>
|
|
<script type="text/javascript">
|
|
init.push(function () {
|
|
@if (Model.Id != Guid.Empty)
|
|
{
|
|
@:StartEdit('Contact', '@Model.Id', "#btnDelete", "#btnsave", "erorMsgPlaceholder");
|
|
}
|
|
$('#btnsave').click(function () {
|
|
if ($(this).parents('form').valid())
|
|
blockUI();
|
|
});
|
|
$("#@Html.IdFor(t=>t.ParentId)").select2();
|
|
});
|
|
</script>
|
|
}
|
|
<div id="erorMsgPlaceholder"></div>
|
|
|
|
@using (Html.BeginForm("Edit", "Contact", FormMethod.Post, new { @class = "panel form-horizontal" }))
|
|
{
|
|
@Html.AntiForgeryToken()
|
|
@Html.HiddenFor(t=>t.Id)
|
|
<div class="panel-body">
|
|
<div class="form-group">
|
|
<label class="control-label col-md-2" for="ParentId">Business Unit</label>
|
|
<div class="col-md-10">
|
|
@Html.EditorFor(model => model.ParentId)
|
|
@Html.ValidationMessageFor(model => model.ParentId)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.FirstName, new { @class = "control-label col-md-2" })
|
|
<div class="col-md-10">
|
|
@Html.TextBoxFor(model => model.FirstName, new { @class = "form-control" })
|
|
@Html.ValidationMessageFor(model => model.FirstName)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.LastName, new { @class = "control-label col-md-2" })
|
|
<div class="col-md-10">
|
|
@Html.TextBoxFor(model => model.LastName, new { @class = "form-control" })
|
|
@Html.ValidationMessageFor(model => model.LastName)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.Email, new { @class = "control-label col-md-2" })
|
|
<div class="col-md-10">
|
|
@Html.TextBoxFor(model => model.Email, new { @class = "form-control" })
|
|
@Html.ValidationMessageFor(model => model.Email)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.Phone, new { @class = "control-label col-md-2" })
|
|
<div class="col-md-10">
|
|
@Html.TextBoxFor(model => model.Phone, new { @class = "form-control" })
|
|
@Html.ValidationMessageFor(model => model.Phone)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.ContactClassification, new { @class = "control-label col-md-2" })
|
|
<div class="col-md-10">
|
|
@Html.DropDownListFor(model => model.ContactClassification, EnVisage.Code.Utils.GetContactClassification(), new { @class = "form-control" })
|
|
@Html.ValidationMessageFor(model => model.ContactClassification)
|
|
</div>
|
|
</div>
|
|
|
|
@Html.ValidationSummary(false, "The contact 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", "Contact")"><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>
|
|
<a id="btnDelete" class="btn btn-danger" href="@Url.Action("Delete", "Contact", new {@id = Model.Id})"><i class="fa fa-trash-o"></i> Delete</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
} |