202 lines
12 KiB
Plaintext
202 lines
12 KiB
Plaintext
@{
|
|
ViewData["Title"] = "Index";
|
|
Layout = "~/Views/Shared/_Layout.cshtml";
|
|
}
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
function onInitNewRow(e, CompanyTIN,CompanyName) {
|
|
|
|
e.data.CompanyTIN = CompanyTIN;
|
|
e.CompanyName = CompanyName;
|
|
|
|
}
|
|
//]]>
|
|
</script>
|
|
<div class="row primary">
|
|
<div class="col-md-12">
|
|
<div class="card">
|
|
<div class="card-header primary">
|
|
<h1 class="card-title text-succes"><span class="text-blue"> <i class="fas fa-business-time text-blue"></i> List of Companies</span></h1>
|
|
|
|
<div class="card-tools">
|
|
<button type="button" class="btn btn-tool" data-card-widget="collapse">
|
|
<i class="fas fa-minus"></i>
|
|
</button>
|
|
<div class="btn-group">
|
|
<button type="button" class="btn btn-tool dropdown-toggle" data-toggle="dropdown">
|
|
<i class="fas fa-wrench"></i>
|
|
</button>
|
|
<div class="dropdown-menu dropdown-menu-right" role="menu">
|
|
<a href="#" class="dropdown-item">Action</a>
|
|
<a href="#" class="dropdown-item">Another action</a>
|
|
<a href="#" class="dropdown-item">Something else here</a>
|
|
<a class="dropdown-divider"></a>
|
|
<a href="#" class="dropdown-item">Separated link</a>
|
|
</div>
|
|
</div>
|
|
<button type="button" class="btn btn-tool" data-card-widget="remove">
|
|
<i class="fas fa-times"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<!-- /.card-header -->
|
|
<div class="card-body">
|
|
<div class="row">
|
|
|
|
@(Html.DevExtreme().DataGrid<Onestopshop.Models.CompanyProfile>
|
|
()
|
|
.DataSource(ds => ds.WebApi()
|
|
.RouteName("CompanyProfile")
|
|
.LoadAction("GetCompanyProfile")
|
|
// .InsertAction("AddNewUser")
|
|
.UpdateAction("UpdateProfile")
|
|
|
|
|
|
.Key("CompanyTIN")
|
|
)
|
|
.RemoteOperations(true)
|
|
.ColumnAutoWidth(false)
|
|
.AllowColumnResizing(true)
|
|
|
|
.Columns(columns =>
|
|
{
|
|
|
|
|
|
|
|
|
|
columns.AddFor(m => m.CompanyID).Visible(true).SortOrder(SortOrder.Desc);
|
|
columns.AddFor(m => m.CompanyName);
|
|
columns.AddFor(m => m.CompanyEmail).Visible(false);
|
|
columns.AddFor(m => m.IncorpCertNo).Visible(false);
|
|
columns.AddFor(m => m.IncorpCertDate).Visible(false);
|
|
columns.AddFor(m => m.Telephone).DataField("CompanyID")
|
|
.Caption("Apply Amendment").CellTemplate(@Html.ActionLink(" Amendment", "ProjectByTIN", "CompanyAmendmentsApplication",
|
|
new { CompanyTIN = "TIN_ID", CompanyName = "COMP_NAME" }, new { @class = "fa fa-pen text-danger" })
|
|
.ToHtmlString()
|
|
.Replace("TIN_ID", "<%= data.CompanyTIN%>")
|
|
.Replace("COMP_NAME", "<%= data.CompanyName%>")
|
|
|
|
);
|
|
columns.AddFor(m => m.Region).Lookup(lookup => lookup
|
|
.DataSource(d => d.WebApi().RouteName("DataCleaningAPI").LoadAction("GetRegion").Key("RegionID")).DisplayExpr("RegionName")
|
|
.ValueExpr("RegionName")
|
|
);
|
|
columns.AddFor(m => m.District).Visible(false);
|
|
columns.AddFor(m => m.District).DataField("District")
|
|
.Caption("Expansion").CellTemplate(@Html.ActionLink(" Expansion", "ProjectByTINExpansion", "CompanyProfile",
|
|
new { CompanyTIN = "TIN_ID", CompanyName = "COMP_NAME" }, new { @class = "fa fa-shower text-success" })
|
|
.ToHtmlString()
|
|
.Replace("TIN_ID", "<%= data.CompanyTIN%>")
|
|
.Replace("COMP_NAME", "<%= data.CompanyName%>")
|
|
|
|
);
|
|
columns.AddFor(m => m.CompanyType).Visible(false);
|
|
columns.AddFor(m => m.BlockPlotNumber).Visible(false);
|
|
|
|
columns.AddFor(m => m.PhysicalAddress).DataField("CompanyID")
|
|
.Caption("New").CellTemplate(@Html.ActionLink(" New Project", "ProjectByTIN", "CompanyProfile",
|
|
new { CompanyTIN = "TIN_ID", CompanyName = "COMP_NAME" }, new { @class = "fa fa-sun text-primary" })
|
|
.ToHtmlString()
|
|
.Replace("TIN_ID", "<%= data.CompanyTIN%>")
|
|
.Replace("COMP_NAME", "<%= data.CompanyName%>")
|
|
|
|
);
|
|
|
|
|
|
|
|
columns.AddFor(m => m.CompanyMobile).Visible(false);
|
|
columns.AddFor(m => m.AddedBy).Visible(false);
|
|
columns.AddFor(m => m.CreatedDate).Visible(false);
|
|
columns.AddFor(m => m.CompanyTIN);
|
|
columns.AddFor(m => m.PhysicalAddress).Visible(false);
|
|
columns.AddFor(m => m.PostalAddress).Visible(false);
|
|
|
|
})
|
|
|
|
.SearchPanel(f => f.Visible(true))
|
|
.Paging(p => p.PageSize(10))
|
|
.HeaderFilter(f => f.Visible(true))
|
|
.Grouping(g => g.ContextMenuEnabled(true))
|
|
.Grouping(g => g.AutoExpandAll(true))
|
|
.Selection(s => s.Mode(SelectionMode.Multiple))
|
|
.Export(e => e.Enabled(true).FileName("ListofCompanies").AllowExportSelectedData(true))
|
|
.Editing(e => e
|
|
.AllowAdding(false).Popup(p => p
|
|
.Title("Company Profile")
|
|
.ShowTitle(true)
|
|
.Width(900)
|
|
.Height(500)
|
|
|
|
.Position(pos => pos
|
|
.My(HorizontalAlignment.Center, VerticalAlignment.Center)
|
|
.At(HorizontalAlignment.Center, VerticalAlignment.Center)
|
|
.Of(new JS("window"))
|
|
)
|
|
)
|
|
|
|
.AllowUpdating(true)
|
|
.AllowDeleting(false)
|
|
|
|
.Mode(GridEditMode.Popup)
|
|
.UseIcons(true)
|
|
.Form(f => f
|
|
.ID("UserCreation")
|
|
.ColCount(2)
|
|
.Items(items =>
|
|
{
|
|
items.AddGroup()
|
|
.Caption("Company Details")
|
|
|
|
.Items(groupItems =>
|
|
{
|
|
|
|
groupItems.AddSimpleFor(m => m.CompanyEmail).ValidationRules(r => r
|
|
.AddEmail()
|
|
.Message("Use email address")
|
|
|
|
);
|
|
groupItems.AddSimpleFor(m => m.CompanyName);
|
|
groupItems.AddSimpleFor(m => m.CompanyTIN).Visible(false);
|
|
groupItems.AddSimpleFor(m => m.District).Visible(false);
|
|
groupItems.AddSimpleFor(m => m.IncorpCertDate);
|
|
groupItems.AddSimpleFor(m => m.IncorpCertNo); groupItems.AddSimpleFor(m => m.PostalAddress);
|
|
|
|
});
|
|
items.AddGroup()
|
|
.Caption("Company Location")
|
|
.Items(groupItems =>
|
|
{
|
|
groupItems.AddSimpleFor(m => m.Region);
|
|
groupItems.AddSimpleFor(m => m.CompanyMobile);
|
|
groupItems.AddSimpleFor(m => m.CompanyTIN);
|
|
groupItems.AddSimpleFor(m => m.Telephone);
|
|
groupItems.AddSimpleFor(m => m.PhysicalAddress);
|
|
|
|
|
|
|
|
});
|
|
|
|
})
|
|
|
|
)
|
|
).MasterDetail(m =>
|
|
{
|
|
m.Enabled(true);
|
|
|
|
m.Template(@<text>
|
|
@Html.Partial("_ShareByCompany")
|
|
</text>);
|
|
|
|
|
|
|
|
})
|
|
)
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div> |