LegalImaging/List.cshtml π
Location:
IrbyImaging/Views/LegalImaging/List.cshtml
Purpose: A rich Razor view for the Legal Imaging Dashboard, enabling users to search, track, visualize, and map legal documents and related leases/contracts.
Table of Contents
- Overview & Purpose
- Dependencies & Technologies
- ViewModel & Data Models
- Page Layout & Razor Directives
- Key Functional Areas
- API Endpoints π‘
- Scripts & Utilities π
- UML Diagram
- Usage Examples
- Conclusion π
1. Overview & Purpose
This Razor view powers the Legal Dashboard for the IrbyImaging application. It provides:
- A fullβtext search across documents with advanced filters
- A ToβDo list for quick notes
- A live βExpiring Soonβ panel that highlights upcoming document expirations
- Key metrics (counts of contracts, leases, etc.)
- Interactive charts (Syncfusion EJ2) for geographic and stateβbyβstate analysis
- A Recent Documents table with export options
- A Bing Maps integration to visualize lease locations
β¨ Designed for legal teams to monitor and manage important agreements in one place.
2. Dependencies & Technologies
| Layer | Technology / Library |
|---|---|
| UI Framework | ASP.NET Core MVC, Razor |
| CSS / Layout | Bootstrap 4, DataTables, Syncfusion EJ2 Styles |
| JavaScript | jQuery, DataTables, Syncfusion EJ2, ApexCharts, Bing Maps API |
| Date Handling | bootstrap-datepicker, Syncfusion DateRangePicker |
| Data Serialization | Newtonsoft.Json |
| Maps & Geo | Microsoft.Bing.Maps JavaScript SDK |
3. ViewModel & Data Models
ViewModel: IrbyImaging.Models.DocumentImaging
This model carries both search filters and data collections:
public class DocumentImaging {
public int DocumentImageId { get; set; }
public string DocumentType { get; set; }
public string FilePath { get; set; }
public bool Preview { get; set; }
public List<Guid> BatchIds { get; set; }
public Guid ReferenceId { get; set; }
public string IndexTag { get; set; }
public string ContentType { get; set; }
public bool IsLegalDocument { get; set; }
public bool IsSafety { get; set; }
public bool IsIT { get; set; }
// Dropdown & Multiβselect sources
public IEnumerable<SelectListItem> DocumentCategories { get; set; }
public IEnumerable<SelectListItem> DocumentTypes { get; set; }
public IEnumerable<SelectListItem> EmployeeData { get; set; }
public IEnumerable<SelectListItem> JobData { get; set; }
// Results
public IEnumerable<ImagingDocument> ImagingList { get; set; }
public bool OcrSearch { get; set; }
}
ViewBag Properties:
ViewBag.LeaseResultsβ Data for pie chartViewBag.DirectorDetails,ViewBag.ContractTypeDetailsβ Chart dataViewBag.RecentDocumentsβ List of recent uploadsViewBag.DocCount,ViewBag.ContractCount, etc. β Metric counts
4. Page Layout & Razor Directives
@model IrbyImaging.Models.DocumentImaging
@using Syncfusion.JavaScript.Models
@using Newtonsoft.Json
@{
ViewData["Title"] = "Legal Dashboard";
Layout = "~/Views/Shared/_LegalLayout.cshtml";
// Initialize category, batch list, etc.
}
@section styles { /* CSS imports: datepicker, DataTables, Syncfusion */ }
- Model binding at the top enables stronglyβtyped access.
- Layout specified as
_LegalLayout.cshtml. - @section styles injects pageβspecific CSS.
5. Key Functional Areas
5.1 Search Section π
A <form> posts to SearchAll with these filters:
- Text Search:
<ejs-textbox id="searchString" placeholder="Search Anything" /> - Category & Type: Syncfusion MultiSelect
- Date Range:
<ejs-daterangepicker> - Lead & Job:
<ejs-dropdownlist> - OCR Search:
@Html.CheckBoxFor(m => m.OcrSearch)
<form asp-action="SearchAll" method="post" target="_blank">
@Html.HiddenFor(m => m.BatchIds, new { Value = lists })
@Html.AntiForgeryToken()
<div id="searchSection" class="row">
<!-- Card wrapper -->
<div class="card">
<h4>Search all Documents</h4>
<button type="submit" class="btn btn-primary">Search</button>
<!-- Repeatable search filters -->
<div data-repeater-list="outer-group">
<div data-repeater-item>
<!-- filters go here -->
</div>
</div>
</div>
</div>
</form>
5.2 ToβDo List π
Quick inβpage notes implemented with pure JS:
<div class="card">
<h4>To-Do List</h4>
<input id="todo" /><button id="addTodo">Add</button>
<ul class="toDoList"></ul>
<button id="RemoveCompleted">Remove Completed</button>
</div>
JS Logic (simplified):
// Add items
document.getElementById("addTodo").addEventListener("click", e => {
e.preventDefault();
const text = document.getElementById("todo").value;
const li = document.createElement("li");
li.innerText = text;
document.querySelector(".toDoList").appendChild(li);
});
// Toggle & remove
5.3 Expiring Soon β°
Scans Model.ImagingList for expiration dates in the index, parses them, and lists items expiring in β€Β 90 days:
@foreach(var img in Model.ImagingList) {
if(DateTime.TryParseExact(img.IndexList[0].IndexValue,β¦, out var dt)) {
int days = (dt - DateTime.Today).Days;
if(days is >= 0 and <= 90) {
<li>@img.FileName β expires in @days days.
@Html.ActionLink("View", "ViewDoc", new { id=img.DocumentImageId })
</li>
}
}
}
5.4 Document Stats π
A sidebar card shows counts from ViewBag:
| Metric | Value |
|---|---|
| All Documents | @ViewBag.DocCount |
| Contract Count | @ViewBag.ContractCount |
| License Count | @ViewBag.LicenseCount |
| Lease Count | @ViewBag.LeaseCount |
| Certificate of Insurance Count | @ViewBag.CoICount |
5.5 Charts π
Powered by Syncfusion EJ2 Charts:
- Lease Location Overview
- Type:
StackingBar100 - DataSource:
ViewBag.DirectorDetails
- Type:
- Contracts By State
- Type:
StackingBar100 - DataSource:
ViewBag.ContractTypeDetails
- Type:
<ejs-chart id="splineContainer" title="Lease Location Overview">
<e-chart-primaryxaxis valueType="Category" />
<e-series-collection>
<e-series dataSource="ViewBag.DirectorDetails" xName="Director" yName="Florida" type="StackingBar100" />
<!-- more series for other states -->
</e-series-collection>
<e-chart-tooltipsettings enable="true" format="${point.x}: ${point.y}" />
</ejs-chart>
5.6 Recent Documents π
A DataTable listing the last N uploads:
<table id="recentTable" class="table table-striped">
<thead>
<tr>
<th>Document Type</th><th>Name</th><th>Date Uploaded</th><th>By</th><th>View</th>
</tr>
</thead>
<tbody>
@for(int i=0; i<recentDocuments.Count; i++) {
var doc = recentDocuments[i];
<tr>
<td>@doc.DocumentType</td>
<td>@doc.FileName</td>
<td>@doc.DocumentUploadedDate</td>
<td>@doc.DocumentUploadedBy</td>
<td>@Html.ActionLink("View","ViewDoc", new { id=doc.DocumentImageId })</td>
</tr>
}
</tbody>
</table>
DataTable Initialization:
new DataTable('#recentTable', {
paging: false,
scrollY: '400px',
order: [[2,'desc']]
});
5.7 Interactive Map πΊ
A Bing Maps integration that:
- Fetches lease locations from
/Location/GetLocations - Plots pushpins on the map
- Displays an infobox on pin click with lease details
fetch('/Location/GetLocations')
.then(r=>r.json())
.then(locations=>{
locations.forEach(loc=>{
const pin = new Microsoft.Maps.Pushpin(
new Microsoft.Maps.Location(loc.Latitude, loc.Longitude)
);
Microsoft.Maps.Events.addHandler(pin,'click',()=>showInfobox(pin,loc));
map.entities.push(pin);
});
});
function showInfobox(pin, data){
infobox.setOptions({
location: pin.getLocation(),
htmlContent: `<strong>${data.Address}</strong><br/>Expires: ${data.ExpiratinDate}`,
visible: true
});
}
6. API Endpoints π‘
| Endpoint | HTTP | Purpose |
|---|---|---|
/LegalImaging/SearchAll |
POST | Search documents with filters |
/LegalImaging/ViewDoc/{id} |
GET | View a specific document in new tab |
/LegalImaging/Edit/{id} |
GET | Edit document metadata |
/Location/GetLocations |
GET | Returns JSON array of lease locations |
7. Scripts & Utilities π
- DataTables with Export Buttons (
csv,excel,print) - ToβDo List JS for adding, toggling, and removing items
- Conditional Row Styling (expired/expiresSoon/expireWarning) based on dates
- Bing Maps Loader with async script injection
- Syncfusion EJ2 initialization for charts & inputs
8. UML Diagram
βββββββββββββββββββββββββββ
β DocumentImaging (Model) β
βββββββββββββββββββββββββββ€
β + DocumentImageId : int β
β + BatchIds : List<Guid> β
β + DocumentCategories β
β + DocumentTypes β
β + EmployeeData β
β + JobData β
β + ImagingList β
β + OcrSearch : bool β
βββββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β List.cshtml (View) β
βββββββββββββββββββββββββββ€
β - Search Form β
β - To-Do List β
β - Expiring Soon Panel β
β - Document Stats Card β
β - Charts (Syncfusion) β
β - Recent Docs Table β
β - Bing Map Integration β
βββββββββββββββββββββββββββ
9. Usage Examples
-
Searching Documents
- Enter keywords in Search Anything
- Select Document Category / Type
- Choose a Date Range or Lead/Job
- Click Search β Opens results in a new tab
-
Monitoring Expirations
- View the Expiring Soon card
- Click View/Edit links for quick actions
-
Mapping Leases
- Scroll to the map
- Browse by pin location and view lease metadata
10. Conclusion π
This comprehensive Razor view centralizes all the tools a legal team needs:
- Advanced search with multiβcriteria filters
- Realβtime metrics & visualizations
- Reminders for upcoming expirations
- Geospatial intelligence via Bing Maps
All within a single, responsive dashboard!