📄 JobClassificationIndex.cshtml Documentation

Path: IrbyImaging/Views/FringeBenefits/JobClassificationIndex.cshtml


📑 Table of Contents

  1. Overview & Purpose
  2. File Structure & Layout
  3. Model & Data Models
  4. Dependencies & Technologies
  5. Key Functional Areas
  6. Third‑Party Integrations
  7. Usage Example & Controller Snippet
  8. UML Class Diagram 📊
  9. Conclusion

🔍 Overview & Purpose

This Razor View (.cshtml) renders a Job Classifications list in a responsive, interactive table. It is part of the FringeBenefits feature in the IrbyImaging MVC web application.

  • User sees: Job numbers, cost codes, classifications, fringe amounts, and geographic info.
  • Primary goal: Provide an exportable, paginated, searchable grid (via DataTables) for administrators or financial analysts to review fringe‐benefit data.

🏗 File Structure & Layout

IrbyImaging/
└─ Views/
   └─ FringeBenefits/
      └─ JobClassificationIndex.cshtml
  • Layout: Inherits from ~/Views/Shared/_TimeLayout.cshtml
  • Model: IEnumerable<IrbyImaging.DomainClasses.JobClassification>

🧩 Model & Data Models

ViewModel:

  • A collection of JobClassification domain objects.
Property Type Description
Job IrbyImaging.DomainClasses.Job Parent job object (JdeNumber, Name)
CostCodeNumber string Numeric or alphanumeric cost code
CostCodeName string Descriptive cost code name
ClassNumber string Classification code
Name string Classification name
FringeAmount decimal Monetary fringe‐benefit amount
State / City / County string Geographic segmentation

Related Domain Class (Job):

Property Type Description
JdeNumber string Job identifier in JDE ERP
Name string Job description

⚙ Dependencies & Technologies

Category Libraries / Frameworks
.NET / ASP.NET ASP.NET Core MVC, Razor Views
JavaScript jQuery (v3.5.1)
Data Grid DataTables.net (v1.10.25) + Buttons extension
CSS DataTables Bootstrap4, CDN CSS
JSON Newtonsoft.Json
(Referenced but not utilized here)Syncfusion EJ2 Syncfusion.EJ2.Grids, Syncfusion.JavaScript.Models

🚀 Key Functional Areas

5.1 Page Title & Layout

@{
    ViewData["Title"] = "Job Classification Index";
    Layout = "~/Views/Shared/_TimeLayout.cshtml";
}
<h2>
  Job Classifications
  <span class="badge irby-blue" style="color:#495057;font-size:inherit;">
    @Model.Count()
  </span>
</h2>
<hr />
  • Title appears in browser tab & header.
  • Badge displays total count dynamically: @Model.Count().

5.2 Data Rendering: HTML Table

<table id="jobClassificationDatatable" class="table ...">
  <thead>
    <tr>
      <th>Job Number</th>
      <th>Job Name</th>
      <th>Cost Code</th>
      <th>Cost Code Name</th>
      <th>Classification Number</th>
      <th>Classification Name</th>
      <th>Fringe Amount</th>
      <th>State</th>
      <th>City</th>
      <th>County</th>
    </tr>
  </thead>
  <tbody>
    @foreach (var item in Model) {
      <tr>
        <td>@item.Job.JdeNumber</td>
        <td>@item.Job.Name</td>
        <td>@item.CostCodeNumber</td>
        <td>@item.CostCodeName</td>
        <td>@item.ClassNumber</td>
        <td>@item.Name</td>
        <td style="text-align:right;">
          @item.FringeAmount.ToString("C")
        </td>
        <td>@item.State</td>
        <td>@item.City</td>
        <td>@item.County</td>
      </tr>
    }
  </tbody>
</table>
  • Loop: Iterates over each JobClassification in the model.
  • Currency Format: .ToString("C") for localized currency symbol.
  • Right‑align fringe-amount column for readability.

5.3 Styling & CSS

<link href="~/lib/datatables/css/dataTables.bootstrap4.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/buttons/1.7.1/css/buttons.dataTables.min.css" rel="stylesheet" />

<style>
  #jobClassificationDatatable thead { background: #FFFFFF; }
  #jobClassificationDatatable thead th { border-bottom:1px solid #cacdd2; }
</style>
  • Bootstrap4 + DataTables styling for responsive, striped rows.
  • Custom <style> to match Irby color palette.

5.4 JavaScript & DataTables Integration

@section Scripts {
  <!-- Core JS libraries -->
  <script src="https://code.jquery.com/jquery-3.5.1.js"></script>
  <script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
  <script src="https://cdn.datatables.net/buttons/1.7.1/js/dataTables.buttons.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
  <script src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.html5.min.js"></script>
  <script src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.print.min.js"></script>

  <!-- Initialization -->
  <script>
    $(document).ready(function () {
      $('#jobClassificationDatatable').DataTable({
        dom: 'Bfrtip',
        buttons: ['csv', 'excel', 'print']
      });
    });
  </script>
}
  • Buttons: Export as CSV, Excel or print.
  • Responsive: Handled by DataTables with dt-responsive.

🔗 Third‑Party Integrations

  • DataTables.net: Feature‑rich jQuery plugin for tables
  • JSZip & pdfmake: For client‑side Excel/PDF creation
  • Bootstrap 4: Layout & responsive styling

⚠️ Although Syncfusion namespaces are imported (@using Syncfusion.EJ2.*), no Syncfusion components are actually rendered here.


🛠 Usage Example & Controller Snippet

// Controller: FringeBenefitsController.cs
public IActionResult JobClassificationIndex()
{
    // Fetch domain data via service or repository
    IEnumerable<JobClassification> model = _fringeService.GetAllJobClassifications();
    return View(model);
}
  • Route: /FringeBenefits/JobClassificationIndex
  • View: Expects IEnumerable<JobClassification> model
<!-- Link in a navigation menu -->
<li><a asp-area="" asp-controller="FringeBenefits" asp-action="JobClassificationIndex">
    <i class="fas fa-table"></i> Job Classifications
</a></li>

📊 UML Class Diagram

@startuml
class JobClassification {
  +Job Job
  +String CostCodeNumber
  +String CostCodeName
  +String ClassNumber
  +String Name
  +Decimal FringeAmount
  +String State
  +String City
  +String County
}

class Job {
  +String JdeNumber
  +String Name
}

JobClassification --> Job : contains
@enduml

✅ Conclusion

This JobClassificationIndex.cshtml view provides a clean, exportable, and user‑friendly table for browsing and exporting fringe‑benefit data by job and classification. By leveraging DataTables and Bootstrap, it delivers a fully interactive grid with minimal custom JavaScript while remaining consistent with the overall IrbyImaging design.

Emoji legend:

  • 📄 File documentation
  • 🚀 Key areas
  • 🧩 Data modeling
  • 🔗 Integrations
  • 🛠 Usage snippets
  • 📊 Diagrams
  • ✅ Summary

Feel free to extend this view with filters, search inputs, or integrate Syncfusion grids for richer UI capabilities!