Skip to content

Commit

Permalink
Added License Model.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeviBickel committed Mar 2, 2024
1 parent fb4a702 commit a71cde8
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 60 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,6 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd
/SoftwareTracker/appsettings.json
/SoftwareTracker/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// <auto-generated />
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SoftwareTracker.Data;
using System;

#nullable disable

namespace SoftwareTracker.Data.Migrations
{
Expand All @@ -15,9 +17,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.HasAnnotation("ProductVersion", "8.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128);

SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
Expand All @@ -29,29 +32,30 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("nvarchar(max)");

b.Property<string>("Name")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");

b.Property<string>("NormalizedName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");

b.HasKey("Id");

b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex")
.HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");

b.ToTable("AspNetRoles");
b.ToTable("AspNetRoles", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.HasColumnType("int");

SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
Expand All @@ -67,7 +71,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasIndex("RoleId");

b.ToTable("AspNetRoleClaims");
b.ToTable("AspNetRoleClaims", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
Expand All @@ -83,8 +87,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("nvarchar(max)");

b.Property<string>("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");

b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
Expand All @@ -96,12 +100,12 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("datetimeoffset");

b.Property<string>("NormalizedEmail")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");

b.Property<string>("NormalizedUserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");

b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
Expand All @@ -119,28 +123,29 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("bit");

b.Property<string>("UserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");

b.HasKey("Id");

b.HasIndex("NormalizedEmail")
.HasName("EmailIndex");
.HasDatabaseName("EmailIndex");

b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("UserNameIndex")
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");

b.ToTable("AspNetUsers");
b.ToTable("AspNetUsers", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.HasColumnType("int");

SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
Expand All @@ -156,18 +161,18 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasIndex("UserId");

b.ToTable("AspNetUserClaims");
b.ToTable("AspNetUserClaims", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");

b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");

b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
Expand All @@ -180,7 +185,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasIndex("UserId");

b.ToTable("AspNetUserLogins");
b.ToTable("AspNetUserLogins", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
Expand All @@ -195,7 +200,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasIndex("RoleId");

b.ToTable("AspNetUserRoles");
b.ToTable("AspNetUserRoles", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
Expand All @@ -204,19 +209,19 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("nvarchar(450)");

b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");

b.Property<string>("Name")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");

b.Property<string>("Value")
.HasColumnType("nvarchar(max)");

b.HasKey("UserId", "LoginProvider", "Name");

b.ToTable("AspNetUserTokens");
b.ToTable("AspNetUserTokens", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
Expand Down
48 changes: 48 additions & 0 deletions SoftwareTracker/Models/LicenseModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System.ComponentModel.DataAnnotations;

namespace SoftwareTracker.Models
{
public class LicenseModel
{
public int Id { get; set; }
public string Manufacturer { get; set; }

[Display(Name = "Software Title")]
[Required]
public string SoftwareTitle { get; set; }

[Display(Name = "Assigned To")]
public string AssignedServer { get; set; }

[Display(Name = "Purchase Order #")]
public string PurchaseOrder { get; set; }

[DisplayFormat(DataFormatString = "{0:dd MMM yyyy}")]
[Display(Name = "Purchase Date")]
[DataType(DataType.Date)]
public DateTime PurchaseDate { get; set; }

[Display(Name = "License Type")]
public string LicenseType { get; set; }
public bool Support { get; set; }
[DisplayFormat(DataFormatString = "{0:dd MMM yyyy}")]

[Display(Name = "Support Expiration")]
[DataType(DataType.Date)]
public DateTime SupportExp { get; set; }

[Display(Name = "Total Keys")]
[Required]
public int AmountofKeys { get; set; }

[Display(Name = "Used Keys")]
[Required]
public int UsedKeys { get; set; }

[Display(Name = "Remaining Keys")]
public int RemainingKeys { get; set; }

[Display(Name = "License Key")]
public string LicenseKey { get; set; }
}
}
8 changes: 0 additions & 8 deletions SoftwareTracker/appsettings.Development.json

This file was deleted.

12 changes: 0 additions & 12 deletions SoftwareTracker/appsettings.json

This file was deleted.

0 comments on commit a71cde8

Please sign in to comment.