inizio definizione porte
This commit is contained in:
@@ -37,7 +37,7 @@ namespace WebDoorCreator.Data
|
||||
|
||||
//builder.ApplyConfiguration(new RoleConfiguration());
|
||||
//builder.ApplyConfiguration(new UserConfiguration());
|
||||
builder.ApplyConfiguration(new UserRolesConfiguration());
|
||||
//builder.ApplyConfiguration(new UserRolesConfiguration());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Modifying or adding a new door
|
||||
/// </summary>
|
||||
/// <param name="addEditRec">Record to edit or add</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DoorsAddMod(DoorModel addEditRec)
|
||||
public async Task<bool> DoorUpsert(DoorModel addEditRec)
|
||||
{
|
||||
/* crea nuovo metodo per modifica singola quantità porta: DOORMODQTY */
|
||||
bool fatto = false;
|
||||
//List<ItemModel> dbResult = new List<ItemModel>();
|
||||
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
|
||||
|
||||
@@ -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
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[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
|
||||
}
|
||||
}
|
||||
+446
@@ -0,0 +1,446 @@
|
||||
// <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 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<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("AspNetRoles", null, t => t.ExcludeFromMigrations());
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("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<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetimeoffset");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("AspNetUsers", null, t => t.ExcludeFromMigrations());
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.CompanyModel", b =>
|
||||
{
|
||||
b.Property<int>("CompanyId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("CompanyId"), 1L, 1);
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("City")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CompanyExtCode")
|
||||
.IsRequired()
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("CompanyName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("CompanyToken")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("nvarchar(150)");
|
||||
|
||||
b.Property<string>("PrivateNote")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("State")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("VAT")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("ZipCode")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("CompanyId");
|
||||
|
||||
b.ToTable("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b =>
|
||||
{
|
||||
b.Property<int>("DoorId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("DoorId"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DateIns")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DateMod")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DoorDescript")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DoorExtCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("OrderId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Quantity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TypeId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<decimal>("UnitCost")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("UserIdIns")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("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<int>("TypeId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("TypeId"), 1L, 1);
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("TypeCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("TypeId");
|
||||
|
||||
b.ToTable("DoorType");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.ListValues", b =>
|
||||
{
|
||||
b.Property<string>("TableName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("label")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("ordinal")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("value")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.HasKey("TableName", "FieldName");
|
||||
|
||||
b.ToTable("ListValues");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderModel", b =>
|
||||
{
|
||||
b.Property<int>("OrderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("OrderId"), 1L, 1);
|
||||
|
||||
b.Property<int>("CompanyId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateIns")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DateMod")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("OrderDescript")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("OrderExtCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("UserIdIns")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserIdMod")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("OrderId");
|
||||
|
||||
b.HasIndex("CompanyId");
|
||||
|
||||
b.ToTable("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderStatusViewModel", b =>
|
||||
{
|
||||
b.Property<int>("OrderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("OrderId"), 1L, 1);
|
||||
|
||||
b.Property<int>("CompanyId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateIns")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("NumDoors")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("NumType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("OrderDescript")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("OrderExtCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("OrderStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<decimal>("TotCost")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("UserIdIns")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserIdMod")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("OrderId");
|
||||
|
||||
b.ToTable("v_OrderStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.UsersViewModel", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RoleName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
FieldName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
value = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
label = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
ordinal = table.Column<int>(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<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
OrderExtCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DateIns = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UserIdIns = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
UserIdMod = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
OrderStatus = table.Column<int>(type: "int", nullable: false),
|
||||
OrderDescript = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
NumType = table.Column<int>(type: "int", nullable: false),
|
||||
NumDoors = table.Column<int>(type: "int", nullable: false),
|
||||
TotCost = table.Column<decimal>(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<string>(type: "nvarchar(450)", nullable: false),
|
||||
RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
UserName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
RoleName = table.Column<string>(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<string>(type: "nvarchar(450)", nullable: false),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
NormalizedName = table.Column<string>(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" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("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<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("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<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetimeoffset");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("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<string>("TableName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("label")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("ordinal")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("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<string>("Id")
|
||||
b.Property<int>("OrderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("OrderId"), 1L, 1);
|
||||
|
||||
b.Property<int>("CompanyId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateIns")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("NumDoors")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("NumType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("OrderDescript")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
b.Property<string>("OrderExtCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
b.Property<int>("OrderStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<decimal>("TotCost")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("UserIdIns")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
b.Property<string>("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<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
@@ -288,70 +373,40 @@ namespace WebDoorCreator.Data.Migrations.WDCData
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.ToTable("UserRolesModel", null, t => t.ExcludeFromMigrations());
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.UsersModel", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetimeoffset");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
b.Property<string>("RoleName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("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 =>
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace WebDoorCreator.Data
|
||||
public virtual DbSet<DoorTypeModel> DbSetDoorType { get; set; }
|
||||
public virtual DbSet<UsersViewModel> DbSetUsersView { get; set; }
|
||||
public virtual DbSet<OrderStatusViewModel> DbSetOrderStatus { get; set; }
|
||||
public virtual DbSet<ListValues> DbSetValues{ get; set; }
|
||||
|
||||
|
||||
|
||||
@@ -89,9 +90,10 @@ namespace WebDoorCreator.Data
|
||||
|
||||
modelBuilder.Entity<AspNetUserRoles>().HasKey(c => new { c.UserId, c.RoleId });
|
||||
modelBuilder.Entity<UsersViewModel>().HasKey(c => new { c.UserId, c.RoleId });
|
||||
modelBuilder.Entity<ListValues>().HasKey(c => new { c.TableName, c.FieldName});
|
||||
|
||||
modelBuilder.ApplyConfiguration(new RoleConfiguration());
|
||||
modelBuilder.Seed();
|
||||
//modelBuilder.ApplyConfiguration(new RoleConfiguration());
|
||||
//modelBuilder.Seed();
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<div class="bg-dark w-100" style="height:47rem;">
|
||||
</div>
|
||||
@@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="btn @isSizingActive" @onclick="()=>setSizing()">Sizing</div>
|
||||
<div class="btn @isOpeningActive" @onclick="()=>setOpening()">Opening</div>
|
||||
<div class="btn @isEdgesActive" @onclick="()=>setEdges()">Edges</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
@if (isSizing)
|
||||
{
|
||||
<div class="d-flex justify-content-center m-5">
|
||||
<div class="fs-4 me-3">Width</div>
|
||||
<input />
|
||||
</div>
|
||||
<div class="d-flex justify-content-center m-5">
|
||||
<div class="fs-4 me-3">Height</div>
|
||||
<input />
|
||||
</div>
|
||||
<div class="d-flex justify-content-center m-5">
|
||||
<div class="fs-4 me-3">Thickness</div>
|
||||
<input />
|
||||
</div>
|
||||
}
|
||||
else if(isOpening)
|
||||
{
|
||||
<div class="d-flex justify-content-center m-5">
|
||||
<div class="fs-4 me-3">Swing</div>
|
||||
<select>
|
||||
<option>RH</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
else if (isEdges)
|
||||
{
|
||||
<div class="d-flex justify-content-center m-5">
|
||||
<div class="fs-4 me-3">Lock edge</div>
|
||||
<select>
|
||||
<option>SQ</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center m-5">
|
||||
<div class="fs-4 me-3">Hinge edge</div>
|
||||
<select>
|
||||
<option>SQ</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center m-5">
|
||||
<div class="fs-4 me-3">Top edge</div>
|
||||
<select>
|
||||
<option>SQ</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center m-5">
|
||||
<div class="fs-4 me-3">Bottom edge</div>
|
||||
<select>
|
||||
<option>SQ</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
@if (currOrderStatus != null)
|
||||
{
|
||||
<div class="d-flex justify-content-between mb-3 bg-info p-3">
|
||||
<div>
|
||||
<div class="badge rounded-pilll bg-dark text-light">Insert Date</div>
|
||||
<div>@currOrderStatus.DateIns</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="badge rounded-pilll bg-dark text-light">Order External Code</div>
|
||||
<div>@currOrderStatus.OrderExtCode</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="badge rounded-pilll bg-dark text-light">Models Number</div>
|
||||
<div class="text-center">@currOrderStatus.NumType</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="badge rounded-pilll bg-dark text-light">Doors Number</div>
|
||||
<div class="text-center">@currOrderStatus.NumDoors</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -11,10 +11,10 @@ else
|
||||
<th>Order Date</th>
|
||||
<th>Order Number</th>
|
||||
<th>Order Description</th>
|
||||
<th>Doors Number</th>
|
||||
<th>Model Number</th>
|
||||
<th>TOTAL COST</th>
|
||||
<th>PROGRESS</th>
|
||||
<th class="text-end">Doors Number</th>
|
||||
<th class="text-end">Model Number</th>
|
||||
<th class="text-end">TOTAL COST</th>
|
||||
@* <th>PROGRESS</th>*@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -23,16 +23,16 @@ else
|
||||
<tr>
|
||||
<td><button class="btn btn-sm btn-warning" data-bs-toggle="modal" data-bs-target="#OrderDetailModal" @onclick="()=>setCurrOrder(item.OrderId)"><i class="fa-solid fa-pen-to-square"></i></button></td>
|
||||
<td>@item.DateIns</td>
|
||||
<td>@item.OrderId</td>
|
||||
<td>@item.OrderExtCode</td>
|
||||
<td>@item.OrderDescript</td>
|
||||
<td>@item.NumDoors</td>
|
||||
<td>@item.NumType</td>
|
||||
<td>@item.TotCost</td>
|
||||
<td>
|
||||
<td class="text-end">@item.NumDoors</td>
|
||||
<td class="text-end">@item.NumType</td>
|
||||
<td class="text-end">@($"{item.TotCost:C2}")</td>
|
||||
@*<td>
|
||||
<div class="progress">
|
||||
<div class="progress-bar" role="progressbar" aria-label="Basic example" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: calc(20%*@item.OrderStatus); background-color: @setPgColor(item.OrderStatus)"></div>
|
||||
<div class="progress-bar" role="progressbar" aria-label="Basic example" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: calc(20%item.OrderStatus); background-color: @setPgColor(item.OrderStatus)"></div>
|
||||
</div>
|
||||
</td>
|
||||
</td>*@
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -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<int> 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);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="btn btn-success w-100">Door</div>
|
||||
<div class="btn btn-secondary w-100">Hardware</div>
|
||||
<div class="btn btn-secondary w-100">Report</div>
|
||||
</div>
|
||||
@@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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<bool> 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<DoorModel>? dbResult = new List<DoorModel>();
|
||||
// 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
|
||||
/// <returns></returns>
|
||||
public async Task<bool> 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;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
@page "/DoorDefinition"
|
||||
|
||||
<h3>Door Definition</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-7">
|
||||
<div>
|
||||
<OrderDetails currOrderStatus="@orderStatus"></OrderDetails>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<StepsList></StepsList>
|
||||
</div>
|
||||
<DoorSizingStep></DoorSizingStep>
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<DoorPreview></DoorPreview>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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<OrderStatusViewModel>? 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,7 @@
|
||||
<i class="fa-solid fa-plus"></i> Add new order
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<OrderList E_currOrderStatus="catchCurrOrder"></OrderList>
|
||||
<OrderList E_currOrderStatus="catchCurrOrder" B_doorChaged="@doorChange"></OrderList>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal Order -->
|
||||
@@ -25,7 +24,7 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="newCompModalLabel">Insert new company</h1>
|
||||
<h1 class="modal-title fs-5" id="newOrderModalLabel">Insert new order</h1>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="w-100">
|
||||
@@ -55,6 +54,7 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="newCompModalLabel">Insert or update Doors</h1>
|
||||
<a class="btn btn-success btn-sm" href="@goToDefPage" target="_blank">Add new door </a>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="w-100">
|
||||
@@ -63,9 +63,8 @@
|
||||
@if (currDoor != null)
|
||||
{
|
||||
<input class="form-input" @bind-value="@doorExtCode" />
|
||||
<input class="form-input w-25" @bind-value="@doorQuantity" type="number" disabled/>
|
||||
<button class="btn btn-sm btn-danger" @onclick="()=>addOrRemoveOneDoor(currDoor, false)"><i class="fa-solid fa-minus"></i> <i class="fa-solid fa-1"></i></button>
|
||||
<button class="btn btn-sm btn-success" @onclick="()=>addOrRemoveOneDoor(currDoor, true)"><i class="fa-solid fa-plus"></i> <i class="fa-solid fa-1"></i></button>
|
||||
<input class="form-input w-25" @bind-value="@doorQuantity" type="number" disabled />
|
||||
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -74,40 +73,37 @@
|
||||
<table class="table table-sm table-striped table-responsive-md border border-dark">
|
||||
<thead>
|
||||
<tr class="bg-dark text-light">
|
||||
<td></td>
|
||||
<td>Door Type</td>
|
||||
<th>Door external code</th>
|
||||
<th>Doors Number</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var door in DoorsList)
|
||||
{
|
||||
<tr>
|
||||
<td><button class="btn btn-sm btn-warning" @onclick="()=>SetCurrDoor(door)"><i class="fa-solid fa-pen-to-square"></i></button></td>
|
||||
<td>@door.TypeId</td>
|
||||
<td>@door.DoorExtCode</td>
|
||||
<td>@door.Quantity</td>
|
||||
<td>
|
||||
|
||||
<button class="btn btn-sm btn-danger" @onclick="()=>addOrRemoveOneDoorNumber(door.DoorId, false)"><i class="fa-solid fa-minus"></i> <i class="fa-solid fa-1"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<button class="btn btn-sm btn-success" @onclick="()=>addOrRemoveOneDoorNumber(door.DoorId, true)"><i class="fa-solid fa-plus"></i> <i class="fa-solid fa-1"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
|
||||
|
||||
@* <div class="form-floating">
|
||||
<input id="orderCodExt" @bind-value="@orderCodExt" class="form-control w-100 w-100w-100 my-1" />
|
||||
<label for="orderCodExt" class="form-label">Order external code</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<textarea id="orderDescr" @bind="@orderDescr" class="form-control w-100" rows="3"></textarea>
|
||||
<label for="orderDescr" class="form-label">Order description</label>
|
||||
</div>*@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" @onclick="()=>emptyModal()" data-bs-dismiss="modal">Close</button>
|
||||
@* <button type="button" class="btn btn-primary" @onclick="()=>addNewOrder(context.User.Identity?.Name!)">Save changes</button>*@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -120,6 +120,7 @@ namespace WebDoorCreator.UI.Pages
|
||||
protected async Task emptyModal()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
DoorsList = null;
|
||||
currDoor = null;
|
||||
}
|
||||
|
||||
@@ -150,27 +151,32 @@ namespace WebDoorCreator.UI.Pages
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task addOrRemoveOneDoor(DoorModel door, bool isAdd)
|
||||
{
|
||||
if (door != null)
|
||||
{
|
||||
if (isAdd)
|
||||
{
|
||||
doorQuantity = doorQuantity + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
doorQuantity = doorQuantity - 1;
|
||||
}
|
||||
protected bool doorChange { get; set; } = false;
|
||||
|
||||
door.Quantity = doorQuantity;
|
||||
protected async Task addOrRemoveOneDoorNumber(int doorId, bool isAdd)
|
||||
{
|
||||
var door = new DoorModel();
|
||||
doorChange = false;
|
||||
if (isAdd)
|
||||
{
|
||||
var done = await WDService.DoorsAddMod(door);
|
||||
}
|
||||
else
|
||||
{
|
||||
door.Quantity = door.Quantity - 1;
|
||||
}
|
||||
|
||||
doorChange = true;
|
||||
}
|
||||
|
||||
protected string goToDefPage { get; set; } = "";
|
||||
|
||||
protected async Task catchCurrOrder(int orderId)
|
||||
{
|
||||
DoorsList = null;
|
||||
await Task.Delay(1);
|
||||
DoorsList = await WDService.DoorsGetByOrderId(orderId);
|
||||
goToDefPage = $"/DoorDefinition?idOrd={orderId}";
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
Reference in New Issue
Block a user