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,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
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.Invoice;
using ProjecThing.Models.Transport;
using DocumentFormat.OpenXml.Wordprocessing;
using System.ComponentModel.DataAnnotations;
namespace ProjecThing.Pages.Projects
{
[Authorize(Roles = "Administrator,InvoicingUser,ProjecThingUser")]
public class PrintProjectPartPathsModel : PageModel
{
private readonly ApplicationDbContext _context;
private readonly UserManager<IdentityApplicationUser> _userManager;
public Models.Project.Project Project { get; set; }
public IList<Models.Project.ProjectPartItem> Items { get; set; }
public string ProjectNumber { get; set; }
public PrintProjectPartPathsModel(ApplicationDbContext context, UserManager<IdentityApplicationUser> userManager)
{
_context = context;
_userManager = userManager;
}
public async Task<IActionResult> OnGetAsync(int id)
{
var user = _userManager.GetUserAsync(User).Result;
var projectPart = _context
.ProjectParts.Include(x => x.Project)
.ThenInclude(x => x.Company)
.FirstOrDefault();
if (projectPart == null)
return NotFound();
Project = projectPart.Project;
ProjectNumber = projectPart.ProjectPartNumberFormatted;
Items = await _context.ProjectPartItems
.Include(x => x.ProjectPart)
.ThenInclude(x => x.Project)
.Include(x => x.Item)
.Where(x => x.IdProjectPartFk == id)
.ToListAsync();
return Page();
}
}
}