From 0902157a25026fdfd5dd7c54d88904d00a9362dc Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Thu, 16 Mar 2023 17:45:51 +0100 Subject: [PATCH] inizio definizione porte --- WebDoorCreator.Data/ApplicationDbContext.cs | 2 +- .../Controllers/WebDoorCreatorController.cs | 6 +- WebDoorCreator.Data/DbModels/ListValues.cs | 36 ++ .../20230316164310_listValueasAdd.Designer.cs | 446 ++++++++++++++++++ .../WDCData/20230316164310_listValueasAdd.cs | 107 +++++ .../WDCData/WDCDataContextModelSnapshot.cs | 275 ++++++----- WebDoorCreator.Data/WDCDataContext.cs | 6 +- .../Components/DoorPreview.razor | 2 + .../Components/DoorPreview.razor.cs | 24 + .../Components/DoorSizingStep.razor | 60 +++ .../Components/DoorSizingStep.razor.cs | 59 +++ .../Components/OrderDetails.razor | 22 + .../Components/OrderDetails.razor.cs | 26 + WebDoorCreator.UI/Components/OrderList.razor | 22 +- .../Components/OrderList.razor.cs | 51 +- .../Components/SizingDefinition.razor | 1 + .../Components/SizingDefinition.razor.cs | 24 + WebDoorCreator.UI/Components/StepsList.razor | 5 + .../Components/StepsList.razor.cs | 24 + .../Data/WebDoorCreatorService.cs | 17 +- WebDoorCreator.UI/Pages/DoorDefinition.razor | 15 + .../Pages/DoorDefinition.razor.cs | 39 ++ WebDoorCreator.UI/Pages/OrdersHomePage.razor | 34 +- .../Pages/OrdersHomePage.razor.cs | 32 +- 24 files changed, 1150 insertions(+), 185 deletions(-) create mode 100644 WebDoorCreator.Data/DbModels/ListValues.cs create mode 100644 WebDoorCreator.Data/Migrations/WDCData/20230316164310_listValueasAdd.Designer.cs create mode 100644 WebDoorCreator.Data/Migrations/WDCData/20230316164310_listValueasAdd.cs create mode 100644 WebDoorCreator.UI/Components/DoorPreview.razor create mode 100644 WebDoorCreator.UI/Components/DoorPreview.razor.cs create mode 100644 WebDoorCreator.UI/Components/DoorSizingStep.razor create mode 100644 WebDoorCreator.UI/Components/DoorSizingStep.razor.cs create mode 100644 WebDoorCreator.UI/Components/OrderDetails.razor create mode 100644 WebDoorCreator.UI/Components/OrderDetails.razor.cs create mode 100644 WebDoorCreator.UI/Components/SizingDefinition.razor create mode 100644 WebDoorCreator.UI/Components/SizingDefinition.razor.cs create mode 100644 WebDoorCreator.UI/Components/StepsList.razor create mode 100644 WebDoorCreator.UI/Components/StepsList.razor.cs diff --git a/WebDoorCreator.Data/ApplicationDbContext.cs b/WebDoorCreator.Data/ApplicationDbContext.cs index ba67dba..1bfa1ac 100644 --- a/WebDoorCreator.Data/ApplicationDbContext.cs +++ b/WebDoorCreator.Data/ApplicationDbContext.cs @@ -37,7 +37,7 @@ namespace WebDoorCreator.Data //builder.ApplyConfiguration(new RoleConfiguration()); //builder.ApplyConfiguration(new UserConfiguration()); - builder.ApplyConfiguration(new UserRolesConfiguration()); + //builder.ApplyConfiguration(new UserRolesConfiguration()); } } diff --git a/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs b/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs index e0a1179..e014318 100644 --- a/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs +++ b/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs @@ -346,19 +346,21 @@ namespace WebDoorCreator.Data.Controllers } catch (Exception exc) { - Log.Error($"Error in DoorsGetAll:{Environment.NewLine}{exc}"); + Log.Error($"Error in DoorsGetByOrderId:{Environment.NewLine}{exc}"); } } return dbResult; } + /// /// Modifying or adding a new door /// /// Record to edit or add /// - public async Task DoorsAddMod(DoorModel addEditRec) + public async Task DoorUpsert(DoorModel addEditRec) { + /* crea nuovo metodo per modifica singola quantità porta: DOORMODQTY */ bool fatto = false; //List dbResult = new List(); using (WDCDataContext localDbCtx = new WDCDataContext(_configuration)) diff --git a/WebDoorCreator.Data/DbModels/ListValues.cs b/WebDoorCreator.Data/DbModels/ListValues.cs new file mode 100644 index 0000000..f8d6727 --- /dev/null +++ b/WebDoorCreator.Data/DbModels/ListValues.cs @@ -0,0 +1,36 @@ +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 WebDoorCreator.Data.DbModels +{ +#nullable disable + // + // This is here so CodeMaid doesn't reorganize this document + // + [Table("ListValues")] + public partial class ListValues + { + #region Public Properties + + [MaxLength(50)] + public string TableName { get; set; } + + [MaxLength(50)] + public string FieldName { get; set; } + + [MaxLength(50)] + public string value { get; set; } + + [MaxLength(50)] + public string label { get; set; } + + public int ordinal { get; set; } + + #endregion Public Properties + } +} diff --git a/WebDoorCreator.Data/Migrations/WDCData/20230316164310_listValueasAdd.Designer.cs b/WebDoorCreator.Data/Migrations/WDCData/20230316164310_listValueasAdd.Designer.cs new file mode 100644 index 0000000..093faf9 --- /dev/null +++ b/WebDoorCreator.Data/Migrations/WDCData/20230316164310_listValueasAdd.Designer.cs @@ -0,0 +1,446 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using WebDoorCreator.Data; + +#nullable disable + +namespace WebDoorCreator.Data.Migrations.WDCData +{ + [DbContext(typeof(WDCDataContext))] + [Migration("20230316164310_listValueasAdd")] + partial class listValueasAdd + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseCollation("Latin1_General_CI_AS") + .HasAnnotation("ProductVersion", "6.0.14") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetRoles", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("AspNetRoles", null, t => t.ExcludeFromMigrations()); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", null, t => t.ExcludeFromMigrations()); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUsers", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("AspNetUsers", null, t => t.ExcludeFromMigrations()); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.CompanyModel", b => + { + b.Property("CompanyId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CompanyId"), 1L, 1); + + b.Property("Address") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("City") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CompanyExtCode") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("CompanyName") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("CompanyToken") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("PrivateNote") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("State") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("VAT") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ZipCode") + .HasColumnType("int"); + + b.HasKey("CompanyId"); + + b.ToTable("Company"); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b => + { + b.Property("DoorId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("DoorId"), 1L, 1); + + b.Property("DateIns") + .HasColumnType("datetime2"); + + b.Property("DateMod") + .HasColumnType("datetime2"); + + b.Property("DoorDescript") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DoorExtCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("TypeId") + .HasColumnType("int"); + + b.Property("UnitCost") + .HasColumnType("decimal(18,2)"); + + b.Property("UserIdIns") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserIdMod") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("DoorId"); + + b.HasIndex("OrderId"); + + b.HasIndex("TypeId"); + + b.ToTable("Door"); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorTypeModel", b => + { + b.Property("TypeId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("TypeId"), 1L, 1); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TypeCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("TypeId"); + + b.ToTable("DoorType"); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.ListValues", b => + { + b.Property("TableName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("FieldName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("label") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ordinal") + .HasColumnType("int"); + + b.Property("value") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("TableName", "FieldName"); + + b.ToTable("ListValues"); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderModel", b => + { + b.Property("OrderId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("OrderId"), 1L, 1); + + b.Property("CompanyId") + .HasColumnType("int"); + + b.Property("DateIns") + .HasColumnType("datetime2"); + + b.Property("DateMod") + .HasColumnType("datetime2"); + + b.Property("OrderDescript") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrderExtCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UserIdIns") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserIdMod") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("OrderId"); + + b.HasIndex("CompanyId"); + + b.ToTable("Order"); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderStatusViewModel", b => + { + b.Property("OrderId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("OrderId"), 1L, 1); + + b.Property("CompanyId") + .HasColumnType("int"); + + b.Property("DateIns") + .HasColumnType("datetime2"); + + b.Property("NumDoors") + .HasColumnType("int"); + + b.Property("NumType") + .HasColumnType("int"); + + b.Property("OrderDescript") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrderExtCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("TotCost") + .HasColumnType("decimal(18,2)"); + + b.Property("UserIdIns") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserIdMod") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("OrderId"); + + b.ToTable("v_OrderStatus"); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.UsersViewModel", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "RoleId"); + + b.ToTable("v_UserRolesClaims"); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b => + { + b.HasOne("WebDoorCreator.Data.DbModels.AspNetRoles", "RolesNav") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WebDoorCreator.Data.DbModels.AspNetUsers", "UsersNav") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RolesNav"); + + b.Navigation("UsersNav"); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b => + { + b.HasOne("WebDoorCreator.Data.DbModels.OrderModel", "OrderNav") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WebDoorCreator.Data.DbModels.DoorTypeModel", "TypeNav") + .WithMany() + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OrderNav"); + + b.Navigation("TypeNav"); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderModel", b => + { + b.HasOne("WebDoorCreator.Data.DbModels.CompanyModel", "CompanyNav") + .WithMany() + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CompanyNav"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/WebDoorCreator.Data/Migrations/WDCData/20230316164310_listValueasAdd.cs b/WebDoorCreator.Data/Migrations/WDCData/20230316164310_listValueasAdd.cs new file mode 100644 index 0000000..b42f94c --- /dev/null +++ b/WebDoorCreator.Data/Migrations/WDCData/20230316164310_listValueasAdd.cs @@ -0,0 +1,107 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace WebDoorCreator.Data.Migrations.WDCData +{ + public partial class listValueasAdd : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "IdentityRole"); + + migrationBuilder.CreateTable( + name: "ListValues", + columns: table => new + { + TableName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + FieldName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + value = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + label = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ordinal = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ListValues", x => new { x.TableName, x.FieldName }); + }); + + migrationBuilder.CreateTable( + name: "v_OrderStatus", + columns: table => new + { + OrderId = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CompanyId = table.Column(type: "int", nullable: false), + OrderExtCode = table.Column(type: "nvarchar(max)", nullable: false), + DateIns = table.Column(type: "datetime2", nullable: false), + UserIdIns = table.Column(type: "nvarchar(max)", nullable: false), + UserIdMod = table.Column(type: "nvarchar(max)", nullable: false), + OrderStatus = table.Column(type: "int", nullable: false), + OrderDescript = table.Column(type: "nvarchar(max)", nullable: false), + NumType = table.Column(type: "int", nullable: false), + NumDoors = table.Column(type: "int", nullable: false), + TotCost = table.Column(type: "decimal(18,2)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_v_OrderStatus", x => x.OrderId); + }); + + migrationBuilder.CreateTable( + name: "v_UserRolesClaims", + columns: table => new + { + UserId = table.Column(type: "nvarchar(450)", nullable: false), + RoleId = table.Column(type: "nvarchar(450)", nullable: false), + UserName = table.Column(type: "nvarchar(max)", nullable: false), + Email = table.Column(type: "nvarchar(max)", nullable: false), + RoleName = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_v_UserRolesClaims", x => new { x.UserId, x.RoleId }); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "ListValues"); + + migrationBuilder.DropTable( + name: "v_OrderStatus"); + + migrationBuilder.DropTable( + name: "v_UserRolesClaims"); + + migrationBuilder.CreateTable( + name: "IdentityRole", + columns: table => new + { + Id = table.Column(type: "nvarchar(450)", nullable: false), + ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true), + Name = table.Column(type: "nvarchar(max)", nullable: true), + NormalizedName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityRole", x => x.Id); + }); + + migrationBuilder.InsertData( + table: "IdentityRole", + columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" }, + values: new object[,] + { + { "087539dd-8021-4d50-8afd-beb97aa883d3", "9bef9247-c370-4321-b1ea-3dd634aad734", "Undef", "UNDEF" }, + { "246c1608-059d-4f2b-98b2-f57ab47de3b7", "1b81eff5-4ff6-4756-9bb5-983869fd4b41", "CompAdmin", "COMPADMIN" }, + { "695e212d-f79c-45dd-931d-6390c4533c6e", "a4788fda-3f24-41dc-b492-a621de69f031", "SuperAdmin", "SUPERADMIN" }, + { "805c6051-0372-4e2b-9b94-f5c8881ef7cb", "a73832bd-be3e-4a48-8b0a-475c8930b4c5", "CompUser", "COMPUSER" }, + { "851dd9d6-570c-48b0-ac48-e494c5fac5d7", "13d724e3-b415-4719-8387-e21952306ce3", "Admin", "ADMIN" }, + { "d0cafb49-7d19-4d4f-a280-6837e5842e8b", "7f94eb48-1f91-4e88-bae6-bb655dba168b", "User", "USER" } + }); + } + } +} diff --git a/WebDoorCreator.Data/Migrations/WDCData/WDCDataContextModelSnapshot.cs b/WebDoorCreator.Data/Migrations/WDCData/WDCDataContextModelSnapshot.cs index cbbc929..c1c03a5 100644 --- a/WebDoorCreator.Data/Migrations/WDCData/WDCDataContextModelSnapshot.cs +++ b/WebDoorCreator.Data/Migrations/WDCData/WDCDataContextModelSnapshot.cs @@ -23,67 +23,102 @@ namespace WebDoorCreator.Data.Migrations.WDCData SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetRoles", b => { b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("nvarchar(450)"); b.Property("ConcurrencyStamp") + .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("Name") + .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("NormalizedName") + .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); - b.ToTable("IdentityRole", (string)null); + b.ToTable("AspNetRoles", null, t => t.ExcludeFromMigrations()); + }); - b.HasData( - new - { - Id = "087539dd-8021-4d50-8afd-beb97aa883d3", - ConcurrencyStamp = "9bef9247-c370-4321-b1ea-3dd634aad734", - Name = "Undef", - NormalizedName = "UNDEF" - }, - new - { - Id = "695e212d-f79c-45dd-931d-6390c4533c6e", - ConcurrencyStamp = "a4788fda-3f24-41dc-b492-a621de69f031", - Name = "SuperAdmin", - NormalizedName = "SUPERADMIN" - }, - new - { - Id = "851dd9d6-570c-48b0-ac48-e494c5fac5d7", - ConcurrencyStamp = "13d724e3-b415-4719-8387-e21952306ce3", - Name = "Admin", - NormalizedName = "ADMIN" - }, - new - { - Id = "246c1608-059d-4f2b-98b2-f57ab47de3b7", - ConcurrencyStamp = "1b81eff5-4ff6-4756-9bb5-983869fd4b41", - Name = "CompAdmin", - NormalizedName = "COMPADMIN" - }, - new - { - Id = "805c6051-0372-4e2b-9b94-f5c8881ef7cb", - ConcurrencyStamp = "a73832bd-be3e-4a48-8b0a-475c8930b4c5", - Name = "CompUser", - NormalizedName = "COMPUSER" - }, - new - { - Id = "d0cafb49-7d19-4d4f-a280-6837e5842e8b", - ConcurrencyStamp = "7f94eb48-1f91-4e88-bae6-bb655dba168b", - Name = "User", - NormalizedName = "USER" - }); + modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", null, t => t.ExcludeFromMigrations()); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUsers", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("AspNetUsers", null, t => t.ExcludeFromMigrations()); }); modelBuilder.Entity("WebDoorCreator.Data.DbModels.CompanyModel", b => @@ -139,7 +174,7 @@ namespace WebDoorCreator.Data.Migrations.WDCData b.HasKey("CompanyId"); - b.ToTable("Company", (string)null); + b.ToTable("Company"); }); modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b => @@ -190,7 +225,7 @@ namespace WebDoorCreator.Data.Migrations.WDCData b.HasIndex("TypeId"); - b.ToTable("Door", (string)null); + b.ToTable("Door"); }); modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorTypeModel", b => @@ -211,7 +246,33 @@ namespace WebDoorCreator.Data.Migrations.WDCData b.HasKey("TypeId"); - b.ToTable("DoorType", (string)null); + b.ToTable("DoorType"); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.ListValues", b => + { + b.Property("TableName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("FieldName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("label") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ordinal") + .HasColumnType("int"); + + b.Property("value") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("TableName", "FieldName"); + + b.ToTable("ListValues"); }); modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderModel", b => @@ -254,33 +315,57 @@ namespace WebDoorCreator.Data.Migrations.WDCData b.HasIndex("CompanyId"); - b.ToTable("Order", (string)null); + b.ToTable("Order"); }); - modelBuilder.Entity("WebDoorCreator.Data.DbModels.RolesModel", b => + modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderStatusViewModel", b => { - b.Property("Id") + b.Property("OrderId") .ValueGeneratedOnAdd() - .HasColumnType("nvarchar(450)"); + .HasColumnType("int"); - b.Property("ConcurrencyStamp") + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("OrderId"), 1L, 1); + + b.Property("CompanyId") + .HasColumnType("int"); + + b.Property("DateIns") + .HasColumnType("datetime2"); + + b.Property("NumDoors") + .HasColumnType("int"); + + b.Property("NumType") + .HasColumnType("int"); + + b.Property("OrderDescript") .IsRequired() .HasColumnType("nvarchar(max)"); - b.Property("Name") + b.Property("OrderExtCode") .IsRequired() .HasColumnType("nvarchar(max)"); - b.Property("NormalizedName") + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("TotCost") + .HasColumnType("decimal(18,2)"); + + b.Property("UserIdIns") .IsRequired() .HasColumnType("nvarchar(max)"); - b.HasKey("Id"); + b.Property("UserIdMod") + .IsRequired() + .HasColumnType("nvarchar(max)"); - b.ToTable("RolesModel", null, t => t.ExcludeFromMigrations()); + b.HasKey("OrderId"); + + b.ToTable("v_OrderStatus"); }); - modelBuilder.Entity("WebDoorCreator.Data.DbModels.UserRolesModel", b => + modelBuilder.Entity("WebDoorCreator.Data.DbModels.UsersViewModel", b => { b.Property("UserId") .HasColumnType("nvarchar(450)"); @@ -288,70 +373,40 @@ namespace WebDoorCreator.Data.Migrations.WDCData b.Property("RoleId") .HasColumnType("nvarchar(450)"); - b.HasKey("UserId", "RoleId"); - - b.ToTable("UserRolesModel", null, t => t.ExcludeFromMigrations()); - }); - - modelBuilder.Entity("WebDoorCreator.Data.DbModels.UsersModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsRequired() - .HasColumnType("nvarchar(max)"); - b.Property("Email") .IsRequired() .HasColumnType("nvarchar(max)"); - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") + b.Property("RoleName") .IsRequired() .HasColumnType("nvarchar(max)"); - b.Property("NormalizedUserName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - b.Property("UserName") .IsRequired() .HasColumnType("nvarchar(max)"); - b.HasKey("Id"); + b.HasKey("UserId", "RoleId"); - b.ToTable("UsersModel", null, t => t.ExcludeFromMigrations()); + b.ToTable("v_UserRolesClaims"); + }); + + modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b => + { + b.HasOne("WebDoorCreator.Data.DbModels.AspNetRoles", "RolesNav") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WebDoorCreator.Data.DbModels.AspNetUsers", "UsersNav") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RolesNav"); + + b.Navigation("UsersNav"); }); modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b => diff --git a/WebDoorCreator.Data/WDCDataContext.cs b/WebDoorCreator.Data/WDCDataContext.cs index ce44136..cbaf888 100644 --- a/WebDoorCreator.Data/WDCDataContext.cs +++ b/WebDoorCreator.Data/WDCDataContext.cs @@ -58,6 +58,7 @@ namespace WebDoorCreator.Data public virtual DbSet DbSetDoorType { get; set; } public virtual DbSet DbSetUsersView { get; set; } public virtual DbSet DbSetOrderStatus { get; set; } + public virtual DbSet DbSetValues{ get; set; } @@ -89,9 +90,10 @@ namespace WebDoorCreator.Data modelBuilder.Entity().HasKey(c => new { c.UserId, c.RoleId }); modelBuilder.Entity().HasKey(c => new { c.UserId, c.RoleId }); + modelBuilder.Entity().HasKey(c => new { c.TableName, c.FieldName}); - modelBuilder.ApplyConfiguration(new RoleConfiguration()); - modelBuilder.Seed(); + //modelBuilder.ApplyConfiguration(new RoleConfiguration()); + //modelBuilder.Seed(); OnModelCreatingPartial(modelBuilder); } diff --git a/WebDoorCreator.UI/Components/DoorPreview.razor b/WebDoorCreator.UI/Components/DoorPreview.razor new file mode 100644 index 0000000..577155c --- /dev/null +++ b/WebDoorCreator.UI/Components/DoorPreview.razor @@ -0,0 +1,2 @@ +
+
\ No newline at end of file diff --git a/WebDoorCreator.UI/Components/DoorPreview.razor.cs b/WebDoorCreator.UI/Components/DoorPreview.razor.cs new file mode 100644 index 0000000..fa17b82 --- /dev/null +++ b/WebDoorCreator.UI/Components/DoorPreview.razor.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using System.Net.Http; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.AspNetCore.Components.Forms; +using Microsoft.AspNetCore.Components.Routing; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.Web.Virtualization; +using Microsoft.JSInterop; +using WebDoorCreator.UI; +using WebDoorCreator.UI.Components; +using WebDoorCreator.UI.Shared; +using WebDoorCreator.Data.DbModels; + +namespace WebDoorCreator.UI.Components +{ + public partial class DoorPreview + { + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/DoorSizingStep.razor b/WebDoorCreator.UI/Components/DoorSizingStep.razor new file mode 100644 index 0000000..b96a4c1 --- /dev/null +++ b/WebDoorCreator.UI/Components/DoorSizingStep.razor @@ -0,0 +1,60 @@ +
+
Sizing
+
Opening
+
Edges
+
+ + +
+ @if (isSizing) + { +
+
Width
+ +
+
+
Height
+ +
+
+
Thickness
+ +
+ } + else if(isOpening) + { +
+
Swing
+ +
+ } + else if (isEdges) + { +
+
Lock edge
+ +
+
+
Hinge edge
+ +
+
+
Top edge
+ +
+
+
Bottom edge
+ +
+ } +
\ No newline at end of file diff --git a/WebDoorCreator.UI/Components/DoorSizingStep.razor.cs b/WebDoorCreator.UI/Components/DoorSizingStep.razor.cs new file mode 100644 index 0000000..bf91f5a --- /dev/null +++ b/WebDoorCreator.UI/Components/DoorSizingStep.razor.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using System.Net.Http; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.AspNetCore.Components.Forms; +using Microsoft.AspNetCore.Components.Routing; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.Web.Virtualization; +using Microsoft.JSInterop; +using WebDoorCreator.UI; +using WebDoorCreator.UI.Components; +using WebDoorCreator.UI.Shared; +using WebDoorCreator.Data.DbModels; + +namespace WebDoorCreator.UI.Components +{ + public partial class DoorSizingStep + { + protected bool isSizing { get; set; } = true; + protected string isSizingActive + { + get => isSizing ? "btn-primary" : "btn-secondary"; + } + protected bool isOpening { get; set; } = false; + protected string isOpeningActive + { + get => isOpening ? "btn-primary" : "btn-secondary"; + } + protected bool isEdges { get; set; } = false; + protected string isEdgesActive + { + get => isEdges ? "btn-primary" : "btn-secondary"; + } + + protected void setSizing() + { + isOpening = false; + isEdges = false; + isSizing = true; + } + protected void setOpening() + { + isEdges = false; + isSizing = false; + isOpening = true; + } + protected void setEdges() + { + isOpening = false; + isSizing = false; + isEdges = true; + } + + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/OrderDetails.razor b/WebDoorCreator.UI/Components/OrderDetails.razor new file mode 100644 index 0000000..b22e577 --- /dev/null +++ b/WebDoorCreator.UI/Components/OrderDetails.razor @@ -0,0 +1,22 @@ +@if (currOrderStatus != null) +{ +
+
+
Insert Date
+
@currOrderStatus.DateIns
+
+
+
Order External Code
+
@currOrderStatus.OrderExtCode
+
+
+
Models Number
+
@currOrderStatus.NumType
+
+
+
Doors Number
+
@currOrderStatus.NumDoors
+
+ +
+} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/OrderDetails.razor.cs b/WebDoorCreator.UI/Components/OrderDetails.razor.cs new file mode 100644 index 0000000..4463902 --- /dev/null +++ b/WebDoorCreator.UI/Components/OrderDetails.razor.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using System.Net.Http; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.AspNetCore.Components.Forms; +using Microsoft.AspNetCore.Components.Routing; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.Web.Virtualization; +using Microsoft.JSInterop; +using WebDoorCreator.UI; +using WebDoorCreator.UI.Components; +using WebDoorCreator.UI.Shared; +using WebDoorCreator.Data.DbModels; + +namespace WebDoorCreator.UI.Components +{ + public partial class OrderDetails + { + [Parameter] + public OrderStatusViewModel? currOrderStatus { get; set; } = null; + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/OrderList.razor b/WebDoorCreator.UI/Components/OrderList.razor index bf66b33..2b66562 100644 --- a/WebDoorCreator.UI/Components/OrderList.razor +++ b/WebDoorCreator.UI/Components/OrderList.razor @@ -11,10 +11,10 @@ else Order Date Order Number Order Description - Doors Number - Model Number - TOTAL COST - PROGRESS + Doors Number + Model Number + TOTAL COST + @* PROGRESS*@ @@ -23,16 +23,16 @@ else @item.DateIns - @item.OrderId + @item.OrderExtCode @item.OrderDescript - @item.NumDoors - @item.NumType - @item.TotCost - + @item.NumDoors + @item.NumType + @($"{item.TotCost:C2}") + @*
-
+
- + *@ } diff --git a/WebDoorCreator.UI/Components/OrderList.razor.cs b/WebDoorCreator.UI/Components/OrderList.razor.cs index 8fc09c5..af8da22 100644 --- a/WebDoorCreator.UI/Components/OrderList.razor.cs +++ b/WebDoorCreator.UI/Components/OrderList.razor.cs @@ -23,14 +23,18 @@ namespace WebDoorCreator.UI.Components { #region Protected Properties - [Inject] - protected WebDoorCreatorService WDService { get; set; } = null!; - [Inject] - protected IJSRuntime JSRuntime { get; set; } = null!; + [Parameter] + public bool B_doorChaged { get; set; } [Parameter] public EventCallback E_currOrderStatus { get; set; } + [Inject] + protected IJSRuntime JSRuntime { get; set; } = null!; + + [Inject] + protected WebDoorCreatorService WDService { get; set; } = null!; + #endregion Protected Properties #region Protected Methods @@ -40,6 +44,14 @@ namespace WebDoorCreator.UI.Components await ReloadData(); } + protected override async Task OnParametersSetAsync() + { + if (B_doorChaged) + { + await ReloadData(); + } + } + #endregion Protected Methods #region Private Fields @@ -57,25 +69,10 @@ namespace WebDoorCreator.UI.Components protected bool isModRole { get; set; } = false; - private async Task ReloadData() - { - var adesso = DateTime.Now.Date; - ListOrdersStatus = null; - await Task.Delay(1); - ListOrdersStatus = await WDService.GetOrderStatus(0, 0, adesso.AddYears(-2), adesso); - await Task.Delay(1); - await InvokeAsync(StateHasChanged); - } - private async Task setCurrOrder(int userId) - { - await Task.Delay(1); - await E_currOrderStatus.InvokeAsync(userId); - } - protected string setPgColor(int progress) { string answ = ""; - if(progress == 1) + if (progress == 1) { answ = "#D35400"; } @@ -99,6 +96,20 @@ namespace WebDoorCreator.UI.Components return answ; } + private async Task ReloadData() + { + var adesso = DateTime.Now.Date; + ListOrdersStatus = null; + await Task.Delay(1); + ListOrdersStatus = await WDService.GetOrderStatus(0, 0, adesso.AddYears(-2), adesso); + await Task.Delay(1); + await InvokeAsync(StateHasChanged); + } + private async Task setCurrOrder(int currOrd) + { + await Task.Delay(1); + await E_currOrderStatus.InvokeAsync(currOrd); + } //private async Task editRec(CompanyModel currComp) //{ // await E_currCompany.InvokeAsync(currComp); diff --git a/WebDoorCreator.UI/Components/SizingDefinition.razor b/WebDoorCreator.UI/Components/SizingDefinition.razor new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/WebDoorCreator.UI/Components/SizingDefinition.razor @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/SizingDefinition.razor.cs b/WebDoorCreator.UI/Components/SizingDefinition.razor.cs new file mode 100644 index 0000000..eeb6441 --- /dev/null +++ b/WebDoorCreator.UI/Components/SizingDefinition.razor.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using System.Net.Http; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.AspNetCore.Components.Forms; +using Microsoft.AspNetCore.Components.Routing; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.Web.Virtualization; +using Microsoft.JSInterop; +using WebDoorCreator.UI; +using WebDoorCreator.UI.Components; +using WebDoorCreator.UI.Shared; +using WebDoorCreator.Data.DbModels; + +namespace WebDoorCreator.UI.Components +{ + public partial class SizingDefinition + { + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/StepsList.razor b/WebDoorCreator.UI/Components/StepsList.razor new file mode 100644 index 0000000..88e5581 --- /dev/null +++ b/WebDoorCreator.UI/Components/StepsList.razor @@ -0,0 +1,5 @@ +
+
Door
+
Hardware
+
Report
+
\ No newline at end of file diff --git a/WebDoorCreator.UI/Components/StepsList.razor.cs b/WebDoorCreator.UI/Components/StepsList.razor.cs new file mode 100644 index 0000000..6909bc7 --- /dev/null +++ b/WebDoorCreator.UI/Components/StepsList.razor.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using System.Net.Http; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.AspNetCore.Components.Forms; +using Microsoft.AspNetCore.Components.Routing; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.Web.Virtualization; +using Microsoft.JSInterop; +using WebDoorCreator.UI; +using WebDoorCreator.UI.Components; +using WebDoorCreator.UI.Shared; +using WebDoorCreator.Data.DbModels; + +namespace WebDoorCreator.UI.Components +{ + public partial class StepsList + { + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Data/WebDoorCreatorService.cs b/WebDoorCreator.UI/Data/WebDoorCreatorService.cs index 77a429b..e3f7058 100644 --- a/WebDoorCreator.UI/Data/WebDoorCreatorService.cs +++ b/WebDoorCreator.UI/Data/WebDoorCreatorService.cs @@ -113,7 +113,7 @@ namespace WebDoorCreator.UI.Data { var dbResult = await dbController.CompanyAddMod(currRec); // elimino cache redis... - RedisValue pattern = new RedisValue($"{rKeyCompany}:*"); + RedisValue pattern = new RedisValue($"{rKeyCompany}"); bool answ = await ExecFlushRedisPattern(pattern); await Task.Delay(1); return dbResult; @@ -153,7 +153,7 @@ namespace WebDoorCreator.UI.Data public async Task FlushRedisCache() { await Task.Delay(1); - RedisValue pattern = new RedisValue($"{redisBaseAddr}:*"); + RedisValue pattern = new RedisValue($"{redisBaseAddr}"); bool answ = await ExecFlushRedisPattern(pattern); return answ; } @@ -404,7 +404,7 @@ namespace WebDoorCreator.UI.Data { var dbResult = await dbController.OrderAdd(currRec); // elimino cache redis... - RedisValue pattern = new RedisValue($"{rKeyOrderStatus}:*"); + RedisValue pattern = new RedisValue($"{rKeyOrderStatus}"); bool answ = await ExecFlushRedisPattern(pattern); await Task.Delay(1); return dbResult; @@ -424,7 +424,7 @@ namespace WebDoorCreator.UI.Data List? dbResult = new List(); // cerco da cache - string currKey = rKeyDoor; + string currKey = $"{rKeyDoor}:{orderId}"; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); string? rawData = await redisDb.StringGetAsync(currKey); @@ -464,10 +464,13 @@ namespace WebDoorCreator.UI.Data /// public async Task DoorsAddMod(DoorModel currRec) { - var dbResult = await dbController.DoorsAddMod(currRec); - // elimino cache redis... - RedisValue pattern = new RedisValue($"{rKeyDoor}:*"); + var dbResult = await dbController.DoorUpsert(currRec); + // elimino cache redis dati porta... + RedisValue pattern = new RedisValue($"{rKeyDoor}"); bool answ = await ExecFlushRedisPattern(pattern); + // elimino cache redis dati ordine... + pattern = new RedisValue($"{rKeyOrderStatus}"); + answ = await ExecFlushRedisPattern(pattern); await Task.Delay(1); return dbResult; } diff --git a/WebDoorCreator.UI/Pages/DoorDefinition.razor b/WebDoorCreator.UI/Pages/DoorDefinition.razor index 0ff2b43..c415157 100644 --- a/WebDoorCreator.UI/Pages/DoorDefinition.razor +++ b/WebDoorCreator.UI/Pages/DoorDefinition.razor @@ -1,3 +1,18 @@ @page "/DoorDefinition"

Door Definition

+ +
+
+
+ +
+
+ +
+ +
+
+ +
+
diff --git a/WebDoorCreator.UI/Pages/DoorDefinition.razor.cs b/WebDoorCreator.UI/Pages/DoorDefinition.razor.cs index 5c44c69..da62b7f 100644 --- a/WebDoorCreator.UI/Pages/DoorDefinition.razor.cs +++ b/WebDoorCreator.UI/Pages/DoorDefinition.razor.cs @@ -12,11 +12,50 @@ using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Web.Virtualization; using Microsoft.JSInterop; using WebDoorCreator.UI; +using WebDoorCreator.UI.Components; using WebDoorCreator.UI.Shared; +using WebDoorCreator.Data.DbModels; +using MailKit; +using Microsoft.AspNetCore.WebUtilities; +using System.Drawing.Printing; +using WebDoorCreator.Data.Controllers; +using WebDoorCreator.UI.Data; namespace WebDoorCreator.UI.Pages { public partial class DoorDefinition { + [Inject] + protected NavigationManager navManager { get; set; } = null!; + + [Inject] + protected WebDoorCreatorService WDService { get; set; } = null!; + + protected int idOrd { get; set; } = 0; + protected OrderStatusViewModel? orderStatus { get; set; } = null; + private List? ListOrdersStatus = null; + protected async override Task OnInitializedAsync() + { + await Task.Delay(1); + var uri = navManager.ToAbsoluteUri(navManager.Uri); + if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("idOrd", out var _idOrd)) + { + idOrd = int.Parse(_idOrd); + await reloadData(); + } + } + + protected async Task reloadData() + { + var adesso = DateTime.Now.Date; + ListOrdersStatus = null; + await Task.Delay(1); + ListOrdersStatus = await WDService.GetOrderStatus(0, 0, adesso.AddYears(-2), adesso); + if (ListOrdersStatus != null) + { + orderStatus = ListOrdersStatus.Where(x => x.OrderId == idOrd).FirstOrDefault(); + } + await Task.Delay(1); + } } } \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/OrdersHomePage.razor b/WebDoorCreator.UI/Pages/OrdersHomePage.razor index 87b2e56..d7a22d1 100644 --- a/WebDoorCreator.UI/Pages/OrdersHomePage.razor +++ b/WebDoorCreator.UI/Pages/OrdersHomePage.razor @@ -16,8 +16,7 @@ Add new order - - + @@ -25,7 +24,7 @@