mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Move enums to Data project.
This commit is contained in:
@@ -1,14 +0,0 @@
|
|||||||
namespace Marechai.App;
|
|
||||||
|
|
||||||
public enum NewsType
|
|
||||||
{
|
|
||||||
NewComputerInDb = 1,
|
|
||||||
NewConsoleInDb = 2,
|
|
||||||
NewComputerInCollection = 3,
|
|
||||||
NewConsoleInCollection = 4,
|
|
||||||
UpdatedComputerInDb = 5,
|
|
||||||
UpdatedConsoleInDb = 6,
|
|
||||||
UpdatedComputerInCollection = 7,
|
|
||||||
UpdatedConsoleInCollection = 8,
|
|
||||||
NewMoneyDonation = 9
|
|
||||||
}
|
|
||||||
@@ -1,42 +1,45 @@
|
|||||||
<Project Sdk="Uno.Sdk">
|
<Project Sdk="Uno.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net10.0-android;net10.0-browserwasm;net10.0-desktop</TargetFrameworks>
|
<TargetFrameworks>net10.0-android;net10.0-browserwasm;net10.0-desktop</TargetFrameworks>
|
||||||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) Or $([MSBuild]::IsOSPlatform('macos'))">$(TargetFrameworks);net10.0-ios</TargetFrameworks>
|
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) Or $([MSBuild]::IsOSPlatform('macos'))">$(TargetFrameworks);net10.0-ios</TargetFrameworks>
|
||||||
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<UnoSingleProject>true</UnoSingleProject>
|
<UnoSingleProject>true</UnoSingleProject>
|
||||||
|
|
||||||
<!-- Display name -->
|
<!-- Display name -->
|
||||||
<ApplicationTitle>Marechai.App</ApplicationTitle>
|
<ApplicationTitle>Marechai.App</ApplicationTitle>
|
||||||
<!-- App Identifier -->
|
<!-- App Identifier -->
|
||||||
<ApplicationId>net.marechai.app</ApplicationId>
|
<ApplicationId>net.marechai.app</ApplicationId>
|
||||||
<!-- Versions -->
|
<!-- Versions -->
|
||||||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
||||||
<ApplicationVersion>1</ApplicationVersion>
|
<ApplicationVersion>1</ApplicationVersion>
|
||||||
<!-- Package Publisher -->
|
<!-- Package Publisher -->
|
||||||
<ApplicationPublisher>O=Marechai.App</ApplicationPublisher>
|
<ApplicationPublisher>O=Marechai.App</ApplicationPublisher>
|
||||||
<!-- Package Description -->
|
<!-- Package Description -->
|
||||||
<Description>Marechai.App powered by Uno Platform.</Description>
|
<Description>Marechai.App powered by Uno Platform.</Description>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
UnoFeatures let's you quickly add and manage implicit package references based on the features you want to use.
|
UnoFeatures let's you quickly add and manage implicit package references based on the features you want to use.
|
||||||
https://aka.platform.uno/singleproject-features
|
https://aka.platform.uno/singleproject-features
|
||||||
-->
|
-->
|
||||||
<UnoFeatures>
|
<UnoFeatures>
|
||||||
Lottie;
|
Lottie;
|
||||||
Hosting;
|
Hosting;
|
||||||
Toolkit;
|
Toolkit;
|
||||||
Logging;
|
Logging;
|
||||||
LoggingSerilog;
|
LoggingSerilog;
|
||||||
Mvvm;
|
Mvvm;
|
||||||
Configuration;
|
Configuration;
|
||||||
HttpKiota;
|
HttpKiota;
|
||||||
Serialization;
|
Serialization;
|
||||||
Localization;
|
Localization;
|
||||||
Navigation;
|
Navigation;
|
||||||
ThemeService;
|
ThemeService;
|
||||||
SkiaRenderer;
|
SkiaRenderer;
|
||||||
</UnoFeatures>
|
</UnoFeatures>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Marechai.Data\Marechai.Data.csproj"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Marechai.App.Services;
|
using Marechai.App.Services;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.App.Presentation;
|
namespace Marechai.App.Presentation;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
|
|||||||
@@ -25,43 +25,58 @@
|
|||||||
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
public class MachineDto : BaseDto<int>
|
public class MachineDto : BaseDto<int>
|
||||||
{
|
{
|
||||||
[JsonPropertyName("name")] [Required] public required string Name { get; set; }
|
[JsonPropertyName("name")]
|
||||||
|
[Required]
|
||||||
|
public required string Name { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("model")] public string? Model { get; set; }
|
[JsonPropertyName("model")]
|
||||||
|
public string? Model { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("company_id")] public int CompanyId { get; set; }
|
[JsonPropertyName("company_id")]
|
||||||
|
public int CompanyId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("company_logo")] public Guid? CompanyLogo { get; set; }
|
[JsonPropertyName("company_logo")]
|
||||||
|
public Guid? CompanyLogo { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("introduced")] public DateTime? Introduced { get; set; }
|
[JsonPropertyName("introduced")]
|
||||||
|
public DateTime? Introduced { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("family_id")] public int? FamilyId { get; set; }
|
[JsonPropertyName("family_id")]
|
||||||
|
public int? FamilyId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("family_name")] public string? FamilyName { get; set; }
|
[JsonPropertyName("family_name")]
|
||||||
|
public string? FamilyName { get; set; }
|
||||||
|
|
||||||
[JsonIgnore] public List<GpuDto>? Gpus { get; set; }
|
[JsonIgnore]
|
||||||
|
public List<GpuDto>? Gpus { get; set; }
|
||||||
|
|
||||||
[JsonIgnore] public List<MemoryDto>? Memory { get; set; }
|
[JsonIgnore]
|
||||||
|
public List<MemoryDto>? Memory { get; set; }
|
||||||
|
|
||||||
[JsonIgnore] public List<ProcessorDto>? Processors { get; set; }
|
[JsonIgnore]
|
||||||
|
public List<ProcessorDto>? Processors { get; set; }
|
||||||
|
|
||||||
[JsonIgnore] public List<SoundSynthDto>? SoundSynthesizers { get; set; }
|
[JsonIgnore]
|
||||||
|
public List<SoundSynthDto>? SoundSynthesizers { get; set; }
|
||||||
|
|
||||||
[JsonIgnore] public List<StorageDto>? Storage { get; set; }
|
[JsonIgnore]
|
||||||
|
public List<StorageDto>? Storage { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("company")] public string? Company { get; set; }
|
[JsonPropertyName("company")]
|
||||||
|
public string? Company { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("type")] public MachineType Type { get; set; }
|
[JsonPropertyName("type")]
|
||||||
|
public MachineType Type { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("family")] public string? Family { get; set; }
|
[JsonPropertyName("family")]
|
||||||
|
public string? Family { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string IntroducedView =>
|
public string IntroducedView =>
|
||||||
Introduced?.Year == 1000 ? "Prototype" : Introduced?.ToShortDateString() ?? "Unknown";
|
Introduced?.Year == 1000 ? "Prototype" : Introduced?.ToShortDateString() ?? "Unknown";
|
||||||
}
|
}
|
||||||
@@ -26,8 +26,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Aaru.CommonTypes;
|
using Aaru.CommonTypes;
|
||||||
using Marechai.Database;
|
using Marechai.Data.Models;
|
||||||
using Marechai.Database.Models;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
|
|||||||
@@ -25,45 +25,58 @@
|
|||||||
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
public class SoftwareVariantDto : BaseDto<ulong>
|
public class SoftwareVariantDto : BaseDto<ulong>
|
||||||
{
|
{
|
||||||
[JsonPropertyName("name")] [Required] public required string Name { get; set; }
|
[JsonPropertyName("name")]
|
||||||
|
[Required]
|
||||||
|
public required string Name { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("version")] public string? Version { get; set; }
|
[JsonPropertyName("version")]
|
||||||
|
public string? Version { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("introduced")] public DateTime? Introduced { get; set; }
|
[JsonPropertyName("introduced")]
|
||||||
|
public DateTime? Introduced { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("parent_id")] public ulong? ParentId { get; set; }
|
[JsonPropertyName("parent_id")]
|
||||||
|
public ulong? ParentId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("parent")] public string? Parent { get; set; }
|
[JsonPropertyName("parent")]
|
||||||
|
public string? Parent { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("version_id")]
|
[JsonPropertyName("version_id")]
|
||||||
[Required]
|
[Required]
|
||||||
public ulong SoftwareVersionId { get; set; }
|
public ulong SoftwareVersionId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("software_version")] public string? SoftwareVersion { get; set; }
|
[JsonPropertyName("software_version")]
|
||||||
|
public string? SoftwareVersion { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("minimum_memory")] public ulong? MinimumMemory { get; set; }
|
[JsonPropertyName("minimum_memory")]
|
||||||
|
public ulong? MinimumMemory { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("recommended_memory")]
|
[JsonPropertyName("recommended_memory")]
|
||||||
public ulong? RecommendedMemory { get; set; }
|
public ulong? RecommendedMemory { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("required_storage")] public ulong? RequiredStorage { get; set; }
|
[JsonPropertyName("required_storage")]
|
||||||
|
public ulong? RequiredStorage { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("part_number")] public string? PartNumber { get; set; }
|
[JsonPropertyName("part_number")]
|
||||||
|
public string? PartNumber { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("serial_number")] public string? SerialNumber { get; set; }
|
[JsonPropertyName("serial_number")]
|
||||||
|
public string? SerialNumber { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("product_code")] public string? ProductCode { get; set; }
|
[JsonPropertyName("product_code")]
|
||||||
|
public string? ProductCode { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("catalogue_number")] public string? CatalogueNumber { get; set; }
|
[JsonPropertyName("catalogue_number")]
|
||||||
|
public string? CatalogueNumber { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("distribution_mode")]
|
[JsonPropertyName("distribution_mode")]
|
||||||
public DistributionMode DistributionMode { get; set; }
|
public DistributionMode DistributionMode { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("family")] public string? Family { get; set; }
|
[JsonPropertyName("family")]
|
||||||
|
public string? Family { get; set; }
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Data.Dtos;
|
namespace Marechai.Data.Dtos;
|
||||||
|
|
||||||
|
|||||||
@@ -23,13 +23,12 @@
|
|||||||
// Copyright © 2003-2026 Natalia Portillo
|
// Copyright © 2003-2026 Natalia Portillo
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
// ReSharper disable UnusedMember.Global
|
// ReSharper disable UnusedMember.Global
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
|
|
||||||
namespace Marechai.Database;
|
namespace Marechai.Data;
|
||||||
|
|
||||||
public enum NewsType
|
public enum NewsType
|
||||||
{
|
{
|
||||||
@@ -5,9 +5,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Marechai.Database\Marechai.Database.csproj"/>
|
<PackageReference Include="Aaru.CommonTypes"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Aaru.CommonTypes.Enums;
|
using Aaru.CommonTypes.Enums;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Data.Models;
|
||||||
|
|
||||||
// Not for a table
|
// Not for a table
|
||||||
public class OpticalDiscTrack
|
public class OpticalDiscTrack
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
// Copyright © 2003-2026 Natalia Portillo
|
// Copyright © 2003-2026 Natalia Portillo
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Data.Models;
|
||||||
|
|
||||||
// Not for a table
|
// Not for a table
|
||||||
public class VariableBlockSize
|
public class VariableBlockSize
|
||||||
@@ -15,4 +15,7 @@
|
|||||||
<FrameworkReference Include="Microsoft.AspNetCore.App"/>
|
<FrameworkReference Include="Microsoft.AspNetCore.App"/>
|
||||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Json.Microsoft"/>
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Json.Microsoft"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Marechai.Data\Marechai.Data.csproj"/>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ using System.Collections.Generic;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
// Copyright © 2003-2026 Natalia Portillo
|
// Copyright © 2003-2026 Natalia Portillo
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
public abstract class DocumentScanBase : BaseScan
|
public abstract class DocumentScanBase : BaseScan
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Database.Schemas;
|
using Marechai.Database.Schemas;
|
||||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ using System.Collections.Generic;
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using Aaru.CommonTypes;
|
using Aaru.CommonTypes;
|
||||||
|
using Marechai.Data;
|
||||||
|
using Marechai.Data.Models;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Marechai.Data;
|
||||||
|
|
||||||
namespace Marechai.Database.Models;
|
namespace Marechai.Database.Models;
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Database.Schemas.Sql;
|
using Marechai.Database.Schemas.Sql;
|
||||||
|
|
||||||
namespace Marechai.Database;
|
namespace Marechai.Database;
|
||||||
@@ -422,9 +423,7 @@ public partial class Operations
|
|||||||
dataAdapter.Fill(dataSet);
|
dataAdapter.Fill(dataSet);
|
||||||
|
|
||||||
foreach(DataRow dataRow in dataSet.Tables[0].Rows)
|
foreach(DataRow dataRow in dataSet.Tables[0].Rows)
|
||||||
{
|
|
||||||
consoleIdAndCompanyId.Add(int.Parse(dataRow["id"].ToString()), int.Parse(dataRow["company"].ToString()));
|
consoleIdAndCompanyId.Add(int.Parse(dataRow["id"].ToString()), int.Parse(dataRow["company"].ToString()));
|
||||||
}
|
|
||||||
|
|
||||||
trans = connection.BeginTransaction();
|
trans = connection.BeginTransaction();
|
||||||
|
|
||||||
@@ -1200,7 +1199,7 @@ public partial class Operations
|
|||||||
dbCmd.Transaction = trans;
|
dbCmd.Transaction = trans;
|
||||||
|
|
||||||
dbCmd.CommandText = $"UPDATE `computers` SET `gpu` = {DbNone} WHERE `gpu` = 1;\n" +
|
dbCmd.CommandText = $"UPDATE `computers` SET `gpu` = {DbNone} WHERE `gpu` = 1;\n" +
|
||||||
"UPDATE `computers` SET `gpu` = NULL WHERE `gpu` = 2;\n" +
|
"UPDATE `computers` SET `gpu` = NULL WHERE `gpu` = 2;\n" +
|
||||||
$"UPDATE `computers` SET `gpu` = {DbSoftware} WHERE `gpu` = 3;";
|
$"UPDATE `computers` SET `gpu` = {DbSoftware} WHERE `gpu` = 3;";
|
||||||
|
|
||||||
dbCmd.ExecuteNonQuery();
|
dbCmd.ExecuteNonQuery();
|
||||||
@@ -1213,7 +1212,7 @@ public partial class Operations
|
|||||||
dbCmd.Transaction = trans;
|
dbCmd.Transaction = trans;
|
||||||
|
|
||||||
dbCmd.CommandText = $"UPDATE `consoles` SET `gpu` = {DbNone} WHERE `gpu` = 1;\n" +
|
dbCmd.CommandText = $"UPDATE `consoles` SET `gpu` = {DbNone} WHERE `gpu` = 1;\n" +
|
||||||
"UPDATE `consoles` SET `gpu` = NULL WHERE `gpu` = 2;\n" +
|
"UPDATE `consoles` SET `gpu` = NULL WHERE `gpu` = 2;\n" +
|
||||||
$"UPDATE `consoles` SET `gpu` = {DbSoftware} WHERE `gpu` = 3;";
|
$"UPDATE `consoles` SET `gpu` = {DbSoftware} WHERE `gpu` = 3;";
|
||||||
|
|
||||||
dbCmd.ExecuteNonQuery();
|
dbCmd.ExecuteNonQuery();
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ using System.Diagnostics;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
|
|
||||||
namespace Marechai.Helpers;
|
namespace Marechai.Helpers;
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
@page "/admin/books/details/{Id:long}"
|
@page "/admin/books/details/{Id:long}"
|
||||||
@page "/admin/books/edit/{Id:long}"
|
@page "/admin/books/edit/{Id:long}"
|
||||||
@page "/admin/books/create"
|
@page "/admin/books/create"
|
||||||
|
@using Marechai.Data
|
||||||
@using Marechai.Data.Dtos
|
@using Marechai.Data.Dtos
|
||||||
@using Marechai.Database
|
|
||||||
@using Marechai.Database.Models
|
@using Marechai.Database.Models
|
||||||
@inherits OwningComponentBase<BooksService>
|
@inherits OwningComponentBase<BooksService>
|
||||||
@inject IStringLocalizer<BooksService> L
|
@inject IStringLocalizer<BooksService> L
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ using System.Linq;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Blazorise;
|
using Blazorise;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Marechai.Helpers;
|
using Marechai.Helpers;
|
||||||
using Marechai.Shared;
|
using Marechai.Shared;
|
||||||
@@ -45,115 +45,115 @@ namespace Marechai.Pages.Admin.Details;
|
|||||||
|
|
||||||
public partial class Book
|
public partial class Book
|
||||||
{
|
{
|
||||||
const int _maxUploadSize = 25 * 1048576;
|
const int _maxUploadSize = 25 * 1048576;
|
||||||
bool _addingCompany;
|
bool _addingCompany;
|
||||||
int? _addingCompanyId;
|
int? _addingCompanyId;
|
||||||
string _addingCompanyRoleId;
|
string _addingCompanyRoleId;
|
||||||
bool _addingMachine;
|
bool _addingMachine;
|
||||||
bool _addingMachineFamily;
|
bool _addingMachineFamily;
|
||||||
int? _addingMachineFamilyId;
|
int? _addingMachineFamilyId;
|
||||||
int? _addingMachineId;
|
int? _addingMachineId;
|
||||||
bool _addingPerson;
|
bool _addingPerson;
|
||||||
int? _addingPersonId;
|
int? _addingPersonId;
|
||||||
string _addingPersonRoleId;
|
string _addingPersonRoleId;
|
||||||
bool _addingScan;
|
bool _addingScan;
|
||||||
bool? _addToDatabase;
|
bool? _addToDatabase;
|
||||||
bool _allFinished;
|
bool _allFinished;
|
||||||
AuthenticationState _authState;
|
AuthenticationState _authState;
|
||||||
List<CompanyByBookDto> _bookCompanies;
|
List<CompanyByBookDto> _bookCompanies;
|
||||||
List<BookByMachineFamilyDto> _bookMachineFamilies;
|
List<BookByMachineFamilyDto> _bookMachineFamilies;
|
||||||
List<BookByMachineDto> _bookMachines;
|
List<BookByMachineDto> _bookMachines;
|
||||||
List<PersonByBookDto> _bookPeople;
|
List<PersonByBookDto> _bookPeople;
|
||||||
List<DocumentCompanyDto> _companies;
|
List<DocumentCompanyDto> _companies;
|
||||||
bool? _convertAvif1440;
|
bool? _convertAvif1440;
|
||||||
bool? _convertAvif1440Th;
|
bool? _convertAvif1440Th;
|
||||||
bool? _convertAvif4K;
|
bool? _convertAvif4K;
|
||||||
bool? _convertAvif4kTh;
|
bool? _convertAvif4kTh;
|
||||||
bool? _convertAvifHd;
|
bool? _convertAvifHd;
|
||||||
bool? _convertAvifHdTh;
|
bool? _convertAvifHdTh;
|
||||||
bool? _convertHeif1440;
|
bool? _convertHeif1440;
|
||||||
bool? _convertHeif1440Th;
|
bool? _convertHeif1440Th;
|
||||||
bool? _convertHeif4k;
|
bool? _convertHeif4k;
|
||||||
bool? _convertHeif4kTh;
|
bool? _convertHeif4kTh;
|
||||||
bool? _convertHeifHd;
|
bool? _convertHeifHd;
|
||||||
bool? _convertHeifHdTh;
|
bool? _convertHeifHdTh;
|
||||||
bool? _convertJp2k1440;
|
bool? _convertJp2k1440;
|
||||||
bool? _convertJp2k1440Th;
|
bool? _convertJp2k1440Th;
|
||||||
bool? _convertJp2k4k;
|
bool? _convertJp2k4k;
|
||||||
bool? _convertJp2k4kTh;
|
bool? _convertJp2k4kTh;
|
||||||
bool? _convertJp2kHd;
|
bool? _convertJp2kHd;
|
||||||
bool? _convertJp2kHdTh;
|
bool? _convertJp2kHdTh;
|
||||||
bool? _convertJpeg1440;
|
bool? _convertJpeg1440;
|
||||||
bool? _convertJpeg1440Th;
|
bool? _convertJpeg1440Th;
|
||||||
bool? _convertJpeg4k;
|
bool? _convertJpeg4k;
|
||||||
bool? _convertJpeg4kTh;
|
bool? _convertJpeg4kTh;
|
||||||
bool? _convertJpegHd;
|
bool? _convertJpegHd;
|
||||||
bool? _convertJpegHdTh;
|
bool? _convertJpegHdTh;
|
||||||
bool? _convertWebp1440;
|
bool? _convertWebp1440;
|
||||||
bool? _convertWebp1440Th;
|
bool? _convertWebp1440Th;
|
||||||
bool? _convertWebp4k;
|
bool? _convertWebp4k;
|
||||||
bool? _convertWebp4kTh;
|
bool? _convertWebp4kTh;
|
||||||
bool? _convertWebpHd;
|
bool? _convertWebpHd;
|
||||||
bool? _convertWebpHdTh;
|
bool? _convertWebpHdTh;
|
||||||
List<Iso31661Numeric> _countries;
|
List<Iso31661Numeric> _countries;
|
||||||
bool _creating;
|
bool _creating;
|
||||||
BookByMachineDto _currentBookByMachine;
|
BookByMachineDto _currentBookByMachine;
|
||||||
BookByMachineFamilyDto _currentBookByMachineFamily;
|
BookByMachineFamilyDto _currentBookByMachineFamily;
|
||||||
CompanyByBookDto _currentCompanyByBook;
|
CompanyByBookDto _currentCompanyByBook;
|
||||||
PersonByBookDto _currentPersonByBook;
|
PersonByBookDto _currentPersonByBook;
|
||||||
bool _deleteInProgress;
|
bool _deleteInProgress;
|
||||||
string _deleteText;
|
string _deleteText;
|
||||||
string _deleteTitle;
|
string _deleteTitle;
|
||||||
bool _deletingBookByMachine;
|
bool _deletingBookByMachine;
|
||||||
bool _deletingBookByMachineFamily;
|
bool _deletingBookByMachineFamily;
|
||||||
bool _deletingCompanyByBook;
|
bool _deletingCompanyByBook;
|
||||||
bool _deletingPersonByBook;
|
bool _deletingPersonByBook;
|
||||||
bool _deletingScan;
|
bool _deletingScan;
|
||||||
bool _editing;
|
bool _editing;
|
||||||
bool _editingScan;
|
bool _editingScan;
|
||||||
bool? _extractExif;
|
bool? _extractExif;
|
||||||
Modal _frmDelete;
|
Modal _frmDelete;
|
||||||
string _imageFormat;
|
string _imageFormat;
|
||||||
ElementReference _inputUpload;
|
ElementReference _inputUpload;
|
||||||
bool _loaded;
|
bool _loaded;
|
||||||
List<MachineFamilyDto> _machineFamilies;
|
List<MachineFamilyDto> _machineFamilies;
|
||||||
List<MachineDto> _machines;
|
List<MachineDto> _machines;
|
||||||
BookDto _model;
|
BookDto _model;
|
||||||
bool? _moveFile;
|
bool? _moveFile;
|
||||||
List<DocumentPersonDto> _people;
|
List<DocumentPersonDto> _people;
|
||||||
double _progressValue;
|
double _progressValue;
|
||||||
List<DocumentRoleDto> _roles;
|
List<DocumentRoleDto> _roles;
|
||||||
bool _savingCompany;
|
bool _savingCompany;
|
||||||
bool _savingMachine;
|
bool _savingMachine;
|
||||||
bool _savingMachineFamily;
|
bool _savingMachineFamily;
|
||||||
bool _savingPerson;
|
bool _savingPerson;
|
||||||
List<Guid> _scans;
|
List<Guid> _scans;
|
||||||
ApplicationUser _scanUser;
|
ApplicationUser _scanUser;
|
||||||
BookScanDto _selectedScan;
|
BookScanDto _selectedScan;
|
||||||
bool _unknownCountry;
|
bool _unknownCountry;
|
||||||
bool _unknownEdition;
|
bool _unknownEdition;
|
||||||
bool _unknownIsbn;
|
bool _unknownIsbn;
|
||||||
bool _unknownNativeTitle;
|
bool _unknownNativeTitle;
|
||||||
bool _unknownPages;
|
bool _unknownPages;
|
||||||
bool _unknownPublished;
|
bool _unknownPublished;
|
||||||
bool _unknownScanAuthor;
|
bool _unknownScanAuthor;
|
||||||
bool _unknownScanColorSpace;
|
bool _unknownScanColorSpace;
|
||||||
bool _unknownScanComments;
|
bool _unknownScanComments;
|
||||||
bool _unknownScanCreationDate;
|
bool _unknownScanCreationDate;
|
||||||
bool _unknownScanExifVersion;
|
bool _unknownScanExifVersion;
|
||||||
bool _unknownScanHorizontalResolution;
|
bool _unknownScanHorizontalResolution;
|
||||||
bool _unknownScanPage;
|
bool _unknownScanPage;
|
||||||
bool _unknownScanResolutionUnit;
|
bool _unknownScanResolutionUnit;
|
||||||
bool _unknownScanScannerManufacturer;
|
bool _unknownScanScannerManufacturer;
|
||||||
bool _unknownScanScannerModel;
|
bool _unknownScanScannerModel;
|
||||||
bool _unknownScanSoftwareUsed;
|
bool _unknownScanSoftwareUsed;
|
||||||
bool _unknownScanVerticalResolution;
|
bool _unknownScanVerticalResolution;
|
||||||
bool _uploaded;
|
bool _uploaded;
|
||||||
bool _uploadError;
|
bool _uploadError;
|
||||||
string _uploadErrorMessage;
|
string _uploadErrorMessage;
|
||||||
bool _uploading;
|
bool _uploading;
|
||||||
uint? _uploadScanPage;
|
uint? _uploadScanPage;
|
||||||
uint _uploadScanType;
|
uint _uploadScanType;
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
@page "/admin/companies/details/{Id:int}"
|
@page "/admin/companies/details/{Id:int}"
|
||||||
@page "/admin/companies/edit/{Id:int}"
|
@page "/admin/companies/edit/{Id:int}"
|
||||||
@page "/admin/companies/create"
|
@page "/admin/companies/create"
|
||||||
|
@using Marechai.Data
|
||||||
@using Marechai.Data.Dtos
|
@using Marechai.Data.Dtos
|
||||||
@using Marechai.Database
|
|
||||||
@using Marechai.Database.Models
|
@using Marechai.Database.Models
|
||||||
@inherits OwningComponentBase<CompaniesService>
|
@inherits OwningComponentBase<CompaniesService>
|
||||||
@inject IStringLocalizer<CompaniesService> L
|
@inject IStringLocalizer<CompaniesService> L
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Blazorise;
|
using Blazorise;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Marechai.Helpers;
|
using Marechai.Helpers;
|
||||||
using Marechai.Shared;
|
using Marechai.Shared;
|
||||||
@@ -47,51 +47,51 @@ namespace Marechai.Pages.Admin.Details;
|
|||||||
|
|
||||||
public partial class Company
|
public partial class Company
|
||||||
{
|
{
|
||||||
const int _maxUploadSize = 5 * 1048576;
|
const int _maxUploadSize = 5 * 1048576;
|
||||||
bool _addingDescription;
|
bool _addingDescription;
|
||||||
AuthenticationState _authState;
|
AuthenticationState _authState;
|
||||||
List<CompanyDto> _companies;
|
List<CompanyDto> _companies;
|
||||||
List<Iso31661Numeric> _countries;
|
List<Iso31661Numeric> _countries;
|
||||||
bool _creating;
|
bool _creating;
|
||||||
CompanyLogo _currentLogo;
|
CompanyLogo _currentLogo;
|
||||||
int? _currentLogoYear;
|
int? _currentLogoYear;
|
||||||
bool _deleteInProgress;
|
bool _deleteInProgress;
|
||||||
CompanyDescriptionDto _description;
|
CompanyDescriptionDto _description;
|
||||||
bool _editing;
|
bool _editing;
|
||||||
Modal _frmDelete;
|
Modal _frmDelete;
|
||||||
Modal _frmLogoYear;
|
Modal _frmLogoYear;
|
||||||
Modal _frmUpload;
|
Modal _frmUpload;
|
||||||
ElementReference _inputUpload;
|
ElementReference _inputUpload;
|
||||||
bool _loaded;
|
bool _loaded;
|
||||||
List<CompanyLogo> _logos;
|
List<CompanyLogo> _logos;
|
||||||
CompanyDto _model;
|
CompanyDto _model;
|
||||||
MarkdownPipeline _pipeline;
|
MarkdownPipeline _pipeline;
|
||||||
double _progressValue;
|
double _progressValue;
|
||||||
bool _readonlyDescription;
|
bool _readonlyDescription;
|
||||||
bool _savingLogo;
|
bool _savingLogo;
|
||||||
string _selectedDescriptionTab;
|
string _selectedDescriptionTab;
|
||||||
bool _unknownAddress;
|
bool _unknownAddress;
|
||||||
bool _unknownCity;
|
bool _unknownCity;
|
||||||
bool _unknownCountry;
|
bool _unknownCountry;
|
||||||
bool _unknownFacebook;
|
bool _unknownFacebook;
|
||||||
bool _unknownFounded;
|
bool _unknownFounded;
|
||||||
bool _unknownLegalName;
|
bool _unknownLegalName;
|
||||||
bool _unknownLogoYear;
|
bool _unknownLogoYear;
|
||||||
bool _unknownPostalCode;
|
bool _unknownPostalCode;
|
||||||
bool _unknownProvince;
|
bool _unknownProvince;
|
||||||
bool _unknownSold;
|
bool _unknownSold;
|
||||||
bool _unknownSoldTo;
|
bool _unknownSoldTo;
|
||||||
bool _unknownTwitter;
|
bool _unknownTwitter;
|
||||||
bool _unknownWebsite;
|
bool _unknownWebsite;
|
||||||
bool _uploaded;
|
bool _uploaded;
|
||||||
string _uploadedPngData;
|
string _uploadedPngData;
|
||||||
string _uploadedSvgData;
|
string _uploadedSvgData;
|
||||||
string _uploadedWebpData;
|
string _uploadedWebpData;
|
||||||
bool _uploadError;
|
bool _uploadError;
|
||||||
string _uploadErrorMessage;
|
string _uploadErrorMessage;
|
||||||
bool _uploading;
|
bool _uploading;
|
||||||
MemoryStream _uploadMs;
|
MemoryStream _uploadMs;
|
||||||
bool _yearChangeInProgress;
|
bool _yearChangeInProgress;
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
@page "/admin/documents/details/{Id:long}"
|
@page "/admin/documents/details/{Id:long}"
|
||||||
@page "/admin/documents/edit/{Id:long}"
|
@page "/admin/documents/edit/{Id:long}"
|
||||||
@page "/admin/documents/create"
|
@page "/admin/documents/create"
|
||||||
|
@using Marechai.Data
|
||||||
@using Marechai.Data.Dtos
|
@using Marechai.Data.Dtos
|
||||||
@using Marechai.Database
|
|
||||||
@using Marechai.Database.Models
|
@using Marechai.Database.Models
|
||||||
@inherits OwningComponentBase<DocumentsService>
|
@inherits OwningComponentBase<DocumentsService>
|
||||||
@inject IStringLocalizer<DocumentsService> L
|
@inject IStringLocalizer<DocumentsService> L
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ using System.Linq;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Blazorise;
|
using Blazorise;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Marechai.Helpers;
|
using Marechai.Helpers;
|
||||||
using Marechai.Shared;
|
using Marechai.Shared;
|
||||||
@@ -45,112 +45,112 @@ namespace Marechai.Pages.Admin.Details;
|
|||||||
|
|
||||||
public partial class Document
|
public partial class Document
|
||||||
{
|
{
|
||||||
const int MAX_UPLOAD_SIZE = 25 * 1048576;
|
const int MAX_UPLOAD_SIZE = 25 * 1048576;
|
||||||
bool _addingCompany;
|
bool _addingCompany;
|
||||||
int? _addingCompanyId;
|
int? _addingCompanyId;
|
||||||
string _addingCompanyRoleId;
|
string _addingCompanyRoleId;
|
||||||
bool _addingMachine;
|
bool _addingMachine;
|
||||||
bool _addingMachineFamily;
|
bool _addingMachineFamily;
|
||||||
int? _addingMachineFamilyId;
|
int? _addingMachineFamilyId;
|
||||||
int? _addingMachineId;
|
int? _addingMachineId;
|
||||||
bool _addingPerson;
|
bool _addingPerson;
|
||||||
int? _addingPersonId;
|
int? _addingPersonId;
|
||||||
string _addingPersonRoleId;
|
string _addingPersonRoleId;
|
||||||
bool _addingScan;
|
bool _addingScan;
|
||||||
bool? _addToDatabase;
|
bool? _addToDatabase;
|
||||||
bool _allFinished;
|
bool _allFinished;
|
||||||
AuthenticationState _authState;
|
AuthenticationState _authState;
|
||||||
List<DocumentCompanyDto> _companies;
|
List<DocumentCompanyDto> _companies;
|
||||||
bool? _convertAvif1440;
|
bool? _convertAvif1440;
|
||||||
bool? _convertAvif1440Th;
|
bool? _convertAvif1440Th;
|
||||||
bool? _convertAvif4k;
|
bool? _convertAvif4k;
|
||||||
bool? _convertAvif4kTh;
|
bool? _convertAvif4kTh;
|
||||||
bool? _convertAvifHd;
|
bool? _convertAvifHd;
|
||||||
bool? _convertAvifHdTh;
|
bool? _convertAvifHdTh;
|
||||||
bool? _convertHeif1440;
|
bool? _convertHeif1440;
|
||||||
bool? _convertHeif1440Th;
|
bool? _convertHeif1440Th;
|
||||||
bool? _convertHeif4K;
|
bool? _convertHeif4K;
|
||||||
bool? _convertHeif4kTh;
|
bool? _convertHeif4kTh;
|
||||||
bool? _convertHeifHd;
|
bool? _convertHeifHd;
|
||||||
bool? _convertHeifHdTh;
|
bool? _convertHeifHdTh;
|
||||||
bool? _convertJp2k1440;
|
bool? _convertJp2k1440;
|
||||||
bool? _convertJp2k1440Th;
|
bool? _convertJp2k1440Th;
|
||||||
bool? _convertJp2k4k;
|
bool? _convertJp2k4k;
|
||||||
bool? _convertJp2k4kTh;
|
bool? _convertJp2k4kTh;
|
||||||
bool? _convertJp2kHd;
|
bool? _convertJp2kHd;
|
||||||
bool? _convertJp2kHdTh;
|
bool? _convertJp2kHdTh;
|
||||||
bool? _convertJpeg1440;
|
bool? _convertJpeg1440;
|
||||||
bool? _convertJpeg1440Th;
|
bool? _convertJpeg1440Th;
|
||||||
bool? _convertJpeg4k;
|
bool? _convertJpeg4k;
|
||||||
bool? _convertJpeg4kTh;
|
bool? _convertJpeg4kTh;
|
||||||
bool? _convertJpegHd;
|
bool? _convertJpegHd;
|
||||||
bool? _convertJpegHdTh;
|
bool? _convertJpegHdTh;
|
||||||
bool? _convertWebp1440;
|
bool? _convertWebp1440;
|
||||||
bool? _convertWebp1440Th;
|
bool? _convertWebp1440Th;
|
||||||
bool? _convertWebp4K;
|
bool? _convertWebp4K;
|
||||||
bool? _convertWebp4kTh;
|
bool? _convertWebp4kTh;
|
||||||
bool? _convertWebpHd;
|
bool? _convertWebpHd;
|
||||||
bool? _convertWebpHdTh;
|
bool? _convertWebpHdTh;
|
||||||
List<Iso31661Numeric> _countries;
|
List<Iso31661Numeric> _countries;
|
||||||
bool _creating;
|
bool _creating;
|
||||||
CompanyByDocumentDto _currentCompanyByDocument;
|
CompanyByDocumentDto _currentCompanyByDocument;
|
||||||
DocumentByMachineDto _currentDocumentByMachine;
|
DocumentByMachineDto _currentDocumentByMachine;
|
||||||
DocumentByMachineFamilyDto _currentDocumentByMachineFamily;
|
DocumentByMachineFamilyDto _currentDocumentByMachineFamily;
|
||||||
PersonByDocumentDto _currentPersonByDocument;
|
PersonByDocumentDto _currentPersonByDocument;
|
||||||
bool _deleteInProgress;
|
bool _deleteInProgress;
|
||||||
string _deleteText;
|
string _deleteText;
|
||||||
string _deleteTitle;
|
string _deleteTitle;
|
||||||
bool _deletingCompanyByDocument;
|
bool _deletingCompanyByDocument;
|
||||||
bool _deletingDocumentByMachine;
|
bool _deletingDocumentByMachine;
|
||||||
bool _deletingDocumentByMachineFamily;
|
bool _deletingDocumentByMachineFamily;
|
||||||
bool _deletingPersonByDocument;
|
bool _deletingPersonByDocument;
|
||||||
bool _deletingScan;
|
bool _deletingScan;
|
||||||
List<CompanyByDocumentDto> _documentCompanies;
|
List<CompanyByDocumentDto> _documentCompanies;
|
||||||
List<DocumentByMachineFamilyDto> _documentMachineFamilies;
|
List<DocumentByMachineFamilyDto> _documentMachineFamilies;
|
||||||
List<DocumentByMachineDto> _documentMachines;
|
List<DocumentByMachineDto> _documentMachines;
|
||||||
List<PersonByDocumentDto> _documentPeople;
|
List<PersonByDocumentDto> _documentPeople;
|
||||||
bool _editing;
|
bool _editing;
|
||||||
bool _editingScan;
|
bool _editingScan;
|
||||||
bool? _extractExif;
|
bool? _extractExif;
|
||||||
Modal _frmDelete;
|
Modal _frmDelete;
|
||||||
string _imageFormat;
|
string _imageFormat;
|
||||||
ElementReference _inputUpload;
|
ElementReference _inputUpload;
|
||||||
bool _loaded;
|
bool _loaded;
|
||||||
List<MachineFamilyDto> _machineFamilies;
|
List<MachineFamilyDto> _machineFamilies;
|
||||||
List<MachineDto> _machines;
|
List<MachineDto> _machines;
|
||||||
DocumentDto _model;
|
DocumentDto _model;
|
||||||
bool? _moveFile;
|
bool? _moveFile;
|
||||||
List<DocumentPersonDto> _people;
|
List<DocumentPersonDto> _people;
|
||||||
double _progressValue;
|
double _progressValue;
|
||||||
List<DocumentRoleDto> _roles;
|
List<DocumentRoleDto> _roles;
|
||||||
bool _savingCompany;
|
bool _savingCompany;
|
||||||
bool _savingMachine;
|
bool _savingMachine;
|
||||||
bool _savingMachineFamily;
|
bool _savingMachineFamily;
|
||||||
bool _savingPerson;
|
bool _savingPerson;
|
||||||
List<Guid> _scans;
|
List<Guid> _scans;
|
||||||
ApplicationUser _scanUser;
|
ApplicationUser _scanUser;
|
||||||
DocumentScanDto _selectedScan;
|
DocumentScanDto _selectedScan;
|
||||||
bool _unknownCountry;
|
bool _unknownCountry;
|
||||||
bool _unknownNativeTitle;
|
bool _unknownNativeTitle;
|
||||||
bool _unknownPublished;
|
bool _unknownPublished;
|
||||||
bool _unknownScanAuthor;
|
bool _unknownScanAuthor;
|
||||||
bool _unknownScanColorSpace;
|
bool _unknownScanColorSpace;
|
||||||
bool _unknownScanComments;
|
bool _unknownScanComments;
|
||||||
bool _unknownScanCreationDate;
|
bool _unknownScanCreationDate;
|
||||||
bool _unknownScanExifVersion;
|
bool _unknownScanExifVersion;
|
||||||
bool _unknownScanHorizontalResolution;
|
bool _unknownScanHorizontalResolution;
|
||||||
bool _unknownScanPage;
|
bool _unknownScanPage;
|
||||||
bool _unknownScanResolutionUnit;
|
bool _unknownScanResolutionUnit;
|
||||||
bool _unknownScanScannerManufacturer;
|
bool _unknownScanScannerManufacturer;
|
||||||
bool _unknownScanScannerModel;
|
bool _unknownScanScannerModel;
|
||||||
bool _unknownScanSoftwareUsed;
|
bool _unknownScanSoftwareUsed;
|
||||||
bool _unknownScanVerticalResolution;
|
bool _unknownScanVerticalResolution;
|
||||||
bool _uploaded;
|
bool _uploaded;
|
||||||
bool _uploadError;
|
bool _uploadError;
|
||||||
string _uploadErrorMessage;
|
string _uploadErrorMessage;
|
||||||
bool _uploading;
|
bool _uploading;
|
||||||
uint? _uploadScanPage;
|
uint? _uploadScanPage;
|
||||||
uint _uploadScanType;
|
uint _uploadScanType;
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
@page "/admin/machines/details/{Id:int}"
|
@page "/admin/machines/details/{Id:int}"
|
||||||
@page "/admin/machines/edit/{Id:int}"
|
@page "/admin/machines/edit/{Id:int}"
|
||||||
@page "/admin/machines/create"
|
@page "/admin/machines/create"
|
||||||
|
@using Marechai.Data
|
||||||
@using Marechai.Data.Dtos
|
@using Marechai.Data.Dtos
|
||||||
@using Marechai.Database
|
|
||||||
@using Marechai.Database.Models
|
@using Marechai.Database.Models
|
||||||
@inherits OwningComponentBase<MachinesService>
|
@inherits OwningComponentBase<MachinesService>
|
||||||
@inject IStringLocalizer<MachinesService> L
|
@inject IStringLocalizer<MachinesService> L
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Blazorise;
|
using Blazorise;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Shared;
|
using Marechai.Shared;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
@@ -38,48 +38,48 @@ namespace Marechai.Pages.Admin.Details;
|
|||||||
|
|
||||||
public partial class Machine
|
public partial class Machine
|
||||||
{
|
{
|
||||||
bool _addingCpu;
|
bool _addingCpu;
|
||||||
int? _addingCpuId;
|
int? _addingCpuId;
|
||||||
bool _addingGpu;
|
bool _addingGpu;
|
||||||
int? _addingGpuId;
|
int? _addingGpuId;
|
||||||
bool _addingMemory;
|
bool _addingMemory;
|
||||||
long? _addingMemorySize;
|
long? _addingMemorySize;
|
||||||
double? _addingMemorySpeed;
|
double? _addingMemorySpeed;
|
||||||
int _addingMemoryType;
|
int _addingMemoryType;
|
||||||
int _addingMemoryUsage;
|
int _addingMemoryUsage;
|
||||||
float? _addingProcessorSpeed;
|
float? _addingProcessorSpeed;
|
||||||
bool _addingScreen;
|
bool _addingScreen;
|
||||||
int? _addingScreenId;
|
int? _addingScreenId;
|
||||||
bool _addingSound;
|
bool _addingSound;
|
||||||
int? _addingSoundId;
|
int? _addingSoundId;
|
||||||
bool _addingStorage;
|
bool _addingStorage;
|
||||||
int _addingStorageInterface;
|
int _addingStorageInterface;
|
||||||
long? _addingStorageSize;
|
long? _addingStorageSize;
|
||||||
int _addingStorageType;
|
int _addingStorageType;
|
||||||
AuthenticationState _authState;
|
AuthenticationState _authState;
|
||||||
List<CompanyDto> _companies;
|
List<CompanyDto> _companies;
|
||||||
List<ProcessorDto> _cpus;
|
List<ProcessorDto> _cpus;
|
||||||
bool _creating;
|
bool _creating;
|
||||||
ProcessorByMachineDto _currentCpuByMachine;
|
ProcessorByMachineDto _currentCpuByMachine;
|
||||||
GpuByMachineDto _currentGpuByMachine;
|
GpuByMachineDto _currentGpuByMachine;
|
||||||
MemoryByMachineDto _currentMemoryByMachine;
|
MemoryByMachineDto _currentMemoryByMachine;
|
||||||
ScreenByMachineDto _currentScreenByMachine;
|
ScreenByMachineDto _currentScreenByMachine;
|
||||||
SoundSynthByMachineDto _currentSoundByMachine;
|
SoundSynthByMachineDto _currentSoundByMachine;
|
||||||
StorageByMachineDto _currentStorageByMachine;
|
StorageByMachineDto _currentStorageByMachine;
|
||||||
bool _deleteInProgress;
|
bool _deleteInProgress;
|
||||||
string _deleteText;
|
string _deleteText;
|
||||||
string _deleteTitle;
|
string _deleteTitle;
|
||||||
bool _deletingCpuByMachine;
|
bool _deletingCpuByMachine;
|
||||||
bool _deletingGpuByMachine;
|
bool _deletingGpuByMachine;
|
||||||
bool _deletingMemoryByMachine;
|
bool _deletingMemoryByMachine;
|
||||||
bool _deletingScreenByMachine;
|
bool _deletingScreenByMachine;
|
||||||
bool _deletingSoundByMachine;
|
bool _deletingSoundByMachine;
|
||||||
bool _deletingStorageByMachine;
|
bool _deletingStorageByMachine;
|
||||||
bool _editing;
|
bool _editing;
|
||||||
List<MachineFamilyDto> _families;
|
List<MachineFamilyDto> _families;
|
||||||
Modal _frmDelete;
|
Modal _frmDelete;
|
||||||
List<GpuDto> _gpus;
|
List<GpuDto> _gpus;
|
||||||
bool _loaded;
|
bool _loaded;
|
||||||
List<ProcessorByMachineDto> _machineCpus;
|
List<ProcessorByMachineDto> _machineCpus;
|
||||||
List<GpuByMachineDto> _machineGpus;
|
List<GpuByMachineDto> _machineGpus;
|
||||||
List<MemoryByMachineDto> _machineMemories;
|
List<MemoryByMachineDto> _machineMemories;
|
||||||
@@ -87,23 +87,23 @@ public partial class Machine
|
|||||||
List<SoundSynthByMachineDto> _machineSound;
|
List<SoundSynthByMachineDto> _machineSound;
|
||||||
List<StorageByMachineDto> _machineStorage;
|
List<StorageByMachineDto> _machineStorage;
|
||||||
MachineDto _model;
|
MachineDto _model;
|
||||||
bool _noFamily;
|
bool _noFamily;
|
||||||
List<Guid> _photos;
|
List<Guid> _photos;
|
||||||
bool _prototype;
|
bool _prototype;
|
||||||
bool _savingCpu;
|
bool _savingCpu;
|
||||||
bool _savingGpu;
|
bool _savingGpu;
|
||||||
bool _savingMemory;
|
bool _savingMemory;
|
||||||
bool _savingScreen;
|
bool _savingScreen;
|
||||||
bool _savingSound;
|
bool _savingSound;
|
||||||
bool _savingStorage;
|
bool _savingStorage;
|
||||||
List<ScreenDto> _screens;
|
List<ScreenDto> _screens;
|
||||||
List<SoundSynthDto> _soundSynths;
|
List<SoundSynthDto> _soundSynths;
|
||||||
bool _unknownIntroduced;
|
bool _unknownIntroduced;
|
||||||
bool _unknownMemorySize;
|
bool _unknownMemorySize;
|
||||||
bool _unknownMemorySpeed;
|
bool _unknownMemorySpeed;
|
||||||
bool _unknownModel;
|
bool _unknownModel;
|
||||||
bool _unknownProcessorSpeed;
|
bool _unknownProcessorSpeed;
|
||||||
bool _unknownStorageSize;
|
bool _unknownStorageSize;
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,9 @@
|
|||||||
|
|
||||||
@page "/admin/machines/photo/details/{Id:guid}"
|
@page "/admin/machines/photo/details/{Id:guid}"
|
||||||
@page "/admin/machines/photo/edit/{Id:guid}"
|
@page "/admin/machines/photo/edit/{Id:guid}"
|
||||||
@using Marechai.Database
|
@using Marechai.Data
|
||||||
@using Marechai.Database.Models
|
@using Marechai.Database.Models
|
||||||
@using Orientation = Marechai.Database.Orientation
|
@using Orientation = Marechai.Data.Orientation
|
||||||
@inherits OwningComponentBase<MachinePhotosService>
|
@inherits OwningComponentBase<MachinePhotosService>
|
||||||
@inject IStringLocalizer<MachinePhotosService> L
|
@inject IStringLocalizer<MachinePhotosService> L
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Blazorise;
|
using Blazorise;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Marechai.Shared;
|
using Marechai.Shared;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
using Orientation = Marechai.Database.Orientation;
|
using Orientation = Marechai.Data.Orientation;
|
||||||
|
|
||||||
namespace Marechai.Pages.Admin.Details;
|
namespace Marechai.Pages.Admin.Details;
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ public partial class MachinePhoto
|
|||||||
bool _editing;
|
bool _editing;
|
||||||
List<Database.Models.License> _licenses;
|
List<Database.Models.License> _licenses;
|
||||||
bool _loaded;
|
bool _loaded;
|
||||||
MachinePhotoDto _model;
|
MachinePhotoDto _model;
|
||||||
bool _unknownAperture;
|
bool _unknownAperture;
|
||||||
bool _unknownAuthor;
|
bool _unknownAuthor;
|
||||||
bool _unknownCameraManufacturer;
|
bool _unknownCameraManufacturer;
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
@page "/admin/magazine_issues/details/{Id:long}"
|
@page "/admin/magazine_issues/details/{Id:long}"
|
||||||
@page "/admin/magazine_issues/edit/{Id:long}"
|
@page "/admin/magazine_issues/edit/{Id:long}"
|
||||||
@page "/admin/magazine_issues/create"
|
@page "/admin/magazine_issues/create"
|
||||||
|
@using Marechai.Data
|
||||||
@using Marechai.Data.Dtos
|
@using Marechai.Data.Dtos
|
||||||
@using Marechai.Database
|
|
||||||
@using Marechai.Database.Models
|
@using Marechai.Database.Models
|
||||||
@inherits OwningComponentBase<MagazineIssuesService>
|
@inherits OwningComponentBase<MagazineIssuesService>
|
||||||
@inject IStringLocalizer<MagazineIssuesService> L
|
@inject IStringLocalizer<MagazineIssuesService> L
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ using System.Linq;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Blazorise;
|
using Blazorise;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Marechai.Helpers;
|
using Marechai.Helpers;
|
||||||
using Marechai.Shared;
|
using Marechai.Shared;
|
||||||
@@ -45,66 +45,66 @@ namespace Marechai.Pages.Admin.Details;
|
|||||||
|
|
||||||
public partial class MagazineIssue
|
public partial class MagazineIssue
|
||||||
{
|
{
|
||||||
const int MAX_UPLOAD_SIZE = 25 * 1048576;
|
const int MAX_UPLOAD_SIZE = 25 * 1048576;
|
||||||
bool _addingMachine;
|
bool _addingMachine;
|
||||||
bool _addingMachineFamily;
|
bool _addingMachineFamily;
|
||||||
int? _addingMachineFamilyId;
|
int? _addingMachineFamilyId;
|
||||||
int? _addingMachineId;
|
int? _addingMachineId;
|
||||||
bool _addingPerson;
|
bool _addingPerson;
|
||||||
int? _addingPersonId;
|
int? _addingPersonId;
|
||||||
string _addingPersonRoleId;
|
string _addingPersonRoleId;
|
||||||
bool _addingScan;
|
bool _addingScan;
|
||||||
bool? _addToDatabase;
|
bool? _addToDatabase;
|
||||||
bool _allFinished;
|
bool _allFinished;
|
||||||
AuthenticationState _authState;
|
AuthenticationState _authState;
|
||||||
bool? _convertAvif1440;
|
bool? _convertAvif1440;
|
||||||
bool? _convertAvif1440Th;
|
bool? _convertAvif1440Th;
|
||||||
bool? _convertAvif4K;
|
bool? _convertAvif4K;
|
||||||
bool? _convertAvif4kTh;
|
bool? _convertAvif4kTh;
|
||||||
bool? _convertAvifHd;
|
bool? _convertAvifHd;
|
||||||
bool? _convertAvifHdTh;
|
bool? _convertAvifHdTh;
|
||||||
bool? _convertHeif1440;
|
bool? _convertHeif1440;
|
||||||
bool? _convertHeif1440Th;
|
bool? _convertHeif1440Th;
|
||||||
bool? _convertHeif4K;
|
bool? _convertHeif4K;
|
||||||
bool? _convertHeif4kTh;
|
bool? _convertHeif4kTh;
|
||||||
bool? _convertHeifHd;
|
bool? _convertHeifHd;
|
||||||
bool? _convertHeifHdTh;
|
bool? _convertHeifHdTh;
|
||||||
bool? _convertJp2k1440;
|
bool? _convertJp2k1440;
|
||||||
bool? _convertJp2k1440Th;
|
bool? _convertJp2k1440Th;
|
||||||
bool? _convertJp2k4k;
|
bool? _convertJp2k4k;
|
||||||
bool? _convertJp2k4kTh;
|
bool? _convertJp2k4kTh;
|
||||||
bool? _convertJp2kHd;
|
bool? _convertJp2kHd;
|
||||||
bool? _convertJp2kHdTh;
|
bool? _convertJp2kHdTh;
|
||||||
bool? _convertJpeg1440;
|
bool? _convertJpeg1440;
|
||||||
bool? _convertJpeg1440Th;
|
bool? _convertJpeg1440Th;
|
||||||
bool? _convertJpeg4k;
|
bool? _convertJpeg4k;
|
||||||
bool? _convertJpeg4kTh;
|
bool? _convertJpeg4kTh;
|
||||||
bool? _convertJpegHd;
|
bool? _convertJpegHd;
|
||||||
bool? _convertJpegHdTh;
|
bool? _convertJpegHdTh;
|
||||||
bool? _convertWebp1440;
|
bool? _convertWebp1440;
|
||||||
bool? _convertWebp1440Th;
|
bool? _convertWebp1440Th;
|
||||||
bool? _convertWebp4k;
|
bool? _convertWebp4k;
|
||||||
bool? _convertWebp4kTh;
|
bool? _convertWebp4kTh;
|
||||||
bool? _convertWebpHd;
|
bool? _convertWebpHd;
|
||||||
bool? _convertWebpHdTh;
|
bool? _convertWebpHdTh;
|
||||||
bool _creating;
|
bool _creating;
|
||||||
MagazineByMachineDto _currentMagazineByMachine;
|
MagazineByMachineDto _currentMagazineByMachine;
|
||||||
MagazineByMachineFamilyDto _currentMagazineByMachineFamily;
|
MagazineByMachineFamilyDto _currentMagazineByMachineFamily;
|
||||||
PersonByMagazineDto _currentPersonByMagazine;
|
PersonByMagazineDto _currentPersonByMagazine;
|
||||||
bool _deleteInProgress;
|
bool _deleteInProgress;
|
||||||
string _deleteText;
|
string _deleteText;
|
||||||
string _deleteTitle;
|
string _deleteTitle;
|
||||||
bool _deletingMagazineByMachine;
|
bool _deletingMagazineByMachine;
|
||||||
bool _deletingMagazineByMachineFamily;
|
bool _deletingMagazineByMachineFamily;
|
||||||
bool _deletingPersonByMagazine;
|
bool _deletingPersonByMagazine;
|
||||||
bool _deletingScan;
|
bool _deletingScan;
|
||||||
bool _editing;
|
bool _editing;
|
||||||
bool _editingScan;
|
bool _editingScan;
|
||||||
bool? _extractExif;
|
bool? _extractExif;
|
||||||
Modal _frmDelete;
|
Modal _frmDelete;
|
||||||
string _imageFormat;
|
string _imageFormat;
|
||||||
ElementReference _inputUpload;
|
ElementReference _inputUpload;
|
||||||
bool _loaded;
|
bool _loaded;
|
||||||
List<MachineFamilyDto> _machineFamilies;
|
List<MachineFamilyDto> _machineFamilies;
|
||||||
List<MachineDto> _machines;
|
List<MachineDto> _machines;
|
||||||
List<MagazineByMachineFamilyDto> _magazineMachineFamilies;
|
List<MagazineByMachineFamilyDto> _magazineMachineFamilies;
|
||||||
@@ -112,39 +112,39 @@ public partial class MagazineIssue
|
|||||||
List<PersonByMagazineDto> _magazinePeople;
|
List<PersonByMagazineDto> _magazinePeople;
|
||||||
List<MagazineDto> _magazines;
|
List<MagazineDto> _magazines;
|
||||||
MagazineIssueDto _model;
|
MagazineIssueDto _model;
|
||||||
bool? _moveFile;
|
bool? _moveFile;
|
||||||
List<DocumentPersonDto> _people;
|
List<DocumentPersonDto> _people;
|
||||||
double _progressValue;
|
double _progressValue;
|
||||||
List<DocumentRoleDto> _roles;
|
List<DocumentRoleDto> _roles;
|
||||||
bool _savingMachine;
|
bool _savingMachine;
|
||||||
bool _savingMachineFamily;
|
bool _savingMachineFamily;
|
||||||
bool _savingPerson;
|
bool _savingPerson;
|
||||||
List<Guid> _scans;
|
List<Guid> _scans;
|
||||||
ApplicationUser _scanUser;
|
ApplicationUser _scanUser;
|
||||||
MagazineScanDto _selectedScan;
|
MagazineScanDto _selectedScan;
|
||||||
bool _unknownIssueNumber;
|
bool _unknownIssueNumber;
|
||||||
bool _unknownNativeCaption;
|
bool _unknownNativeCaption;
|
||||||
bool _unknownPages;
|
bool _unknownPages;
|
||||||
bool _unknownProductCode;
|
bool _unknownProductCode;
|
||||||
bool _unknownPublished;
|
bool _unknownPublished;
|
||||||
bool _unknownScanAuthor;
|
bool _unknownScanAuthor;
|
||||||
bool _unknownScanColorSpace;
|
bool _unknownScanColorSpace;
|
||||||
bool _unknownScanComments;
|
bool _unknownScanComments;
|
||||||
bool _unknownScanCreationDate;
|
bool _unknownScanCreationDate;
|
||||||
bool _unknownScanExifVersion;
|
bool _unknownScanExifVersion;
|
||||||
bool _unknownScanHorizontalResolution;
|
bool _unknownScanHorizontalResolution;
|
||||||
bool _unknownScanPage;
|
bool _unknownScanPage;
|
||||||
bool _unknownScanResolutionUnit;
|
bool _unknownScanResolutionUnit;
|
||||||
bool _unknownScanScannerManufacturer;
|
bool _unknownScanScannerManufacturer;
|
||||||
bool _unknownScanScannerModel;
|
bool _unknownScanScannerModel;
|
||||||
bool _unknownScanSoftwareUsed;
|
bool _unknownScanSoftwareUsed;
|
||||||
bool _unknownScanVerticalResolution;
|
bool _unknownScanVerticalResolution;
|
||||||
bool _uploaded;
|
bool _uploaded;
|
||||||
bool _uploadError;
|
bool _uploadError;
|
||||||
string _uploadErrorMessage;
|
string _uploadErrorMessage;
|
||||||
bool _uploading;
|
bool _uploading;
|
||||||
uint? _uploadScanPage;
|
uint? _uploadScanPage;
|
||||||
uint _uploadScanType;
|
uint _uploadScanType;
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
@page "/admin/software_variants/details/{Id:long}"
|
@page "/admin/software_variants/details/{Id:long}"
|
||||||
@page "/admin/software_variants/edit/{Id:long}"
|
@page "/admin/software_variants/edit/{Id:long}"
|
||||||
@page "/admin/software_variants/create"
|
@page "/admin/software_variants/create"
|
||||||
|
@using Marechai.Data
|
||||||
@using Marechai.Data.Dtos
|
@using Marechai.Data.Dtos
|
||||||
@using Marechai.Database
|
|
||||||
@using Marechai.Database.Models
|
@using Marechai.Database.Models
|
||||||
@inherits OwningComponentBase<SoftwareVariantsService>
|
@inherits OwningComponentBase<SoftwareVariantsService>
|
||||||
@inject IStringLocalizer<SoftwareVariantsService> L
|
@inject IStringLocalizer<SoftwareVariantsService> L
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Blazorise;
|
using Blazorise;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Shared;
|
using Marechai.Shared;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
@@ -38,37 +38,37 @@ namespace Marechai.Pages.Admin.Details;
|
|||||||
|
|
||||||
public partial class SoftwareVariant
|
public partial class SoftwareVariant
|
||||||
{
|
{
|
||||||
bool _addingCompany;
|
bool _addingCompany;
|
||||||
int? _addingCompanyId;
|
int? _addingCompanyId;
|
||||||
string _addingCompanyRoleId;
|
string _addingCompanyRoleId;
|
||||||
AuthenticationState _authState;
|
AuthenticationState _authState;
|
||||||
List<CompanyDto> _companies;
|
List<CompanyDto> _companies;
|
||||||
bool _creating;
|
bool _creating;
|
||||||
CompanyBySoftwareVariantDto _currentCompanyBySoftwareVariant;
|
CompanyBySoftwareVariantDto _currentCompanyBySoftwareVariant;
|
||||||
bool _deleteInProgress;
|
bool _deleteInProgress;
|
||||||
string _deleteText;
|
string _deleteText;
|
||||||
string _deleteTitle;
|
string _deleteTitle;
|
||||||
bool _deletingCompanyBySoftwareVariant;
|
bool _deletingCompanyBySoftwareVariant;
|
||||||
bool _editing;
|
bool _editing;
|
||||||
Modal _frmDelete;
|
Modal _frmDelete;
|
||||||
bool _loaded;
|
bool _loaded;
|
||||||
SoftwareVariantDto _model;
|
SoftwareVariantDto _model;
|
||||||
List<DocumentRoleDto> _roles;
|
List<DocumentRoleDto> _roles;
|
||||||
bool _savingCompany;
|
bool _savingCompany;
|
||||||
List<CompanyBySoftwareVariantDto> _softwareVariantCompanies;
|
List<CompanyBySoftwareVariantDto> _softwareVariantCompanies;
|
||||||
List<SoftwareVariantDto> _softwareVariants;
|
List<SoftwareVariantDto> _softwareVariants;
|
||||||
List<SoftwareVersionDto> _softwareVersions;
|
List<SoftwareVersionDto> _softwareVersions;
|
||||||
bool _unknownCatalogueNumber;
|
bool _unknownCatalogueNumber;
|
||||||
bool _unknownIntroduced;
|
bool _unknownIntroduced;
|
||||||
bool _unknownMinimumMemory;
|
bool _unknownMinimumMemory;
|
||||||
bool _unknownName;
|
bool _unknownName;
|
||||||
bool _unknownParent;
|
bool _unknownParent;
|
||||||
bool _unknownPartNumber;
|
bool _unknownPartNumber;
|
||||||
bool _unknownProductCode;
|
bool _unknownProductCode;
|
||||||
bool _unknownRecommendedMemory;
|
bool _unknownRecommendedMemory;
|
||||||
bool _unknownRequiredStorage;
|
bool _unknownRequiredStorage;
|
||||||
bool _unknownSerialNumber;
|
bool _unknownSerialNumber;
|
||||||
bool _unknownVersion;
|
bool _unknownVersion;
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public ulong Id { get; set; }
|
public ulong Id { get; set; }
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
@{
|
@{
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
// MARECHAI: Master repository of computing history artifacts information
|
// MARECHAI: Master repository of computing history artifacts information
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
@@ -26,8 +26,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@page "/company/{Id:int}"
|
@page "/company/{Id:int}"
|
||||||
|
@using Marechai.Data
|
||||||
@using Marechai.Database
|
|
||||||
@using Marechai.Database.Models
|
@using Marechai.Database.Models
|
||||||
@inherits OwningComponentBase<CompaniesService>
|
@inherits OwningComponentBase<CompaniesService>
|
||||||
@inject IStringLocalizer<CompaniesService> L
|
@inject IStringLocalizer<CompaniesService> L
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ namespace Marechai.Pages.Companies;
|
|||||||
|
|
||||||
public partial class View
|
public partial class View
|
||||||
{
|
{
|
||||||
CompanyDto _company;
|
CompanyDto _company;
|
||||||
List<Machine> _computers;
|
List<Machine> _computers;
|
||||||
List<Machine> _consoles;
|
List<Machine> _consoles;
|
||||||
string _description;
|
string _description;
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@page "/machine/{Id:int}"
|
@page "/machine/{Id:int}"
|
||||||
|
@using Marechai.Data
|
||||||
@using Marechai.Data.Dtos
|
@using Marechai.Data.Dtos
|
||||||
@using Marechai.Database
|
|
||||||
@inherits OwningComponentBase<MachinesService>
|
@inherits OwningComponentBase<MachinesService>
|
||||||
@inject IStringLocalizer<MachinesService> L
|
@inject IStringLocalizer<MachinesService> L
|
||||||
@inject IWebHostEnvironment Host
|
@inject IWebHostEnvironment Host
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
@@ -39,52 +39,59 @@ public class ComputersService(MarechaiContext context)
|
|||||||
await context.Machines.CountAsync(c => c.Type == MachineType.Computer);
|
await context.Machines.CountAsync(c => c.Type == MachineType.Computer);
|
||||||
|
|
||||||
public Task<int> GetMinimumYearAsync() => context.Machines
|
public Task<int> GetMinimumYearAsync() => context.Machines
|
||||||
.Where(t => t.Type == MachineType.Computer &&
|
.Where(t => t.Type == MachineType.Computer &&
|
||||||
t.Introduced.HasValue &&
|
t.Introduced.HasValue &&
|
||||||
t.Introduced.Value.Year > 1000)
|
t.Introduced.Value.Year > 1000)
|
||||||
.MinAsync(t => t.Introduced.Value.Year);
|
.MinAsync(t => t.Introduced.Value.Year);
|
||||||
|
|
||||||
public Task<int> GetMaximumYearAsync() => context.Machines
|
public Task<int> GetMaximumYearAsync() => context.Machines
|
||||||
.Where(t => t.Type == MachineType.Computer &&
|
.Where(t => t.Type == MachineType.Computer &&
|
||||||
t.Introduced.HasValue &&
|
t.Introduced.HasValue &&
|
||||||
t.Introduced.Value.Year > 1000)
|
t.Introduced.Value.Year > 1000)
|
||||||
.MaxAsync(t => t.Introduced.Value.Year);
|
.MaxAsync(t => t.Introduced.Value.Year);
|
||||||
|
|
||||||
public async Task<List<MachineDto>> GetComputersByLetterAsync(char c) => await context.Machines
|
public async Task<List<MachineDto>> GetComputersByLetterAsync(char c) => await context.Machines
|
||||||
.Include(m => m.Company)
|
.Include(m => m.Company)
|
||||||
.Where(m => m.Type == MachineType.Computer && EF.Functions.Like(m.Name, $"{c}%"))
|
.Where(m => m.Type ==
|
||||||
.OrderBy(m => m.Company.Name)
|
MachineType.Computer &&
|
||||||
.ThenBy(m => m.Name)
|
EF.Functions.Like(m.Name,
|
||||||
.Select(m => new MachineDto
|
$"{c}%"))
|
||||||
{
|
.OrderBy(m => m.Company.Name)
|
||||||
Id = m.Id,
|
.ThenBy(m => m.Name)
|
||||||
Name = m.Name,
|
.Select(m => new MachineDto
|
||||||
Company = m.Company.Name
|
{
|
||||||
})
|
Id = m.Id,
|
||||||
.ToListAsync();
|
Name = m.Name,
|
||||||
|
Company = m.Company.Name
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
public async Task<List<MachineDto>> GetComputersByYearAsync(int year) => await context.Machines
|
public async Task<List<MachineDto>> GetComputersByYearAsync(int year) => await context.Machines
|
||||||
.Include(m => m.Company)
|
.Include(m => m.Company)
|
||||||
.Where(m => m.Type == MachineType.Computer && m.Introduced != null && m.Introduced.Value.Year == year)
|
.Where(m => m.Type ==
|
||||||
.OrderBy(m => m.Company.Name)
|
MachineType.Computer &&
|
||||||
.ThenBy(m => m.Name)
|
m.Introduced != null &&
|
||||||
.Select(m => new MachineDto
|
m.Introduced.Value.Year ==
|
||||||
{
|
year)
|
||||||
Id = m.Id,
|
.OrderBy(m => m.Company.Name)
|
||||||
Name = m.Name,
|
.ThenBy(m => m.Name)
|
||||||
Company = m.Company.Name
|
.Select(m => new MachineDto
|
||||||
})
|
{
|
||||||
.ToListAsync();
|
Id = m.Id,
|
||||||
|
Name = m.Name,
|
||||||
|
Company = m.Company.Name
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
public async Task<List<MachineDto>> GetComputersAsync() => await context.Machines.Include(m => m.Company)
|
public async Task<List<MachineDto>> GetComputersAsync() => await context.Machines.Include(m => m.Company)
|
||||||
.Where(m => m.Type == MachineType.Computer)
|
.Where(m => m.Type == MachineType.Computer)
|
||||||
.OrderBy(m => m.Company.Name)
|
.OrderBy(m => m.Company.Name)
|
||||||
.ThenBy(m => m.Name)
|
.ThenBy(m => m.Name)
|
||||||
.Select(m => new MachineDto
|
.Select(m => new MachineDto
|
||||||
{
|
{
|
||||||
Id = m.Id,
|
Id = m.Id,
|
||||||
Name = m.Name,
|
Name = m.Name,
|
||||||
Company = m.Company.Name
|
Company = m.Company.Name
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
@@ -26,8 +26,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
@@ -39,52 +39,61 @@ public class ConsolesService(MarechaiContext context)
|
|||||||
await context.Machines.CountAsync(c => c.Type == MachineType.Console);
|
await context.Machines.CountAsync(c => c.Type == MachineType.Console);
|
||||||
|
|
||||||
public Task<int> GetMinimumYearAsync() => context.Machines
|
public Task<int> GetMinimumYearAsync() => context.Machines
|
||||||
.Where(t => t.Type == MachineType.Console &&
|
.Where(t => t.Type == MachineType.Console &&
|
||||||
t.Introduced.HasValue &&
|
t.Introduced.HasValue &&
|
||||||
t.Introduced.Value.Year > 1000)
|
t.Introduced.Value.Year > 1000)
|
||||||
.MinAsync(t => t.Introduced.Value.Year);
|
.MinAsync(t => t.Introduced.Value.Year);
|
||||||
|
|
||||||
public Task<int> GetMaximumYearAsync() => context.Machines
|
public Task<int> GetMaximumYearAsync() => context.Machines
|
||||||
.Where(t => t.Type == MachineType.Console &&
|
.Where(t => t.Type == MachineType.Console &&
|
||||||
t.Introduced.HasValue &&
|
t.Introduced.HasValue &&
|
||||||
t.Introduced.Value.Year > 1000)
|
t.Introduced.Value.Year > 1000)
|
||||||
.MaxAsync(t => t.Introduced.Value.Year);
|
.MaxAsync(t => t.Introduced.Value.Year);
|
||||||
|
|
||||||
public async Task<List<MachineDto>> GetConsolesByLetterAsync(char c) => await context.Machines
|
public async Task<List<MachineDto>> GetConsolesByLetterAsync(char c) => await context.Machines
|
||||||
.Include(m => m.Company)
|
.Include(m => m.Company)
|
||||||
.Where(m => m.Type == MachineType.Console && EF.Functions.Like(m.Name, $"{c}%"))
|
.Where(m =>
|
||||||
.OrderBy(m => m.Company.Name)
|
m.Type ==
|
||||||
.ThenBy(m => m.Name)
|
MachineType.Console &&
|
||||||
.Select(m => new MachineDto
|
EF.Functions.Like(m.Name,
|
||||||
{
|
$"{c}%"))
|
||||||
Id = m.Id,
|
.OrderBy(m => m.Company.Name)
|
||||||
Name = m.Name,
|
.ThenBy(m => m.Name)
|
||||||
Company = m.Company.Name
|
.Select(m => new MachineDto
|
||||||
})
|
{
|
||||||
.ToListAsync();
|
Id = m.Id,
|
||||||
|
Name = m.Name,
|
||||||
|
Company = m.Company.Name
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
public async Task<List<MachineDto>> GetConsolesByYearAsync(int year) => await context.Machines
|
public async Task<List<MachineDto>> GetConsolesByYearAsync(int year) => await context.Machines
|
||||||
.Include(m => m.Company)
|
.Include(m => m.Company)
|
||||||
.Where(m => m.Type == MachineType.Console && m.Introduced != null && m.Introduced.Value.Year == year)
|
.Where(m =>
|
||||||
.OrderBy(m => m.Company.Name)
|
m.Type ==
|
||||||
.ThenBy(m => m.Name)
|
MachineType.Console &&
|
||||||
.Select(m => new MachineDto
|
m.Introduced != null &&
|
||||||
{
|
m.Introduced.Value.Year ==
|
||||||
Id = m.Id,
|
year)
|
||||||
Name = m.Name,
|
.OrderBy(m => m.Company.Name)
|
||||||
Company = m.Company.Name
|
.ThenBy(m => m.Name)
|
||||||
})
|
.Select(m => new MachineDto
|
||||||
.ToListAsync();
|
{
|
||||||
|
Id = m.Id,
|
||||||
|
Name = m.Name,
|
||||||
|
Company = m.Company.Name
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
public async Task<List<MachineDto>> GetConsolesAsync() => await context.Machines.Include(m => m.Company)
|
public async Task<List<MachineDto>> GetConsolesAsync() => await context.Machines.Include(m => m.Company)
|
||||||
.Where(m => m.Type == MachineType.Console)
|
.Where(m => m.Type == MachineType.Console)
|
||||||
.OrderBy(m => m.Company.Name)
|
.OrderBy(m => m.Company.Name)
|
||||||
.ThenBy(m => m.Name)
|
.ThenBy(m => m.Name)
|
||||||
.Select(m => new MachineDto
|
.Select(m => new MachineDto
|
||||||
{
|
{
|
||||||
Id = m.Id,
|
Id = m.Id,
|
||||||
Name = m.Name,
|
Name = m.Name,
|
||||||
Company = m.Company.Name
|
Company = m.Company.Name
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
@@ -27,8 +27,8 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
@@ -44,36 +44,36 @@ public class MachinesService
|
|||||||
SoundSynthsService soundSynthsService
|
SoundSynthsService soundSynthsService
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
readonly IStringLocalizer<MachinesService> _l = localizer;
|
readonly IStringLocalizer<MachinesService> _l = localizer;
|
||||||
|
|
||||||
public async Task<List<MachineDto>> GetAsync() => await context.Machines.OrderBy(m => m.Company.Name)
|
public async Task<List<MachineDto>> GetAsync() => await context.Machines.OrderBy(m => m.Company.Name)
|
||||||
.ThenBy(m => m.Name)
|
.ThenBy(m => m.Name)
|
||||||
.ThenBy(m => m.Family.Name)
|
.ThenBy(m => m.Family.Name)
|
||||||
.Select(m => new MachineDto
|
.Select(m => new MachineDto
|
||||||
{
|
{
|
||||||
Id = m.Id,
|
Id = m.Id,
|
||||||
Company = m.Company.Name,
|
Company = m.Company.Name,
|
||||||
Name = m.Name,
|
Name = m.Name,
|
||||||
Model = m.Model,
|
Model = m.Model,
|
||||||
Introduced = m.Introduced,
|
Introduced = m.Introduced,
|
||||||
Type = m.Type,
|
Type = m.Type,
|
||||||
Family = m.Family.Name
|
Family = m.Family.Name
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
public async Task<MachineDto> GetAsync(int id) => await context.Machines.Where(m => m.Id == id)
|
public async Task<MachineDto> GetAsync(int id) => await context.Machines.Where(m => m.Id == id)
|
||||||
.Select(m => new MachineDto
|
.Select(m => new MachineDto
|
||||||
{
|
{
|
||||||
Id = m.Id,
|
Id = m.Id,
|
||||||
Company = m.Company.Name,
|
Company = m.Company.Name,
|
||||||
CompanyId = m.CompanyId,
|
CompanyId = m.CompanyId,
|
||||||
Name = m.Name,
|
Name = m.Name,
|
||||||
Model = m.Model,
|
Model = m.Model,
|
||||||
Introduced = m.Introduced,
|
Introduced = m.Introduced,
|
||||||
Type = m.Type,
|
Type = m.Type,
|
||||||
FamilyId = m.FamilyId
|
FamilyId = m.FamilyId
|
||||||
})
|
})
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
public async Task UpdateAsync(MachineDto dto, string userId)
|
public async Task UpdateAsync(MachineDto dto, string userId)
|
||||||
{
|
{
|
||||||
@@ -185,9 +185,7 @@ public class MachinesService
|
|||||||
IQueryable<CompanyLogo> logos = context.CompanyLogos.Where(l => l.CompanyId == company.Id);
|
IQueryable<CompanyLogo> logos = context.CompanyLogos.Where(l => l.CompanyId == company.Id);
|
||||||
|
|
||||||
if(model.Introduced.HasValue)
|
if(model.Introduced.HasValue)
|
||||||
{
|
|
||||||
model.CompanyLogo = (await logos.FirstOrDefaultAsync(l => l.Year >= model.Introduced.Value.Year))?.Guid;
|
model.CompanyLogo = (await logos.FirstOrDefaultAsync(l => l.Year >= model.Introduced.Value.Year))?.Guid;
|
||||||
}
|
|
||||||
|
|
||||||
if(model.CompanyLogo is null && logos.Any()) model.CompanyLogo = (await logos.FirstAsync())?.Guid;
|
if(model.CompanyLogo is null && logos.Any()) model.CompanyLogo = (await logos.FirstAsync())?.Guid;
|
||||||
}
|
}
|
||||||
@@ -203,27 +201,27 @@ public class MachinesService
|
|||||||
model.Gpus = await gpusService.GetByMachineAsync(machine.Id);
|
model.Gpus = await gpusService.GetByMachineAsync(machine.Id);
|
||||||
|
|
||||||
model.Memory = await context.MemoryByMachine.Where(m => m.MachineId == machine.Id)
|
model.Memory = await context.MemoryByMachine.Where(m => m.MachineId == machine.Id)
|
||||||
.Select(m => new MemoryDto
|
.Select(m => new MemoryDto
|
||||||
{
|
{
|
||||||
Type = m.Type,
|
Type = m.Type,
|
||||||
Usage = m.Usage,
|
Usage = m.Usage,
|
||||||
Size = m.Size,
|
Size = m.Size,
|
||||||
Speed = m.Speed
|
Speed = m.Speed
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
model.Processors = await processorsService.GetByMachineAsync(machine.Id);
|
model.Processors = await processorsService.GetByMachineAsync(machine.Id);
|
||||||
|
|
||||||
model.SoundSynthesizers = await soundSynthsService.GetByMachineAsync(machine.Id);
|
model.SoundSynthesizers = await soundSynthsService.GetByMachineAsync(machine.Id);
|
||||||
|
|
||||||
model.Storage = await context.StorageByMachine.Where(s => s.MachineId == machine.Id)
|
model.Storage = await context.StorageByMachine.Where(s => s.MachineId == machine.Id)
|
||||||
.Select(s => new StorageDto
|
.Select(s => new StorageDto
|
||||||
{
|
{
|
||||||
Type = s.Type,
|
Type = s.Type,
|
||||||
Interface = s.Interface,
|
Interface = s.Interface,
|
||||||
Capacity = s.Capacity
|
Capacity = s.Capacity
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
@@ -36,21 +36,21 @@ namespace Marechai.Services;
|
|||||||
public class MemoriesByMachineService(MarechaiContext context)
|
public class MemoriesByMachineService(MarechaiContext context)
|
||||||
{
|
{
|
||||||
public async Task<List<MemoryByMachineDto>> GetByMachine(int machineId) => await context.MemoryByMachine
|
public async Task<List<MemoryByMachineDto>> GetByMachine(int machineId) => await context.MemoryByMachine
|
||||||
.Where(m => m.MachineId == machineId)
|
.Where(m => m.MachineId == machineId)
|
||||||
.Select(m => new MemoryByMachineDto
|
.Select(m => new MemoryByMachineDto
|
||||||
{
|
{
|
||||||
Id = m.Id,
|
Id = m.Id,
|
||||||
Type = m.Type,
|
Type = m.Type,
|
||||||
Usage = m.Usage,
|
Usage = m.Usage,
|
||||||
Size = m.Size,
|
Size = m.Size,
|
||||||
Speed = m.Speed,
|
Speed = m.Speed,
|
||||||
MachineId = m.MachineId
|
MachineId = m.MachineId
|
||||||
})
|
})
|
||||||
.OrderBy(m => m.Type)
|
.OrderBy(m => m.Type)
|
||||||
.ThenBy(m => m.Usage)
|
.ThenBy(m => m.Usage)
|
||||||
.ThenBy(m => m.Size)
|
.ThenBy(m => m.Size)
|
||||||
.ThenBy(m => m.Speed)
|
.ThenBy(m => m.Speed)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
public async Task DeleteAsync(long id, string userId)
|
public async Task DeleteAsync(long id, string userId)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
@@ -37,14 +37,14 @@ namespace Marechai.Services;
|
|||||||
public class NewsService(MarechaiContext context, IStringLocalizer<NewsService> localizer)
|
public class NewsService(MarechaiContext context, IStringLocalizer<NewsService> localizer)
|
||||||
{
|
{
|
||||||
public async Task<List<NewsDto>> GetAsync() => await context.News.OrderByDescending(n => n.Date)
|
public async Task<List<NewsDto>> GetAsync() => await context.News.OrderByDescending(n => n.Date)
|
||||||
.Select(n => new NewsDto
|
.Select(n => new NewsDto
|
||||||
{
|
{
|
||||||
Id = n.Id,
|
Id = n.Id,
|
||||||
Timestamp = n.Date,
|
Timestamp = n.Date,
|
||||||
Type = n.Type,
|
Type = n.Type,
|
||||||
AffectedId = n.AddedId
|
AffectedId = n.AddedId
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
public List<NewsDto> GetNews()
|
public List<NewsDto> GetNews()
|
||||||
{
|
{
|
||||||
@@ -60,72 +60,72 @@ public class NewsService(MarechaiContext context, IStringLocalizer<NewsService>
|
|||||||
{
|
{
|
||||||
case NewsType.NewComputerInDb:
|
case NewsType.NewComputerInDb:
|
||||||
news.Add(new NewsDto(@new.AddedId,
|
news.Add(new NewsDto(@new.AddedId,
|
||||||
localizer["New computer in database"],
|
localizer["New computer in database"],
|
||||||
@new.Date,
|
@new.Date,
|
||||||
"machine",
|
"machine",
|
||||||
$"{machine.Company.Name} {machine.Name}"));
|
$"{machine.Company.Name} {machine.Name}"));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case NewsType.NewConsoleInDb:
|
case NewsType.NewConsoleInDb:
|
||||||
news.Add(new NewsDto(@new.AddedId,
|
news.Add(new NewsDto(@new.AddedId,
|
||||||
localizer["New console in database"],
|
localizer["New console in database"],
|
||||||
@new.Date,
|
@new.Date,
|
||||||
"machine",
|
"machine",
|
||||||
$"{machine.Company.Name} {machine.Name}"));
|
$"{machine.Company.Name} {machine.Name}"));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NewsType.NewComputerInCollection:
|
case NewsType.NewComputerInCollection:
|
||||||
news.Add(new NewsDto(@new.AddedId,
|
news.Add(new NewsDto(@new.AddedId,
|
||||||
localizer["New computer in collection"],
|
localizer["New computer in collection"],
|
||||||
@new.Date,
|
@new.Date,
|
||||||
"machine",
|
"machine",
|
||||||
$"{machine.Company.Name} {machine.Name}"));
|
$"{machine.Company.Name} {machine.Name}"));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NewsType.NewConsoleInCollection:
|
case NewsType.NewConsoleInCollection:
|
||||||
news.Add(new NewsDto(@new.AddedId,
|
news.Add(new NewsDto(@new.AddedId,
|
||||||
localizer["New console in collection"],
|
localizer["New console in collection"],
|
||||||
@new.Date,
|
@new.Date,
|
||||||
"machine",
|
"machine",
|
||||||
$"{machine.Company.Name} {machine.Name}"));
|
$"{machine.Company.Name} {machine.Name}"));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NewsType.UpdatedComputerInDb:
|
case NewsType.UpdatedComputerInDb:
|
||||||
news.Add(new NewsDto(@new.AddedId,
|
news.Add(new NewsDto(@new.AddedId,
|
||||||
localizer["Updated computer in database"],
|
localizer["Updated computer in database"],
|
||||||
@new.Date,
|
@new.Date,
|
||||||
"machine",
|
"machine",
|
||||||
$"{machine.Company.Name} {machine.Name}"));
|
$"{machine.Company.Name} {machine.Name}"));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NewsType.UpdatedConsoleInDb:
|
case NewsType.UpdatedConsoleInDb:
|
||||||
news.Add(new NewsDto(@new.AddedId,
|
news.Add(new NewsDto(@new.AddedId,
|
||||||
localizer["Updated console in database"],
|
localizer["Updated console in database"],
|
||||||
@new.Date,
|
@new.Date,
|
||||||
"machine",
|
"machine",
|
||||||
$"{machine.Company.Name} {machine.Name}"));
|
$"{machine.Company.Name} {machine.Name}"));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NewsType.UpdatedComputerInCollection:
|
case NewsType.UpdatedComputerInCollection:
|
||||||
news.Add(new NewsDto(@new.AddedId,
|
news.Add(new NewsDto(@new.AddedId,
|
||||||
localizer["Updated computer in collection"],
|
localizer["Updated computer in collection"],
|
||||||
@new.Date,
|
@new.Date,
|
||||||
"machine",
|
"machine",
|
||||||
$"{machine.Company.Name} {machine.Name}"));
|
$"{machine.Company.Name} {machine.Name}"));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NewsType.UpdatedConsoleInCollection:
|
case NewsType.UpdatedConsoleInCollection:
|
||||||
news.Add(new NewsDto(@new.AddedId,
|
news.Add(new NewsDto(@new.AddedId,
|
||||||
localizer["Updated console in collection"],
|
localizer["Updated console in collection"],
|
||||||
@new.Date,
|
@new.Date,
|
||||||
"machine",
|
"machine",
|
||||||
$"{machine.Company.Name} {machine.Name}"));
|
$"{machine.Company.Name} {machine.Name}"));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Marechai.Data;
|
||||||
using Marechai.Data.Dtos;
|
using Marechai.Data.Dtos;
|
||||||
using Marechai.Database;
|
|
||||||
using Marechai.Database.Models;
|
using Marechai.Database.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
@@ -36,19 +36,19 @@ namespace Marechai.Services;
|
|||||||
public class StorageByMachineService(MarechaiContext context)
|
public class StorageByMachineService(MarechaiContext context)
|
||||||
{
|
{
|
||||||
public async Task<List<StorageByMachineDto>> GetByMachine(int machineId) => await context.StorageByMachine
|
public async Task<List<StorageByMachineDto>> GetByMachine(int machineId) => await context.StorageByMachine
|
||||||
.Where(s => s.MachineId == machineId)
|
.Where(s => s.MachineId == machineId)
|
||||||
.Select(s => new StorageByMachineDto
|
.Select(s => new StorageByMachineDto
|
||||||
{
|
{
|
||||||
Id = s.Id,
|
Id = s.Id,
|
||||||
Type = s.Type,
|
Type = s.Type,
|
||||||
Interface = s.Interface,
|
Interface = s.Interface,
|
||||||
Capacity = s.Capacity,
|
Capacity = s.Capacity,
|
||||||
MachineId = s.MachineId
|
MachineId = s.MachineId
|
||||||
})
|
})
|
||||||
.OrderBy(s => s.Type)
|
.OrderBy(s => s.Type)
|
||||||
.ThenBy(s => s.Interface)
|
.ThenBy(s => s.Interface)
|
||||||
.ThenBy(s => s.Capacity)
|
.ThenBy(s => s.Capacity)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
public async Task DeleteAsync(long id, string userId)
|
public async Task DeleteAsync(long id, string userId)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user