diff --git a/MagMan.Data/DbModels/ItemModel.cs b/MagMan.Data/DbModels/ItemModel.cs
new file mode 100644
index 0000000..6c309c9
--- /dev/null
+++ b/MagMan.Data/DbModels/ItemModel.cs
@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MagMan.Data.DbModels
+{
+ //
+ // This is here so CodeMaid doesn't reorganize this document
+ //
+ //[Index(nameof(Installazione), nameof(Active), nameof(DiskStatus))]
+ [Table("ItemsList")]
+ public partial class ItemModel
+ {
+ ///
+ /// Primary Key AUTO
+ ///
+ [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int ItemID { get; set; }
+
+ ///
+ /// Ext ref for Material
+ ///
+ public int MatID { get; set; } = 0;
+
+ ///
+ /// Check if is a Remnant
+ ///
+ public bool IsRemn { get; set; } = false;
+
+ ///
+ /// Location
+ ///
+ public string Location { get; set; } = "";
+ ///
+ /// Qty available on wharehouse
+ ///
+ public int QtyAvail { get; set; } = 0;
+
+ ///
+ /// DateTime last modification
+ ///
+ public DateTime DtMod { get; set; } = DateTime.Now.AddYears(10);
+
+ ///
+ /// Item's Lenght
+ ///
+ public decimal LMm { get; set; } = 0;
+
+ ///
+ /// Item's Width
+ ///
+ public decimal WMm { get; set; } = 0;
+
+ ///
+ /// Item's Thikness
+ ///
+ public decimal TMm { get; set; } = 0;
+
+ [NotMapped]
+ public decimal LIn
+ {
+ get => Math.Round(LMm / (decimal)25.4, 3);
+ }
+ [NotMapped]
+ public decimal WIn
+ {
+ get => Math.Round(WMm / (decimal)25.4, 3);
+ }
+ [NotMapped]
+ public decimal TIn
+ {
+ get => Math.Round(TMm / (decimal)25.4, 3);
+ }
+
+
+ ///
+ /// Note (optional)
+ ///
+ public string Note { get; set; } = "";
+
+ [NotMapped]
+ public decimal Area
+ {
+ get => LMm * WMm;
+ }
+
+
+ [NotMapped]
+ public string ItemDtmx
+ {
+ get
+ {
+ string answ = $"MT99999999-{LMm * 1000:00000000}";
+ if (MaterialNav != null)
+ {
+ answ = $"MT{MaterialNav.MatExtCode:00000000}-{LMm * 1000:00000000}";
+ }
+ return answ;
+ }
+ }
+
+ ///
+ /// Navigation property to Material
+ ///
+ [ForeignKey("MatID")]
+ public virtual MaterialModel MaterialNav { get; set; } = null!;
+
+ }
+}
diff --git a/MagMan.Data/DbModels/MaterialModel.cs b/MagMan.Data/DbModels/MaterialModel.cs
new file mode 100644
index 0000000..5a4196d
--- /dev/null
+++ b/MagMan.Data/DbModels/MaterialModel.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MagMan.Data.DbModels
+{
+ //
+ // This is here so CodeMaid doesn't reorganize this document
+ //
+ [Table("Materials")]
+ public partial class MaterialModel
+ {
+ [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int MatID { get; set; }
+
+ public int MatExtCode { get; set; } = 0;
+ public string MatDesc { get; set; } = "";
+ public DateTime ApprovDate { get; set; } = DateTime.Now.AddYears(10);
+ public string ApprovUser { get; set; } = "";
+ public decimal LMm { get; set; } = 0;
+ public decimal WMm { get; set; } = 0;
+ public decimal TMm { get; set; } = 0;
+
+ [NotMapped]
+ public string MatDtmx
+ {
+ get => $"MT{MatExtCode:00000000}";
+ }
+
+
+ public virtual ICollection? ItemNav { get; set; }
+ }
+}
diff --git a/MagMan.Data/DbModels/MovMagModel.cs b/MagMan.Data/DbModels/MovMagModel.cs
new file mode 100644
index 0000000..432f8bf
--- /dev/null
+++ b/MagMan.Data/DbModels/MovMagModel.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MagMan.Data.DbModels
+{
+ //
+ // This is here so CodeMaid doesn't reorganize this document
+ //
+ //[Index(nameof(Installazione), nameof(Active), nameof(DiskStatus))]
+ [Table("MovMag")]
+ public partial class MovMagModel
+ {
+ ///
+ /// Primary Key AUTO
+ ///
+ [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int MovID { get; set; }
+
+ ///
+ /// DateTime record
+ ///
+ public DateTime DtRec { get; set; } = DateTime.Now;
+
+ ///
+ /// Ext ref for Items
+ ///
+ public int ItemID { get; set; }
+
+ ///
+ /// Qty recorded (delta +/-)
+ ///
+ public int QtyRec { get; set; } = 0;
+
+ ///
+ /// User modificatore
+ ///
+ public string UserId { get; set; } = "";
+
+ ///
+ /// Navigation property to Items
+ ///
+ [ForeignKey("ItemID")]
+ public virtual ItemModel? ITemNav { get; set; }
+
+ }
+}
diff --git a/MagMan.Data/DbModels/PrintJobQueueModel.cs b/MagMan.Data/DbModels/PrintJobQueueModel.cs
new file mode 100644
index 0000000..0a9fa0a
--- /dev/null
+++ b/MagMan.Data/DbModels/PrintJobQueueModel.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MagMan.Data.DbModels
+{
+ //
+ // This is here so CodeMaid doesn't reorganize this document
+ //
+ [Table("PrintJobQueue")]
+ public partial class PrintJobQueueModel
+ {
+ [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int IdxPrintJob { get; set; }
+ public string TipoReport { get; set; } = null!;
+ public string KeyParam { get; set; } = null!;
+ public string PrtName { get; set; } = null!;
+ public DateTime DtStart { get; set; }
+ public DateTime? DtEnd { get; set; }
+ public int Stato { get; set; }
+ public DateTime? DtLastTry { get; set; }
+ }
+}
diff --git a/MagMan.Data/MagManContext.cs b/MagMan.Data/MagManContext.cs
index 4a596b4..57b22d3 100644
--- a/MagMan.Data/MagManContext.cs
+++ b/MagMan.Data/MagManContext.cs
@@ -48,18 +48,15 @@ namespace MagMan.Data
#endregion Public Constructors
#region Public Properties
-
-#if false
- public virtual DbSet DbRebootLog { get; set; }
-
- public virtual DbSet DbSetAlarmLog { get; set; }
-#endif
-
public virtual DbSet DbSetConfig { get; set; }
-#if false
public virtual DbSet DbSetItems { get; set; }
+ public virtual DbSet DbSetMaterials { get; set; }
+ public virtual DbSet DbSetMovMag { get; set; }
+ public virtual DbSet DbSetPrintJob { get; set; }
+
+#if false
public virtual DbSet DbSetKeyVal { get; set; }
public virtual DbSet DbSetListVal { get; set; }
@@ -101,7 +98,7 @@ namespace MagMan.Data
if (!optionsBuilder.IsConfigured)
{
//connString = _configuration.GetConnectionString("MagMan.Data");
- connString = "Server=localhost;port=3306;database=MagMan_Dev;user=root;pwd=MagMan_pwd;sslmode=None;";
+ connString = "Server=localhost;port=3306;database=MagMan_Dev;user=MagMan;pwd=MagMan_secret_pwd;sslmode=None;";
var serverVersion = ServerVersion.AutoDetect(connString);
optionsBuilder.UseMySql(connString, serverVersion);
}
diff --git a/MagMan.Data/Migrations/20231222180319_AddMagBaseObj.Designer.cs b/MagMan.Data/Migrations/20231222180319_AddMagBaseObj.Designer.cs
new file mode 100644
index 0000000..9c79e5b
--- /dev/null
+++ b/MagMan.Data/Migrations/20231222180319_AddMagBaseObj.Designer.cs
@@ -0,0 +1,149 @@
+//
+using System;
+using MagMan.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace MagMan.Data.Migrations
+{
+ [DbContext(typeof(MagManContext))]
+ [Migration("20231222180319_AddMagBaseObj")]
+ partial class AddMagBaseObj
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "6.0.25")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("MagMan.Data.DbModels.ConfigModel", b =>
+ {
+ b.Property("KeyName")
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasColumnOrder(0);
+
+ b.Property("Note")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("varchar(250)")
+ .HasColumnOrder(3);
+
+ b.Property("Val")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasColumnOrder(1);
+
+ b.Property("ValStd")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasColumnOrder(2)
+ .HasComment("Valore di default/riferimento per la variabile");
+
+ b.HasKey("KeyName");
+
+ b.ToTable("Config");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.ItemModel", b =>
+ {
+ b.Property("ItemID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ b.Property("DtMod")
+ .HasColumnType("datetime(6)");
+
+ b.Property("IsRemn")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("Location")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("MatID")
+ .HasColumnType("int");
+
+ b.Property("Note")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("QtyAvail")
+ .HasColumnType("int");
+
+ b.Property("TMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("WMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.HasKey("ItemID");
+
+ b.HasIndex("MatID");
+
+ b.ToTable("ItemsList");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.MaterialModel", b =>
+ {
+ b.Property("MatID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ b.Property("ApprovDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ApprovUser")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("MatDesc")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("MatExtCode")
+ .HasColumnType("int");
+
+ b.Property("TMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("WMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.HasKey("MatID");
+
+ b.ToTable("Materials");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.ItemModel", b =>
+ {
+ b.HasOne("MagMan.Data.DbModels.MaterialModel", "MaterialNav")
+ .WithMany("ItemNav")
+ .HasForeignKey("MatID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("MaterialNav");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.MaterialModel", b =>
+ {
+ b.Navigation("ItemNav");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/MagMan.Data/Migrations/20231222180319_AddMagBaseObj.cs b/MagMan.Data/Migrations/20231222180319_AddMagBaseObj.cs
new file mode 100644
index 0000000..18a7385
--- /dev/null
+++ b/MagMan.Data/Migrations/20231222180319_AddMagBaseObj.cs
@@ -0,0 +1,80 @@
+using System;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MagMan.Data.Migrations
+{
+ public partial class AddMagBaseObj : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "Materials",
+ columns: table => new
+ {
+ MatID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ MatExtCode = table.Column(type: "int", nullable: false),
+ MatDesc = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ApprovDate = table.Column(type: "datetime(6)", nullable: false),
+ ApprovUser = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ LMm = table.Column(type: "decimal(65,30)", nullable: false),
+ WMm = table.Column(type: "decimal(65,30)", nullable: false),
+ TMm = table.Column(type: "decimal(65,30)", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Materials", x => x.MatID);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "ItemsList",
+ columns: table => new
+ {
+ ItemID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ MatID = table.Column(type: "int", nullable: false),
+ IsRemn = table.Column(type: "tinyint(1)", nullable: false),
+ Location = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ QtyAvail = table.Column(type: "int", nullable: false),
+ DtMod = table.Column(type: "datetime(6)", nullable: false),
+ LMm = table.Column(type: "decimal(65,30)", nullable: false),
+ WMm = table.Column(type: "decimal(65,30)", nullable: false),
+ TMm = table.Column(type: "decimal(65,30)", nullable: false),
+ Note = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ItemsList", x => x.ItemID);
+ table.ForeignKey(
+ name: "FK_ItemsList_Materials_MatID",
+ column: x => x.MatID,
+ principalTable: "Materials",
+ principalColumn: "MatID",
+ onDelete: ReferentialAction.Restrict);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_ItemsList_MatID",
+ table: "ItemsList",
+ column: "MatID");
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "ItemsList");
+
+ migrationBuilder.DropTable(
+ name: "Materials");
+ }
+ }
+}
diff --git a/MagMan.Data/Migrations/20231222180523_AddMagBaseObj01.Designer.cs b/MagMan.Data/Migrations/20231222180523_AddMagBaseObj01.Designer.cs
new file mode 100644
index 0000000..3f644e4
--- /dev/null
+++ b/MagMan.Data/Migrations/20231222180523_AddMagBaseObj01.Designer.cs
@@ -0,0 +1,221 @@
+//
+using System;
+using MagMan.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace MagMan.Data.Migrations
+{
+ [DbContext(typeof(MagManContext))]
+ [Migration("20231222180523_AddMagBaseObj01")]
+ partial class AddMagBaseObj01
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "6.0.25")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("MagMan.Data.DbModels.ConfigModel", b =>
+ {
+ b.Property("KeyName")
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasColumnOrder(0);
+
+ b.Property("Note")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("varchar(250)")
+ .HasColumnOrder(3);
+
+ b.Property("Val")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasColumnOrder(1);
+
+ b.Property("ValStd")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasColumnOrder(2)
+ .HasComment("Valore di default/riferimento per la variabile");
+
+ b.HasKey("KeyName");
+
+ b.ToTable("Config");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.ItemModel", b =>
+ {
+ b.Property("ItemID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ b.Property("DtMod")
+ .HasColumnType("datetime(6)");
+
+ b.Property("IsRemn")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("Location")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("MatID")
+ .HasColumnType("int");
+
+ b.Property("Note")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("QtyAvail")
+ .HasColumnType("int");
+
+ b.Property("TMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("WMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.HasKey("ItemID");
+
+ b.HasIndex("MatID");
+
+ b.ToTable("ItemsList");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.MaterialModel", b =>
+ {
+ b.Property("MatID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ b.Property("ApprovDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ApprovUser")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("MatDesc")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("MatExtCode")
+ .HasColumnType("int");
+
+ b.Property("TMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("WMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.HasKey("MatID");
+
+ b.ToTable("Materials");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.MovMagModel", b =>
+ {
+ b.Property("MovID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ b.Property("DtRec")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ItemID")
+ .HasColumnType("int");
+
+ b.Property("QtyRec")
+ .HasColumnType("int");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("MovID");
+
+ b.HasIndex("ItemID");
+
+ b.ToTable("MovMag");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.PrintJobQueueModel", b =>
+ {
+ b.Property("IdxPrintJob")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ b.Property("DtEnd")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DtLastTry")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DtStart")
+ .HasColumnType("datetime(6)");
+
+ b.Property("KeyParam")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("PrtName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Stato")
+ .HasColumnType("int");
+
+ b.Property("TipoReport")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("IdxPrintJob");
+
+ b.ToTable("PrintJobQueue");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.ItemModel", b =>
+ {
+ b.HasOne("MagMan.Data.DbModels.MaterialModel", "MaterialNav")
+ .WithMany("ItemNav")
+ .HasForeignKey("MatID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("MaterialNav");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.MovMagModel", b =>
+ {
+ b.HasOne("MagMan.Data.DbModels.ItemModel", "ITemNav")
+ .WithMany()
+ .HasForeignKey("ItemID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("ITemNav");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.MaterialModel", b =>
+ {
+ b.Navigation("ItemNav");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/MagMan.Data/Migrations/20231222180523_AddMagBaseObj01.cs b/MagMan.Data/Migrations/20231222180523_AddMagBaseObj01.cs
new file mode 100644
index 0000000..b12d2ff
--- /dev/null
+++ b/MagMan.Data/Migrations/20231222180523_AddMagBaseObj01.cs
@@ -0,0 +1,75 @@
+using System;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MagMan.Data.Migrations
+{
+ public partial class AddMagBaseObj01 : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "MovMag",
+ columns: table => new
+ {
+ MovID = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ DtRec = table.Column(type: "datetime(6)", nullable: false),
+ ItemID = table.Column(type: "int", nullable: false),
+ QtyRec = table.Column(type: "int", nullable: false),
+ UserId = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_MovMag", x => x.MovID);
+ table.ForeignKey(
+ name: "FK_MovMag_ItemsList_ItemID",
+ column: x => x.ItemID,
+ principalTable: "ItemsList",
+ principalColumn: "ItemID",
+ onDelete: ReferentialAction.Restrict);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "PrintJobQueue",
+ columns: table => new
+ {
+ IdxPrintJob = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ TipoReport = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ KeyParam = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ PrtName = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ DtStart = table.Column(type: "datetime(6)", nullable: false),
+ DtEnd = table.Column(type: "datetime(6)", nullable: true),
+ Stato = table.Column(type: "int", nullable: false),
+ DtLastTry = table.Column(type: "datetime(6)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_PrintJobQueue", x => x.IdxPrintJob);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_MovMag_ItemID",
+ table: "MovMag",
+ column: "ItemID");
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "MovMag");
+
+ migrationBuilder.DropTable(
+ name: "PrintJobQueue");
+ }
+ }
+}
diff --git a/MagMan.Data/Migrations/MagManContextModelSnapshot.cs b/MagMan.Data/Migrations/MagManContextModelSnapshot.cs
index 9497f35..6f1c17b 100644
--- a/MagMan.Data/Migrations/MagManContextModelSnapshot.cs
+++ b/MagMan.Data/Migrations/MagManContextModelSnapshot.cs
@@ -1,4 +1,5 @@
//
+using System;
using MagMan.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
@@ -48,6 +49,170 @@ namespace MagMan.Data.Migrations
b.ToTable("Config");
});
+
+ modelBuilder.Entity("MagMan.Data.DbModels.ItemModel", b =>
+ {
+ b.Property("ItemID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ b.Property("DtMod")
+ .HasColumnType("datetime(6)");
+
+ b.Property("IsRemn")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("Location")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("MatID")
+ .HasColumnType("int");
+
+ b.Property("Note")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("QtyAvail")
+ .HasColumnType("int");
+
+ b.Property("TMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("WMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.HasKey("ItemID");
+
+ b.HasIndex("MatID");
+
+ b.ToTable("ItemsList");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.MaterialModel", b =>
+ {
+ b.Property("MatID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ b.Property("ApprovDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ApprovUser")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("MatDesc")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("MatExtCode")
+ .HasColumnType("int");
+
+ b.Property("TMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("WMm")
+ .HasColumnType("decimal(65,30)");
+
+ b.HasKey("MatID");
+
+ b.ToTable("Materials");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.MovMagModel", b =>
+ {
+ b.Property("MovID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ b.Property("DtRec")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ItemID")
+ .HasColumnType("int");
+
+ b.Property("QtyRec")
+ .HasColumnType("int");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("MovID");
+
+ b.HasIndex("ItemID");
+
+ b.ToTable("MovMag");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.PrintJobQueueModel", b =>
+ {
+ b.Property("IdxPrintJob")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ b.Property("DtEnd")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DtLastTry")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DtStart")
+ .HasColumnType("datetime(6)");
+
+ b.Property("KeyParam")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("PrtName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Stato")
+ .HasColumnType("int");
+
+ b.Property("TipoReport")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("IdxPrintJob");
+
+ b.ToTable("PrintJobQueue");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.ItemModel", b =>
+ {
+ b.HasOne("MagMan.Data.DbModels.MaterialModel", "MaterialNav")
+ .WithMany("ItemNav")
+ .HasForeignKey("MatID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("MaterialNav");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.MovMagModel", b =>
+ {
+ b.HasOne("MagMan.Data.DbModels.ItemModel", "ITemNav")
+ .WithMany()
+ .HasForeignKey("ItemID")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("ITemNav");
+ });
+
+ modelBuilder.Entity("MagMan.Data.DbModels.MaterialModel", b =>
+ {
+ b.Navigation("ItemNav");
+ });
#pragma warning restore 612, 618
}
}
diff --git a/MagMan.UI/appsettings.json b/MagMan.UI/appsettings.json
index 239017e..93d26d8 100644
--- a/MagMan.UI/appsettings.json
+++ b/MagMan.UI/appsettings.json
@@ -7,6 +7,29 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
- "UserIdentityDbContextConnection": "Server=(localdb)\\mssqllocaldb;Database=MagMan.UI;Trusted_Connection=True;MultipleActiveResultSets=true"
+ "Redis": "localhost:6379",
+ "UserIdentityDbContextConnection": "Server=localhost;port=3306;database=MagMan_Dev;user=MagMan;pwd=MagMan_secret_pwd;sslmode=None;",
+ "AuthConnection": "Server=localhost;port=3306;database=MagMan_Dev;user=MagMan;pwd=MagMan_secret_pwd;sslmode=None;",
+ "DefaultConnection": "Server=localhost;port=3306;database=MagMan_Dev;user=MagMan;pwd=MagMan_secret_pwd;sslmode=None;",
+ "AdminConnection": "Server=localhost;port=3306;database=MagMan_Dev;user=MagMan;pwd=MagMan_secret_pwd;sslmode=None;",
+ "MagMan.Data": "Server=localhost;port=3306;database=MagMan_Dev;user=MagMan;pwd=MagMan_secret_pwd;sslmode=None;"
+ },
+ "DbConfig": {
+ //"Server": "10.74.83.97",
+ "Server": "localhost",
+ "nKey": "DemoCli01",
+ "sKey": "M3T@n0"
+ },
+ "ExternalProviders": {
+ "MailKit": {
+ "SMTP": {
+ "Address": "smtp-mail.outlook.com",
+ "Port": "587",
+ "Account": "gwms.notify@outlook.com",
+ "Password": "Gwms_2022!",
+ "SenderEmail": "gwms.notify@outlook.com",
+ "SenderName": "GWMS Notification"
+ }
+ }
}
}
\ No newline at end of file