demo20230512/Areas/admin/Views/Company/EditCompany.cshtml

144 lines
7.1 KiB
Plaintext
Raw Normal View History

2023-05-12 10:20:28 +08:00
@using Weee.Models.ExtensionMethods
@using Resources
@model Weee.Models.NormalCompany
@{
ViewBag.Title = Resource.StaticLabelCompanyList;
Layout = "~/Areas/admin/Views/Shared/_AdminLayout.cshtml";
var companyAdmin = Model.Users.Where(x => x.IsCompanyAdmin).SingleOrDefault();
var adminAccountName = companyAdmin==null?"":companyAdmin.UserName;
var accountCount = Model.Users.Count;
}
<div class="col-md-12">
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<h2 style="margin-top: 20px;">@Resource.NormalCompany</h2>
<hr />
<div class="form-horizontal" style="padding: 2% 5%">
<div>
@Html.ValidationSummary(true)
@Html.HiddenFor(model => model.ID)
@Html.HiddenFor(model => model.UID)
@Html.HiddenFor(model => model.Status)
</div>
<div class="form-group">
@Html.LabelFor(model => model.Name, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.EnglishName, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(model => model.EnglishName, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.EnglishName, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Address, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(model => model.Address, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Address, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.VATNumber, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(model => model.VATNumber, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.VATNumber, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.NumberOfEmployees, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(model => model.NumberOfEmployees, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.NumberOfEmployees, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.CEOName, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(model => model.CEOName, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.CEOName, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Capital, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(model => model.Capital, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Capital, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Description, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(model => model.Description, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Description, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.WebSiteUrl, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(model => model.WebSiteUrl, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.WebSiteUrl, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Status, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Model.Status.DisplayString()
@Html.ValidationMessageFor(model => model.Status, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<label class="control-label docs-control-label col-xs-3">@Resource.UserAccountName</label>
<div class="col-xs-9">
<input class="form-control text-box single-line"
type="text"
readonly
value="@adminAccountName" />
</div>
</div>
<div class="form-group">
<label class="control-label docs-control-label col-xs-3">@Resource.Quantity</label>
<div class="col-xs-9">
<input class="form-control text-box single-line"
type="text"
readonly
value="@accountCount" />
</div>
</div>
<div class="form-group" style="padding-top: 10px;">
<div class="col-md-offset-2 col-md-10 text-right">
<input type="submit" value="@Resource.StaticLabelGlobal_Save" class="btn btn-default" />
@Html.ActionLink(Resource.StaticLabelGlobal_Cancel, "Index", new { }, new { @class = "btn btn-default" })
@if (Model.Status == Weee.Models.CompanyStatus.New || Model.Status == Weee.Models.CompanyStatus.Inactive)
{
@Html.ActionLink(Resource.Active, "Active", new { id = Model.ID }, new { @class = "btn btn-default" })
}
else
{
@Html.ActionLink(Resource.DeActive, "Deactive", new { id = Model.ID }, new { @class = "btn btn-default" })
}
</div>
</div>
</div>
}
</div>
<div class="col-md-2"></div>