Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4a30cda
Cleanup
willywil548 Dec 21, 2024
eb0d485
incremental update
willywil548 Dec 21, 2024
9637783
Add attributes to allow generic reading of the database
willywil548 Dec 24, 2024
7183f55
refine
willywil548 Dec 24, 2024
ea71697
move models to models
willywil548 Dec 24, 2024
45c2aad
Add way to enter new class records
willywil548 Dec 24, 2024
d2d97e0
Add utility extensions
willywil548 Dec 24, 2024
aebc4d3
moved extension to extensions namespace
willywil548 Dec 24, 2024
298ee03
Make table more generic
willywil548 Dec 24, 2024
973cf6b
Navigating to sub paths causes issues loading static resources. Just …
willywil548 Dec 24, 2024
a00234d
Fix database creation file with new class information table
willywil548 Dec 24, 2024
3b0d665
Add MudBlazor and update dependencies
willywil548 Dec 24, 2024
d66dd8e
update directives
willywil548 Dec 24, 2024
17fa793
continue refinement
willywil548 Dec 26, 2024
f9dcd55
Refine the models
willywil548 Dec 26, 2024
73579d4
Remove reference to mud and some framework updates
willywil548 Dec 26, 2024
1385381
Refine database to match model
willywil548 Dec 26, 2024
754f4e8
Add some custom things we may want to keep
willywil548 Dec 26, 2024
0f443d8
minor update
willywil548 Dec 28, 2024
6448025
add table type
willywil548 Dec 28, 2024
3bc5753
update the migration efforts
willywil548 Dec 28, 2024
318acf4
Wire up student to table
willywil548 Dec 28, 2024
1942bbe
remove duplicate
willywil548 Dec 28, 2024
7eb6f81
reviewers email is needed
willywil548 Dec 28, 2024
885c1ca
Update parsing logic
willywil548 Dec 28, 2024
08733c8
update models to reflect sql
willywil548 Dec 28, 2024
3d556bb
continue refinement and integration
willywil548 Jan 11, 2025
0d0af7b
incremental update
willywil548 Jan 12, 2025
e413ca1
continue refinement
willywil548 Jan 12, 2025
0c86373
continue refinement
willywil548 Jan 12, 2025
ac9f721
finish search refinement
willywil548 Jan 12, 2025
096fd97
fix some data read errors
willywil548 Feb 15, 2025
2d2de41
continue refinement
willywil548 Feb 15, 2025
57aab06
refine
willywil548 Feb 15, 2025
90f426d
fix showing action button when not needed
willywil548 Feb 15, 2025
37882f0
continued refinement
willywil548 Mar 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CaPPMS/App.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Router AppAssembly="@typeof(Program).Assembly" >
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
Expand Down
58 changes: 58 additions & 0 deletions CaPPMS/Attributes/AllowedStringNumericBasedValuesAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using CaPPMS.Extensions;
using Humanizer;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace CaPPMS.Attributes
{
/// <summary>
/// Represents an attribute that specifies the range of values that are allowed for a property or parameter.
/// </summary>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
public class AllowedStringNumericBasedValuesAttribute : ValidationAttribute
{
private HashSet<string> stringLookup = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
private HashSet<int> intLookup = new();

/// <summary>
/// Initializes a new instance of the <see cref="AllowedStringNumericBasedValuesAttribute" /> class.
/// </summary>
/// <param name="start">The bottom of the range.</param>
/// <param name="end">The top of the range.</param>
public AllowedStringNumericBasedValuesAttribute(int start, int end)
{
while(start <= end)
{
stringLookup.Add(start.ToWords());
intLookup.Add(start);
start++;
}
}

/// <summary>
/// Determines whether a specified object is valid. (Overrides <see cref="ValidationAttribute.IsValid(object)" />)
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public override bool IsValid(object? value)
{
if (value == null)
{
return false;
}

if (stringLookup.Contains(value.NullSafeToString()))
{
return true;
}

if (int.TryParse(value.NullSafeToString(), out int result) && intLookup.Contains(result))
{
return true;
}

return false;
}
}
}
9 changes: 9 additions & 0 deletions CaPPMS/Attributes/SqlIdPropertyAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace CaPPMS.Attributes
{
[AttributeUsage(AttributeTargets.Property)]
public class SqlIdPropertyAttribute : Attribute
{
}
}
25 changes: 25 additions & 0 deletions CaPPMS/Attributes/SqlTableNameAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;

namespace CaPPMS.Attributes
{
/// <summary>
/// Attribute to associate a class with the backing table name.
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class SqlTableNameAttribute : Attribute
{
/// <summary>
/// Initialize the attribute with the table name.
/// </summary>
/// <param name="tableName"></param>
public SqlTableNameAttribute(string tableName)
{
TableName = tableName;
}

/// <summary>
/// Associated table name.
/// </summary>
public string TableName { get; }
}
}
85 changes: 85 additions & 0 deletions CaPPMS/CaPPMS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="BlazorPro.Spinkit" Version="1.2.0" />
<PackageReference Include="Humanizer" Version="2.14.1" />
Expand All @@ -78,11 +79,88 @@
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="3.1.0" />
<PackageReference Include="Microsoft.Identity.Web.UI" Version="3.1.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageReference Include="MudBlazor" Version="7.15.0" GeneratePathProperty="true" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Octokit" Version="13.0.1" />
<PackageReference Include="System.Drawing.Common" Version="8.0.8" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<Content Update="wwwroot\css\bootstrap\bootstrap.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\css\all.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-brands-400.eot">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-brands-400.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-brands-400.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-brands-400.woff">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-brands-400.woff2">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-regular-400.eot">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-regular-400.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-regular-400.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-regular-400.woff">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-regular-400.woff2">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-solid-900.eot">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-solid-900.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-solid-900.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-solid-900.woff">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\font-awesome\webfonts\fa-solid-900.woff2">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\open-iconic\font\css\open-iconic-bootstrap.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\open-iconic\font\fonts\open-iconic.eot">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\open-iconic\font\fonts\open-iconic.otf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\open-iconic\font\fonts\open-iconic.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\open-iconic\font\fonts\open-iconic.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\open-iconic\font\fonts\open-iconic.woff">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\css\site.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<None Update="SQL_Creation\CaPPMS_Table_Generation.sql">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand All @@ -91,4 +169,11 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="CopyMudStaticFile" BeforeTargets="Compile">
<ItemGroup>
<MudStatics Include="$(PkgMudBlazor)\staticwebassets\*.*" />
</ItemGroup>
<Message Text="Writing to $(OutputPath)\wwwroot\_content" />
<Copy SourceFiles="@(MudStatics)" DestinationFolder="$(OutputPath)\wwwroot\_content" />
</Target>
</Project>
13 changes: 4 additions & 9 deletions CaPPMS/CaPPMS.sln
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34701.34
MinimumVisualStudioVersion = 10.0.40219.1
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CaPPMS", "CaPPMS.csproj", "{AA9B970F-5351-4EA2-A78C-7E83F05C57C1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CaPPMSTests", "..\CaPPMSTests\CaPPMSTests.csproj", "{E5612EEB-8B7F-4E6D-9608-A55795477FEC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AA9B970F-5351-4EA2-A78C-7E83F05C57C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA9B970F-5351-4EA2-A78C-7E83F05C57C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5612EEB-8B7F-4E6D-9608-A55795477FEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5612EEB-8B7F-4E6D-9608-A55795477FEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA9B970F-5351-4EA2-A78C-7E83F05C57C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA9B970F-5351-4EA2-A78C-7E83F05C57C1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading
Loading