@using PowderCoating.Application.DTOs.Job @using PowderCoating.Application.DTOs.Quote @using PowderCoating.Application.DTOs.Common @{ ViewData["Title"] = $"Activity - {ViewBag.CustomerName}"; ViewData["PageIcon"] = "bi-clock-history"; var customerId = (int)ViewBag.CustomerId; var customerName = (string)ViewBag.CustomerName; var activeTab = (string)ViewBag.ActiveTab; var jobs = (PagedResult)ViewBag.Jobs; var jobSort = (string)ViewBag.JobSort; var jobDir = (string)ViewBag.JobDir; var quotes = (PagedResult)ViewBag.Quotes; var quoteSort = (string)ViewBag.QuoteSort; var quoteDir = (string)ViewBag.QuoteDir; // Helper: build a URL that changes only the job sort column/direction string JobSortUrl(string col) { var newDir = jobSort == col && jobDir == "asc" ? "desc" : "asc"; return Url.Action("Activity", new { id = customerId, activeTab = "jobs", jobSort = col, jobDir = newDir, jobPage = 1, jobSize = jobs.PageSize, quoteSort, quoteDir, quotePage = quotes.PageNumber, quoteSize = quotes.PageSize })!; } string JobSortIcon(string col) { if (jobSort != col) return "bi-arrow-down-up"; return jobDir == "asc" ? "bi-arrow-up" : "bi-arrow-down"; } // Helper: build a URL that changes only the quote sort column/direction string QuoteSortUrl(string col) { var newDir = quoteSort == col && quoteDir == "asc" ? "desc" : "asc"; return Url.Action("Activity", new { id = customerId, activeTab = "quotes", jobSort, jobDir, jobPage = jobs.PageNumber, jobSize = jobs.PageSize, quoteSort = col, quoteDir = newDir, quotePage = 1, quoteSize = quotes.PageSize })!; } string QuoteSortIcon(string col) { if (quoteSort != col) return "bi-arrow-down-up"; return quoteDir == "asc" ? "bi-arrow-up" : "bi-arrow-down"; } // Helper: build page-change URL for jobs string JobPageUrl(int page) { return Url.Action("Activity", new { id = customerId, activeTab = "jobs", jobSort, jobDir, jobPage = page, jobSize = jobs.PageSize, quoteSort, quoteDir, quotePage = quotes.PageNumber, quoteSize = quotes.PageSize })!; } // Helper: build page-change URL for quotes string QuotePageUrl(int page) { return Url.Action("Activity", new { id = customerId, activeTab = "quotes", jobSort, jobDir, jobPage = jobs.PageNumber, jobSize = jobs.PageSize, quoteSort, quoteDir, quotePage = page, quoteSize = quotes.PageSize })!; } }
@jobs.TotalCount Job@(jobs.TotalCount == 1 ? "" : "s") @quotes.TotalCount Quote@(quotes.TotalCount == 1 ? "" : "s")
@if (!jobs.Items.Any()) {
No jobs found

This customer has no jobs yet

Create First Job
} else {
@foreach (var job in jobs.Items) { }
Job Number Description Status Priority Due Date Price Created Actions
@job.JobNumber
@job.Description @job.StatusDisplayName @job.PriorityDisplayName @if (job.DueDate.HasValue) { var overdue = job.DueDate.Value < DateTime.Now && job.StatusCode != "COMPLETED" && job.StatusCode != "DELIVERED"; @job.DueDate.Value.ToString("MMM dd, yyyy") @if (overdue) { } } else { } @job.FinalPrice.ToString("C") @job.CreatedAt.ToString("MMM dd, yyyy")
@if (jobs.TotalPages > 1) { } }
@if (!quotes.Items.Any()) {
No quotes found

This customer has no quotes yet

Create First Quote
} else {
@foreach (var quote in quotes.Items) { }
Quote # Status Quote Date Expires Total Actions
@quote.QuoteNumber
@{ var isExpired = quote.IsExpired; } @if (isExpired) { Expired } else { @quote.StatusDisplayName } @quote.QuoteDate.ToString("MMM dd, yyyy") @if (quote.ExpirationDate.HasValue) { @quote.ExpirationDate.Value.ToString("MMM dd, yyyy") @if (isExpired) { } } else { } @quote.Total.ToString("C")
@if (quotes.TotalPages > 1) { } }