rename to projecting

This commit is contained in:
2026-06-16 18:04:55 +02:00
parent da7b320032
commit bcde4178df
14778 changed files with 3658 additions and 3642 deletions

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
using ProjecThing.Data;
using ProjecThing.Models;
using ProjecThing.Models.Transport;
using Microsoft.AspNetCore.Authorization;
namespace ProjecThing.Pages.TransportLoadingOrder
{
[Authorize(Roles = "Administrator,TransportThingUser")]
public class IndexModel : PageModel
{
private readonly ProjecThing.Data.ApplicationDbContext _context;
private readonly UserManager<IdentityApplicationUser> _userManager;
public IndexModel(ProjecThing.Data.ApplicationDbContext context, UserManager<IdentityApplicationUser> userManager)
{
_context = context;
_userManager = userManager;
}
public IList<Models.Transport.TransportLoadingOrder> TransportLoadingOrder { get;set; }
public async Task OnGetAsync(string searchString)
{
ViewData["SearchString"] = searchString;
var user = _userManager.GetUserAsync(User).Result;
TransportLoadingOrder = await _context.TransportLoadingOrders
.Include(t => t.Partner)
.Where(x => x.IdCompanyFk == user.IdCompanyFk)
.OrderByDescending(x => x.OrderYear).ThenByDescending(x => x.OrderNumber)
.ToListAsync();
if (!string.IsNullOrEmpty(searchString))
{
TransportLoadingOrder = TransportLoadingOrder.Where(x => x.Company.Title.Contains(searchString) || x.OrderYear + "-" + x.OrderNumber == searchString).ToList();
}
}
}
}