This commit is contained in:
MOHD ARIFF 2024-11-27 16:30:29 +08:00
parent 0ee2817376
commit fd34ac4822
5 changed files with 780 additions and 15 deletions

View File

@ -6,7 +6,9 @@ namespace PSTW_CentralSystem.Areas.Inventory.Models
public class ItemModel public class ItemModel
{ {
[Key] [Key]
public string? ItemID { get; set; } public int ItemID { get; set; }
[Required]
public string? UniqueID { get; set; }
public required int CompanyId { get; set; } public required int CompanyId { get; set; }
public required int DepartmentId { get; set; } public required int DepartmentId { get; set; }
public required int ProductId { get; set; } public required int ProductId { get; set; }

View File

@ -181,9 +181,11 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory
} }
try try
{ { var itemDepartment = _authDbContext.Departments.Include(d => d.Company).Where(d => d.DepartmentId == item.DepartmentId).FirstOrDefault();
_authDbContext.Items.Add(item); string conpanyInitial = itemDepartment.Company.Name.ToString().Substring(0, 1).ToUpper();
await _authDbContext.SaveChangesAsync(); var uniqueId = Guid.NewGuid().ToString();
//_authDbContext.Items.Add(item);
//await _authDbContext.SaveChangesAsync();
var updatedList = await _authDbContext.Items.ToListAsync(); var updatedList = await _authDbContext.Items.ToListAsync();
return Json(updatedList); return Json(updatedList);
} }

View File

@ -0,0 +1,648 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using PSTW_CentralSystem.DBContext;
#nullable disable
namespace PSTW_CentralSystem.Migrations
{
[DbContext(typeof(AuthDBContext))]
[Migration("20241127081155_UpdateItemModel")]
partial class UpdateItemModel
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("varchar(255)");
b.Property<string>("ProviderKey")
.HasColumnType("varchar(255)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("longtext");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("int");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
b.HasData(
new
{
UserId = 1,
RoleId = 1
});
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("int");
b.Property<string>("LoginProvider")
.HasColumnType("varchar(255)");
b.Property<string>("Name")
.HasColumnType("varchar(255)");
b.Property<string>("Value")
.HasColumnType("longtext");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.CompanyModel", b =>
{
b.Property<int>("CompanyId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("CompanyId"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("CompanyId");
b.ToTable("Companies");
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.DepartmentModel", b =>
{
b.Property<int>("DepartmentId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("DepartmentId"));
b.Property<int>("CompanyId")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("DepartmentId");
b.HasIndex("CompanyId");
b.ToTable("Departments");
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemModel", b =>
{
b.Property<int>("ItemID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ItemID"));
b.Property<int>("CompanyId")
.HasColumnType("int");
b.Property<float>("ConvertPrice")
.HasColumnType("float");
b.Property<string>("Currency")
.IsRequired()
.HasColumnType("longtext");
b.Property<float>("CurrencyRate")
.HasColumnType("float");
b.Property<DateTime>("DODate")
.HasColumnType("datetime(6)");
b.Property<int>("DepartmentId")
.HasColumnType("int");
b.Property<DateTime>("EndWDate")
.HasColumnType("datetime(6)");
b.Property<DateTime>("InvoiceDate")
.HasColumnType("datetime(6)");
b.Property<string>("PONo")
.IsRequired()
.HasColumnType("longtext");
b.Property<float>("PriceInRM")
.HasColumnType("float");
b.Property<int>("ProductId")
.HasColumnType("int");
b.Property<DateTime>("PurchaseDate")
.HasColumnType("datetime(6)");
b.Property<int>("Quantity")
.HasColumnType("int");
b.Property<string>("SerialNumber")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Supplier")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("UniqueID")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Warranty")
.HasColumnType("int");
b.HasKey("ItemID");
b.HasIndex("CompanyId");
b.HasIndex("DepartmentId");
b.HasIndex("ProductId");
b.ToTable("Items");
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ManufacturerModel", b =>
{
b.Property<int>("ManufacturerId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ManufacturerId"));
b.Property<string>("ManufacturerName")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("ManufacturerId");
b.ToTable("Manufacturers");
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", b =>
{
b.Property<int>("ProductId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ProductId"));
b.Property<string>("Category")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("ImageProduct")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ManufacturerId")
.HasColumnType("int");
b.Property<string>("ModelNo")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("ProductName")
.IsRequired()
.HasColumnType("longtext");
b.Property<int?>("QuantityProduct")
.HasColumnType("int");
b.HasKey("ProductId");
b.HasIndex("ManufacturerId");
b.ToTable("Products");
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("SupplierId"));
b.Property<string>("SupplierEmail")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("SupplierGender")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("SupplierName")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("SupplierPhoneNo")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("SupplierId");
b.ToTable("Suppliers");
});
modelBuilder.Entity("PSTW_CentralSystem.Models.ModuleSettingModel", b =>
{
b.Property<int>("SettingId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("SettingId"));
b.Property<string>("AllowedUserType")
.HasColumnType("longtext");
b.Property<string>("Description")
.HasColumnType("longtext");
b.Property<string>("MethodAllowedUserType")
.HasColumnType("json");
b.Property<string>("ModuleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int>("ModuleStatus")
.HasColumnType("int");
b.HasKey("SettingId");
b.ToTable("ModuleSettings");
});
modelBuilder.Entity("PSTW_CentralSystem.Models.RoleModel", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Description")
.HasColumnType("longtext");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
b.HasData(
new
{
Id = 1,
Description = "Can access all pages",
Name = "SuperAdmin",
NormalizedName = "SUPERADMIN"
},
new
{
Id = 2,
Description = "Can access some admin pages",
Name = "SystemAdmin",
NormalizedName = "SYSTEMADMIN"
},
new
{
Id = 3,
Description = "Can access operation pages",
Name = "Engineer",
NormalizedName = "ENGINEER"
},
new
{
Id = 4,
Description = "Can access data viewer pages",
Name = "Observer",
NormalizedName = "OBSERVER"
});
});
modelBuilder.Entity("PSTW_CentralSystem.Models.UserModel", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("tinyint(1)");
b.Property<string>("FullName")
.HasColumnType("longtext");
b.Property<bool>("LockoutEnabled")
.HasColumnType("tinyint(1)");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetime(6)");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("longtext");
b.Property<string>("PhoneNumber")
.HasColumnType("longtext");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("tinyint(1)");
b.Property<string>("SecurityStamp")
.HasColumnType("longtext");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("tinyint(1)");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<int?>("UserStatus")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
b.HasData(
new
{
Id = 1,
AccessFailedCount = 0,
ConcurrencyStamp = "a04422b5-87e6-445c-9640-91f82b7ab925",
Email = "admin@pstw.com.my",
EmailConfirmed = true,
FullName = "MAAdmin",
LockoutEnabled = false,
NormalizedEmail = "ADMIN@PSTW.COM.MY",
NormalizedUserName = "ADMIN@PSTW.COM.MY",
PasswordHash = "AQAAAAIAAYagAAAAECKZDbSSf9PVXnc5gc11ayb/qGSLIVi595BpbLpr4GeEDCONiPEEGeKOF7Hmt2evRA==",
PhoneNumberConfirmed = false,
SecurityStamp = "a9620efc-3783-46d6-a769-9fa7b0cca19b",
TwoFactorEnabled = false,
UserName = "admin@pstw.com.my"
},
new
{
Id = 2,
AccessFailedCount = 0,
ConcurrencyStamp = "608f450b-bfc3-4e15-a815-c9f25e0b92f4",
Email = "sysadmin@pstw.com.my",
EmailConfirmed = true,
FullName = "SysAdmin",
LockoutEnabled = false,
NormalizedEmail = "SYSADMIN@PSTW.COM.MY",
NormalizedUserName = "SYSADMIN@PSTW.COM.MY",
PasswordHash = "AQAAAAIAAYagAAAAED3P9MR4LRFRqUDqLBBwF3lpXLNrOzcoEkMjr2SJSU2u2z0mvwXXGtZO3wPy8PcwQQ==",
PhoneNumberConfirmed = false,
SecurityStamp = "0282ae31-790c-403a-8f42-3596b2d1e454",
TwoFactorEnabled = false,
UserName = "sysadmin@pstw.com.my"
});
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.HasOne("PSTW_CentralSystem.Models.RoleModel", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.HasOne("PSTW_CentralSystem.Models.UserModel", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.HasOne("PSTW_CentralSystem.Models.UserModel", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.HasOne("PSTW_CentralSystem.Models.RoleModel", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PSTW_CentralSystem.Models.UserModel", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.HasOne("PSTW_CentralSystem.Models.UserModel", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.DepartmentModel", b =>
{
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.CompanyModel", "Company")
.WithMany("Departments")
.HasForeignKey("CompanyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Company");
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemModel", b =>
{
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.CompanyModel", "Company")
.WithMany()
.HasForeignKey("CompanyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.DepartmentModel", "Department")
.WithMany()
.HasForeignKey("DepartmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", "Product")
.WithMany("Items")
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Company");
b.Navigation("Department");
b.Navigation("Product");
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", b =>
{
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.ManufacturerModel", "Manufacturer")
.WithMany()
.HasForeignKey("ManufacturerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Manufacturer");
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.CompanyModel", b =>
{
b.Navigation("Departments");
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", b =>
{
b.Navigation("Items");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,96 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PSTW_CentralSystem.Migrations
{
/// <inheritdoc />
public partial class UpdateItemModel : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "QuantityProduct",
table: "Products",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "ItemID",
table: "Items",
type: "int",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(255)")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "UniqueID",
table: "Items",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "AspNetUsers",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" },
values: new object[] { "a04422b5-87e6-445c-9640-91f82b7ab925", "AQAAAAIAAYagAAAAECKZDbSSf9PVXnc5gc11ayb/qGSLIVi595BpbLpr4GeEDCONiPEEGeKOF7Hmt2evRA==", "a9620efc-3783-46d6-a769-9fa7b0cca19b" });
migrationBuilder.UpdateData(
table: "AspNetUsers",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" },
values: new object[] { "608f450b-bfc3-4e15-a815-c9f25e0b92f4", "AQAAAAIAAYagAAAAED3P9MR4LRFRqUDqLBBwF3lpXLNrOzcoEkMjr2SJSU2u2z0mvwXXGtZO3wPy8PcwQQ==", "0282ae31-790c-403a-8f42-3596b2d1e454" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UniqueID",
table: "Items");
migrationBuilder.AlterColumn<int>(
name: "QuantityProduct",
table: "Products",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ItemID",
table: "Items",
type: "varchar(255)",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.UpdateData(
table: "AspNetUsers",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" },
values: new object[] { "dde44c98-793e-452c-8123-5252dc03d655", "AQAAAAIAAYagAAAAEF/vIsmJIWgsCX1cyJiM/miWN66l6UKVbXIY07eBwo/kOy6xL5olLByKrgW7MdbadQ==", "1e63fa4d-6a8a-4738-9036-7b51d02e1eaf" });
migrationBuilder.UpdateData(
table: "AspNetUsers",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" },
values: new object[] { "b529f4f9-3426-4a74-b048-d8995fe3e647", "AQAAAAIAAYagAAAAEIEYpwwMbS9j2l6V3fpUQONaKxCMJN3pV8rVeN3eo0iva0Bu9Jj1NIdkS4GnzvpDVw==", "065ee938-093c-4816-ad28-f2e0831a7550" });
}
}
}

View File

@ -173,8 +173,11 @@ namespace PSTW_CentralSystem.Migrations
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemModel", b => modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ItemModel", b =>
{ {
b.Property<string>("ItemID") b.Property<int>("ItemID")
.HasColumnType("varchar(255)"); .ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ItemID"));
b.Property<int>("CompanyId") b.Property<int>("CompanyId")
.HasColumnType("int"); .HasColumnType("int");
@ -225,6 +228,10 @@ namespace PSTW_CentralSystem.Migrations
.IsRequired() .IsRequired()
.HasColumnType("longtext"); .HasColumnType("longtext");
b.Property<string>("UniqueID")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Warranty") b.Property<int>("Warranty")
.HasColumnType("int"); .HasColumnType("int");
@ -283,7 +290,7 @@ namespace PSTW_CentralSystem.Migrations
.IsRequired() .IsRequired()
.HasColumnType("longtext"); .HasColumnType("longtext");
b.Property<int>("QuantityProduct") b.Property<int?>("QuantityProduct")
.HasColumnType("int"); .HasColumnType("int");
b.HasKey("ProductId"); b.HasKey("ProductId");
@ -491,16 +498,16 @@ namespace PSTW_CentralSystem.Migrations
{ {
Id = 1, Id = 1,
AccessFailedCount = 0, AccessFailedCount = 0,
ConcurrencyStamp = "dde44c98-793e-452c-8123-5252dc03d655", ConcurrencyStamp = "a04422b5-87e6-445c-9640-91f82b7ab925",
Email = "admin@pstw.com.my", Email = "admin@pstw.com.my",
EmailConfirmed = true, EmailConfirmed = true,
FullName = "MAAdmin", FullName = "MAAdmin",
LockoutEnabled = false, LockoutEnabled = false,
NormalizedEmail = "ADMIN@PSTW.COM.MY", NormalizedEmail = "ADMIN@PSTW.COM.MY",
NormalizedUserName = "ADMIN@PSTW.COM.MY", NormalizedUserName = "ADMIN@PSTW.COM.MY",
PasswordHash = "AQAAAAIAAYagAAAAEF/vIsmJIWgsCX1cyJiM/miWN66l6UKVbXIY07eBwo/kOy6xL5olLByKrgW7MdbadQ==", PasswordHash = "AQAAAAIAAYagAAAAECKZDbSSf9PVXnc5gc11ayb/qGSLIVi595BpbLpr4GeEDCONiPEEGeKOF7Hmt2evRA==",
PhoneNumberConfirmed = false, PhoneNumberConfirmed = false,
SecurityStamp = "1e63fa4d-6a8a-4738-9036-7b51d02e1eaf", SecurityStamp = "a9620efc-3783-46d6-a769-9fa7b0cca19b",
TwoFactorEnabled = false, TwoFactorEnabled = false,
UserName = "admin@pstw.com.my" UserName = "admin@pstw.com.my"
}, },
@ -508,16 +515,16 @@ namespace PSTW_CentralSystem.Migrations
{ {
Id = 2, Id = 2,
AccessFailedCount = 0, AccessFailedCount = 0,
ConcurrencyStamp = "b529f4f9-3426-4a74-b048-d8995fe3e647", ConcurrencyStamp = "608f450b-bfc3-4e15-a815-c9f25e0b92f4",
Email = "sysadmin@pstw.com.my", Email = "sysadmin@pstw.com.my",
EmailConfirmed = true, EmailConfirmed = true,
FullName = "SysAdmin", FullName = "SysAdmin",
LockoutEnabled = false, LockoutEnabled = false,
NormalizedEmail = "SYSADMIN@PSTW.COM.MY", NormalizedEmail = "SYSADMIN@PSTW.COM.MY",
NormalizedUserName = "SYSADMIN@PSTW.COM.MY", NormalizedUserName = "SYSADMIN@PSTW.COM.MY",
PasswordHash = "AQAAAAIAAYagAAAAEIEYpwwMbS9j2l6V3fpUQONaKxCMJN3pV8rVeN3eo0iva0Bu9Jj1NIdkS4GnzvpDVw==", PasswordHash = "AQAAAAIAAYagAAAAED3P9MR4LRFRqUDqLBBwF3lpXLNrOzcoEkMjr2SJSU2u2z0mvwXXGtZO3wPy8PcwQQ==",
PhoneNumberConfirmed = false, PhoneNumberConfirmed = false,
SecurityStamp = "065ee938-093c-4816-ad28-f2e0831a7550", SecurityStamp = "0282ae31-790c-403a-8f42-3596b2d1e454",
TwoFactorEnabled = false, TwoFactorEnabled = false,
UserName = "sysadmin@pstw.com.my" UserName = "sysadmin@pstw.com.my"
}); });
@ -577,7 +584,7 @@ namespace PSTW_CentralSystem.Migrations
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.DepartmentModel", b => modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.DepartmentModel", b =>
{ {
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.CompanyModel", "Company") b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.CompanyModel", "Company")
.WithMany() .WithMany("Departments")
.HasForeignKey("CompanyId") .HasForeignKey("CompanyId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
@ -600,7 +607,7 @@ namespace PSTW_CentralSystem.Migrations
.IsRequired(); .IsRequired();
b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", "Product") b.HasOne("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", "Product")
.WithMany() .WithMany("Items")
.HasForeignKey("ProductId") .HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
@ -622,6 +629,16 @@ namespace PSTW_CentralSystem.Migrations
b.Navigation("Manufacturer"); b.Navigation("Manufacturer");
}); });
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.CompanyModel", b =>
{
b.Navigation("Departments");
});
modelBuilder.Entity("PSTW_CentralSystem.Areas.Inventory.Models.ProductModel", b =>
{
b.Navigation("Items");
});
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }
} }