EnVisageOnline/Main/Source/EnVisage/Views/Company/_addCompany.cshtml

81 lines
3.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@using EnVisage.Code
@using EnVisage.Code.HtmlHelpers
@model EnVisage.Models.CompanyModel
@{
ViewBag.Title = Model.Id != Guid.Empty ? "Edit " + Model.Name : "Add New Company";
var availableUsers = Utils.GetUsers(false);
}
@using (Html.BeginForm("Edit", "Company", FormMethod.Post, new { @class = "panel form-horizontal innerForm" }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(model => model.Id)
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">@ViewBag.Title</h4>
</div>
<div class="modal-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", @id = "IDDDD" })
@Html.ValidationMessageFor(model => model.Name)
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.ParentCompanyId, "Parent Company", new { @class = "control-label col-sm-2" })
<div class="col-sm-10">
@Html.DropDownListFor(model => model.ParentCompanyId, Utils.GetParentCompanies(), new { @class = "form-control disabled" })
@Html.ValidationMessageFor(model => model.ParentCompanyId)
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Clients</label>
<div class="col-sm-10">
@Html.Partial("_clients", Utils.GetClients())
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Views</label>
<div class="col-sm-10">
@Html.Partial("_views", Utils.GetAllViews())
</div>
</div>
<div class="form-group select2-primary">
@Html.LabelFor(model => model.Watchers, new { @class = "col-sm-2 control-label" })
<div class="col-sm-10">
@Html.DropDownListFor(model => model.Watchers, availableUsers, new { @class = "form-control", @multiple = "multiple" })
</div>
</div>
<div class="form-group select2-primary">
@Html.LabelFor(model => model.Contributors, new { @class = "col-sm-2 control-label" })
<div class="col-sm-10">
@Html.DropDownListFor(model => model.Contributors, availableUsers, new { @class = "form-control", @multiple = "multiple" })
</div>
</div>
@Html.ValidationSummary(false, "The company could not be saved due to the following errors:")
<div class="modal-footer" style="margin-bottom: 0;">
<div class="col-sm-offset-2 col-sm-10">
@*<a class="btn btn-primary" href="@Url.Action("Index", "Company")"><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.ProjectsCount > 0 || Model.CompaniesCount > 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", "Company", new {@id = Model.Id})"><i class="fa fa-trash-o"></i> Delete</a>
}
}
</div>
</div>
</div>
</div>
}