Aggiunta preliminare pag articoli (senza searchv era e propria)

This commit is contained in:
Samuele Locatelli
2025-08-08 18:46:25 +02:00
parent a133c7a3cf
commit eb56d1f7fb
29 changed files with 526 additions and 126 deletions
@@ -1,6 +1,6 @@
namespace EgwCoreLib.Lux.Core
{
public class Enum
public class Enums
{
public enum OfferStates
{
@@ -91,7 +91,11 @@ namespace EgwCoreLib.Lux.Data.Controllers
}
return dbResult;
}
/// <summary>
/// Elenco item da ricerca
/// </summary>
/// <param name="term"></param>
/// <returns></returns>
public List<ItemModel> ItemGetSearch(string term)
{
List<ItemModel> dbResult = new List<ItemModel>();
@@ -112,7 +116,55 @@ namespace EgwCoreLib.Lux.Data.Controllers
}
return dbResult;
}
/// <summary>
/// Elenco item da ricerca async
/// </summary>
/// <param name="term"></param>
/// <returns></returns>
public async Task<List<ItemModel>> ItemGetSearchAsync(string term)
{
List<ItemModel> dbResult = new List<ItemModel>();
//using (DataLayerContext dbCtx = new DataLayerContext(configuration))
using (DataLayerContext dbCtx = new DataLayerContext())
{
try
{
dbResult = await dbCtx
.DbSetItem
.Where(x => x.Description.Contains(term) || string.IsNullOrEmpty(term))
.ToListAsync();
}
catch (Exception exc)
{
Log.Error($"Eccezione durante ItemGetSearchAsync{Environment.NewLine}{exc}");
}
}
return dbResult;
}
/// <summary>
/// Elenco completo ItemGroup gestiti async
/// </summary>
/// <returns></returns>
public async Task<List<ItemGroupModel>> ItemGroupGetAllAsync()
{
List<ItemGroupModel> dbResult = new List<ItemGroupModel>();
//using (DataLayerContext dbCtx = new DataLayerContext(configuration))
using (DataLayerContext dbCtx = new DataLayerContext())
{
try
{
dbResult = await dbCtx
.DbSetItemGroup
.ToListAsync();
}
catch (Exception exc)
{
Log.Error($"Eccezione durante ItemGroupGetAllAsync{Environment.NewLine}{exc}");
}
}
return dbResult;
}
/// <summary>
/// Elenco completo ItemGroup gestiti
/// </summary>
@@ -131,7 +183,7 @@ namespace EgwCoreLib.Lux.Data.Controllers
}
catch (Exception exc)
{
Log.Error($"Eccezione durante ItemGroupGetAll{Environment.NewLine}{exc}");
Log.Error($"Eccezione durante ItemGroupGetAllAsync{Environment.NewLine}{exc}");
}
}
return dbResult;
@@ -204,7 +256,7 @@ namespace EgwCoreLib.Lux.Data.Controllers
ItemModel newRec = new ItemModel()
{
CodGroup = item.ClassCode,
ItemType = Core.Enum.ItemClassType.Bom,
ItemType = Core.Enums.ItemClassType.Bom,
IsService = false,
// da calcolare meglio x gruppo
ItemCode = 0,
@@ -314,7 +366,7 @@ namespace EgwCoreLib.Lux.Data.Controllers
// recupero il subset item da BOM / BomAlt...
var bomGenList = dbCtx
.DbSetItem
.Where(x => (x.ItemType == Core.Enum.ItemClassType.Bom || x.ItemType == Core.Enum.ItemClassType.BomAlt))
.Where(x => (x.ItemType == Core.Enums.ItemClassType.Bom || x.ItemType == Core.Enums.ItemClassType.BomAlt))
.ToList();
// ciclo!
@@ -412,7 +464,7 @@ namespace EgwCoreLib.Lux.Data.Controllers
// recupero il subset item da BOM...
var bomGenList = dbCtx
.DbSetItem
.Where(x => x.ItemType == Core.Enum.ItemClassType.Bom)
.Where(x => x.ItemType == Core.Enums.ItemClassType.Bom)
.ToList();
// calcolo il NUOVO costo e lo aggiorno...
+1 -1
View File
@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static EgwCoreLib.Lux.Core.Enum;
using static EgwCoreLib.Lux.Core.Enums;
namespace EgwCoreLib.Lux.Data.DbModel
{
+1 -1
View File
@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static EgwCoreLib.Lux.Core.Enum;
using static EgwCoreLib.Lux.Core.Enums;
namespace EgwCoreLib.Lux.Data.DbModel
{
+1 -1
View File
@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static EgwCoreLib.Lux.Core.Enum;
using static EgwCoreLib.Lux.Core.Enums;
namespace EgwCoreLib.Lux.Data.DbModel
{
@@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace EgwCoreLib.Lux.Data.Migrations
{
[DbContext(typeof(DataLayerContext))]
[Migration("20250808131854_InitDb")]
[Migration("20250808143628_InitDb")]
partial class InitDb
{
/// <inheritdoc />
@@ -718,13 +718,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
CustomerID = 2,
DealerID = 2,
Description = "Offerta per tre serramenti",
Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9764),
Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9766),
Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4215),
Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4216),
OffertState = 0,
RefNum = 1,
RefRev = 1,
RefYear = 2024,
ValidUntil = new DateTime(2025, 9, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9761)
ValidUntil = new DateTime(2025, 9, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4212)
});
});
@@ -799,14 +799,14 @@ namespace EgwCoreLib.Lux.Data.Migrations
new
{
OfferRowID = 1,
BomOk = false,
BomOk = true,
Cost = 950.0,
Environment = "WINDOW",
Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9790),
Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4243),
ItemBOM = "",
ItemOk = false,
ItemOk = true,
ItemSPP = "{}",
Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9791),
Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4245),
Note = "Finestra anta singola 2025",
OfferID = 1,
OfferRowUID = "OFF0000000001",
@@ -818,14 +818,14 @@ namespace EgwCoreLib.Lux.Data.Migrations
new
{
OfferRowID = 2,
BomOk = false,
BomOk = true,
Cost = 160.0,
Environment = "WINDOW",
Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9798),
Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4252),
ItemBOM = "",
ItemOk = false,
ItemOk = true,
ItemSPP = "{}",
Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9799),
Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4253),
Note = "Persiana per Finestra anta singola 2025",
OfferID = 1,
OfferRowUID = "OFF0000000002",
@@ -837,14 +837,14 @@ namespace EgwCoreLib.Lux.Data.Migrations
new
{
OfferRowID = 3,
BomOk = false,
BomOk = true,
Cost = 200.0,
Environment = "WINDOW",
Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9805),
Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4259),
ItemBOM = "",
ItemOk = false,
ItemOk = true,
ItemSPP = "{}",
Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9806),
Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4261),
Note = "Installazione serramento",
OfferID = 1,
OfferRowUID = "OFF0000000003",
@@ -1385,8 +1385,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 1,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9506),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9552),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3939),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3987),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 5.0,
@@ -1398,8 +1398,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 2,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9555),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9556),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3989),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3991),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 8.0,
@@ -1411,8 +1411,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 3,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9559),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9560),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3993),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3995),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 5.0,
@@ -1424,8 +1424,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 4,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9562),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9564),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3997),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3998),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -1437,8 +1437,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 5,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9566),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9567),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4000),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4002),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 10.0,
@@ -1450,8 +1450,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 6,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9569),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9571),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4004),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4006),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -1463,8 +1463,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 7,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9573),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9574),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4008),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4009),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 50.0,
@@ -1476,8 +1476,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 8,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9576),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9578),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4011),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4013),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -1489,8 +1489,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 9,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9580),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9581),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4015),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4017),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -1502,8 +1502,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 10,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9583),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9585),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4019),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4020),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -1814,7 +1814,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.OfferRowModel", b =>
{
b.HasOne("EgwCoreLib.Lux.Data.DbModel.OfferModel", "OfferNav")
.WithMany()
.WithMany("OfferRowNav")
.HasForeignKey("OfferID")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
@@ -1962,6 +1962,11 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Navigation("ItemNav");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.OfferModel", b =>
{
b.Navigation("OfferRowNav");
});
#pragma warning restore 612, 618
}
}
@@ -767,7 +767,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "Offer",
columns: new[] { "OfferID", "CustomerID", "DealerID", "Description", "Inserted", "Modified", "OffertState", "RefNum", "RefRev", "RefYear", "ValidUntil" },
values: new object[] { 1, 2, 2, "Offerta per tre serramenti", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9764), new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9766), 0, 1, 1, 2024, new DateTime(2025, 9, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9761) });
values: new object[] { 1, 2, 2, "Offerta per tre serramenti", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4215), new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4216), 0, 1, 1, 2024, new DateTime(2025, 9, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4212) });
migrationBuilder.InsertData(
table: "RegItem",
@@ -813,9 +813,9 @@ namespace EgwCoreLib.Lux.Data.Migrations
columns: new[] { "OfferRowID", "BomOk", "Cost", "Environment", "Inserted", "ItemBOM", "ItemOk", "ItemSPP", "Modified", "Note", "OfferID", "OfferRowUID", "Qty", "RowNum", "SellingItemID", "SerStruct" },
values: new object[,]
{
{ 1, false, 950.0, "WINDOW", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9790), "", false, "{}", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9791), "Finestra anta singola 2025", 1, "OFF0000000001", 3.0, 1, 1, "{}" },
{ 2, false, 160.0, "WINDOW", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9798), "", false, "{}", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9799), "Persiana per Finestra anta singola 2025", 1, "OFF0000000002", 3.0, 2, 2, "{}" },
{ 3, false, 200.0, "WINDOW", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9805), "", false, "{}", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9806), "Installazione serramento", 1, "OFF0000000003", 3.0, 3, 3, "{}" }
{ 1, true, 950.0, "WINDOW", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4243), "", true, "{}", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4245), "Finestra anta singola 2025", 1, "OFF0000000001", 3.0, 1, 1, "{}" },
{ 2, true, 160.0, "WINDOW", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4252), "", true, "{}", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4253), "Persiana per Finestra anta singola 2025", 1, "OFF0000000002", 3.0, 2, 2, "{}" },
{ 3, true, 200.0, "WINDOW", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4259), "", true, "{}", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4261), "Installazione serramento", 1, "OFF0000000003", 3.0, 3, 3, "{}" }
});
migrationBuilder.InsertData(
@@ -840,16 +840,16 @@ namespace EgwCoreLib.Lux.Data.Migrations
columns: new[] { "StockMovID", "CodDoc", "DtCreate", "MovCod", "Note", "QtyRec", "StockStatusId", "UnitVal", "UserId" },
values: new object[,]
{
{ 1, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9506), "CAR", "DEMO", 5.0, 1, 0.0, "samuele.locatelli@egalware.com" },
{ 2, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9555), "CAR", "DEMO", 8.0, 2, 0.0, "samuele.locatelli@egalware.com" },
{ 3, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9559), "CAR", "DEMO", 5.0, 3, 0.0, "samuele.locatelli@egalware.com" },
{ 4, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9562), "CAR", "DEMO", 1.0, 4, 0.0, "samuele.locatelli@egalware.com" },
{ 5, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9566), "CAR", "DEMO", 10.0, 5, 0.0, "samuele.locatelli@egalware.com" },
{ 6, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9569), "CAR", "DEMO", 1.0, 6, 0.0, "samuele.locatelli@egalware.com" },
{ 7, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9573), "CAR", "DEMO", 50.0, 7, 0.0, "samuele.locatelli@egalware.com" },
{ 8, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9576), "CAR", "DEMO", 1.0, 8, 0.0, "samuele.locatelli@egalware.com" },
{ 9, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9580), "CAR", "DEMO", 1.0, 9, 0.0, "samuele.locatelli@egalware.com" },
{ 10, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9583), "CAR", "DEMO", 1.0, 10, 0.0, "samuele.locatelli@egalware.com" }
{ 1, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3939), "CAR", "DEMO", 5.0, 1, 0.0, "samuele.locatelli@egalware.com" },
{ 2, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3989), "CAR", "DEMO", 8.0, 2, 0.0, "samuele.locatelli@egalware.com" },
{ 3, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3993), "CAR", "DEMO", 5.0, 3, 0.0, "samuele.locatelli@egalware.com" },
{ 4, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3997), "CAR", "DEMO", 1.0, 4, 0.0, "samuele.locatelli@egalware.com" },
{ 5, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4000), "CAR", "DEMO", 10.0, 5, 0.0, "samuele.locatelli@egalware.com" },
{ 6, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4004), "CAR", "DEMO", 1.0, 6, 0.0, "samuele.locatelli@egalware.com" },
{ 7, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4008), "CAR", "DEMO", 50.0, 7, 0.0, "samuele.locatelli@egalware.com" },
{ 8, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4011), "CAR", "DEMO", 1.0, 8, 0.0, "samuele.locatelli@egalware.com" },
{ 9, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4015), "CAR", "DEMO", 1.0, 9, 0.0, "samuele.locatelli@egalware.com" },
{ 10, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4019), "CAR", "DEMO", 1.0, 10, 0.0, "samuele.locatelli@egalware.com" }
});
migrationBuilder.CreateIndex(
@@ -715,13 +715,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
CustomerID = 2,
DealerID = 2,
Description = "Offerta per tre serramenti",
Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9764),
Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9766),
Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4215),
Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4216),
OffertState = 0,
RefNum = 1,
RefRev = 1,
RefYear = 2024,
ValidUntil = new DateTime(2025, 9, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9761)
ValidUntil = new DateTime(2025, 9, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4212)
});
});
@@ -796,14 +796,14 @@ namespace EgwCoreLib.Lux.Data.Migrations
new
{
OfferRowID = 1,
BomOk = false,
BomOk = true,
Cost = 950.0,
Environment = "WINDOW",
Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9790),
Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4243),
ItemBOM = "",
ItemOk = false,
ItemOk = true,
ItemSPP = "{}",
Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9791),
Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4245),
Note = "Finestra anta singola 2025",
OfferID = 1,
OfferRowUID = "OFF0000000001",
@@ -815,14 +815,14 @@ namespace EgwCoreLib.Lux.Data.Migrations
new
{
OfferRowID = 2,
BomOk = false,
BomOk = true,
Cost = 160.0,
Environment = "WINDOW",
Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9798),
Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4252),
ItemBOM = "",
ItemOk = false,
ItemOk = true,
ItemSPP = "{}",
Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9799),
Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4253),
Note = "Persiana per Finestra anta singola 2025",
OfferID = 1,
OfferRowUID = "OFF0000000002",
@@ -834,14 +834,14 @@ namespace EgwCoreLib.Lux.Data.Migrations
new
{
OfferRowID = 3,
BomOk = false,
BomOk = true,
Cost = 200.0,
Environment = "WINDOW",
Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9805),
Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4259),
ItemBOM = "",
ItemOk = false,
ItemOk = true,
ItemSPP = "{}",
Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9806),
Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4261),
Note = "Installazione serramento",
OfferID = 1,
OfferRowUID = "OFF0000000003",
@@ -1382,8 +1382,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 1,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9506),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9552),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3939),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3987),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 5.0,
@@ -1395,8 +1395,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 2,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9555),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9556),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3989),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3991),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 8.0,
@@ -1408,8 +1408,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 3,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9559),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9560),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3993),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3995),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 5.0,
@@ -1421,8 +1421,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 4,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9562),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9564),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3997),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3998),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -1434,8 +1434,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 5,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9566),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9567),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4000),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4002),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 10.0,
@@ -1447,8 +1447,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 6,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9569),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9571),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4004),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4006),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -1460,8 +1460,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 7,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9573),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9574),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4008),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4009),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 50.0,
@@ -1473,8 +1473,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 8,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9576),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9578),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4011),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4013),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -1486,8 +1486,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 9,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9580),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9581),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4015),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4017),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -1499,8 +1499,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 10,
CodDoc = "",
DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9583),
DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9585),
DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4019),
DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4020),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -1811,7 +1811,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.OfferRowModel", b =>
{
b.HasOne("EgwCoreLib.Lux.Data.DbModel.OfferModel", "OfferNav")
.WithMany()
.WithMany("OfferRowNav")
.HasForeignKey("OfferID")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
@@ -1959,6 +1959,11 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Navigation("ItemNav");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.OfferModel", b =>
{
b.Navigation("OfferRowNav");
});
#pragma warning restore 612, 618
}
}
+12 -12
View File
@@ -69,24 +69,24 @@ namespace EgwCoreLib.Lux.Data
// inizializzazione dei valori di default x Item di magazzino
modelBuilder.Entity<ItemModel>().HasData(
// barre grezzo
new ItemModel { ItemID = 1, CodGroup = "WindowTrunk", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 1001, Description = "BARRA-60x80 generica", SupplCode = "BARR.001", Cost = 20, Margin = 0.3, UM = "#" },
new ItemModel { ItemID = 2, CodGroup = "WindowTrunk", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 1002, ExtItemCode = "BARRA-60x80x12000", SupplCode = "ABC.00123.12000", Description = "Barra 60x80, lunghezza 12m", Cost = 16.5, Margin = 0.21, UM = "#" },
new ItemModel { ItemID = 3, CodGroup = "WindowTrunk", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 1003, ExtItemCode = "BARRA-60x80x8000", SupplCode = "ABC.00123.8000", Description = "Barra 60x80, lunghezza 8m", Cost = 17.5, Margin = 0.22, UM = "#" },
new ItemModel { ItemID = 4, CodGroup = "WindowTrunk", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 1004, ExtItemCode = "BARRA-60x80x16000", SupplCode = "ABC.00123.16000", Description = "Barra 60x80, lunghezza 16m", Cost = 15.5, Margin = 0.2, UM = "#" },
new ItemModel { ItemID = 1, CodGroup = "WindowTrunk", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 1001, Description = "BARRA-60x80 generica", SupplCode = "BARR.001", Cost = 20, Margin = 0.3, UM = "#" },
new ItemModel { ItemID = 2, CodGroup = "WindowTrunk", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 1002, ExtItemCode = "BARRA-60x80x12000", SupplCode = "ABC.00123.12000", Description = "Barra 60x80, lunghezza 12m", Cost = 16.5, Margin = 0.21, UM = "#" },
new ItemModel { ItemID = 3, CodGroup = "WindowTrunk", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 1003, ExtItemCode = "BARRA-60x80x8000", SupplCode = "ABC.00123.8000", Description = "Barra 60x80, lunghezza 8m", Cost = 17.5, Margin = 0.22, UM = "#" },
new ItemModel { ItemID = 4, CodGroup = "WindowTrunk", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 1004, ExtItemCode = "BARRA-60x80x16000", SupplCode = "ABC.00123.16000", Description = "Barra 60x80, lunghezza 16m", Cost = 15.5, Margin = 0.2, UM = "#" },
// vetri
new ItemModel { ItemID = 5, CodGroup = "WindowGlass", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 2001, ExtItemCode = "VETRO-3L-THERMO-800x1000", SupplCode = "V3T.800.1000", Description = "Vetro triplo, basso indice termico, 800x1000", Cost = 300, Margin = 0.20, UM = "m2" },
new ItemModel { ItemID = 6, CodGroup = "WindowGlass", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 2002, ExtItemCode = "VETRO-2L-800x1000", SupplCode = "V2.800.1000", Description = "Vetro doppio, 800x1000", Cost = 200, Margin = 0.15, UM = "m2" },
new ItemModel { ItemID = 7, CodGroup = "WindowGlass", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 2003, ExtItemCode = "VETRO-3L-800x1000", SupplCode = "V3.800.1000", Description = "Vetro triplo, 800x1000", Cost = 250, Margin = 0.18, UM = "m2" },
new ItemModel { ItemID = 5, CodGroup = "WindowGlass", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 2001, ExtItemCode = "VETRO-3L-THERMO-800x1000", SupplCode = "V3T.800.1000", Description = "Vetro triplo, basso indice termico, 800x1000", Cost = 300, Margin = 0.20, UM = "m2" },
new ItemModel { ItemID = 6, CodGroup = "WindowGlass", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 2002, ExtItemCode = "VETRO-2L-800x1000", SupplCode = "V2.800.1000", Description = "Vetro doppio, 800x1000", Cost = 200, Margin = 0.15, UM = "m2" },
new ItemModel { ItemID = 7, CodGroup = "WindowGlass", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 2003, ExtItemCode = "VETRO-3L-800x1000", SupplCode = "V3.800.1000", Description = "Vetro triplo, 800x1000", Cost = 250, Margin = 0.18, UM = "m2" },
// vernici
new ItemModel { ItemID = 8, CodGroup = "WindowVarnish", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 3001, ExtItemCode = "VERN-TRASP", SupplCode = "VT.STD", Description = "Vernice trasparente", Cost = 20, Margin = 0.20, UM = "l" },
new ItemModel { ItemID = 8, CodGroup = "WindowVarnish", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 3001, ExtItemCode = "VERN-TRASP", SupplCode = "VT.STD", Description = "Vernice trasparente", Cost = 20, Margin = 0.20, UM = "l" },
// ferramenta
new ItemModel { ItemID = 9, CodGroup = "WindowHardware", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 5001, ExtItemCode = "KIT-001", SupplCode = "AGB-KIT-001", Description = "Kit standard completo AGB tipo 001", Cost = 65, Margin = 0.20, UM = "#" },
new ItemModel { ItemID = 10, CodGroup = "WindowHardware", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 5002, ExtItemCode = "CERN-001", SupplCode = "AGB-CERN-001", Description = "Cerniera AGB tipo 001", Cost = 10, Margin = 0.20, UM = "#" },
new ItemModel { ItemID = 11, CodGroup = "WindowHardware", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 5003, ExtItemCode = "SERR-001", SupplCode = "AGB-SERR-001", Description = "Serratura AGB tipo 001", Cost = 15, Margin = 0.20, UM = "#" },
new ItemModel { ItemID = 12, CodGroup = "WindowHardware", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 5004, ExtItemCode = "MAN-001", SupplCode = "AGB-MAN-001", Description = "Maniglia AGB tipo 001", Cost = 25, Margin = 0.20, UM = "#" }
new ItemModel { ItemID = 9, CodGroup = "WindowHardware", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 5001, ExtItemCode = "KIT-001", SupplCode = "AGB-KIT-001", Description = "Kit standard completo AGB tipo 001", Cost = 65, Margin = 0.20, UM = "#" },
new ItemModel { ItemID = 10, CodGroup = "WindowHardware", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 5002, ExtItemCode = "CERN-001", SupplCode = "AGB-CERN-001", Description = "Cerniera AGB tipo 001", Cost = 10, Margin = 0.20, UM = "#" },
new ItemModel { ItemID = 11, CodGroup = "WindowHardware", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 5003, ExtItemCode = "SERR-001", SupplCode = "AGB-SERR-001", Description = "Serratura AGB tipo 001", Cost = 15, Margin = 0.20, UM = "#" },
new ItemModel { ItemID = 12, CodGroup = "WindowHardware", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 5004, ExtItemCode = "MAN-001", SupplCode = "AGB-MAN-001", Description = "Maniglia AGB tipo 001", Cost = 25, Margin = 0.20, UM = "#" }
);
// inizializzazione dei valori di default x Item di giacenza
@@ -181,6 +181,77 @@ namespace EgwCoreLib.Lux.Data.Services
return result;
}
/// <summary>
/// Elenco completo ItemGroup gestiti
/// </summary>
/// <returns></returns>
public async Task<List<ItemGroupModel>> ItemGroupGetAllAsync()
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
List<ItemGroupModel>? result = new List<ItemGroupModel>();
// cerco in redis...
string currKey = $"{redisBaseKey}:ItemGroup:ALL";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<ItemGroupModel>>($"{rawData}");
source = "REDIS";
}
else
{
result = await dbController.ItemGroupGetAllAsync();
// serializzo e salvo con config x evitare loop...
rawData = JsonConvert.SerializeObject(result, JSSettings);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
}
if (result == null)
{
result = new List<ItemGroupModel>();
}
sw.Stop();
Log.Debug($"ItemGroupGetAllAsync | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// Elenco item da ricerca async
/// </summary>
/// <param name="term"></param>
/// <returns></returns>
public async Task<List<ItemModel>> ItemGetSearchAsync(string term)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
List<ItemModel>? result = new List<ItemModel>();
// cerco in redis...
string token = string.IsNullOrEmpty(term) ? "ALL" : term;
string currKey = $"{redisBaseKey}:Item:{token}";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<ItemModel>>($"{rawData}");
source = "REDIS";
}
else
{
result = await dbController.ItemGetSearchAsync(term);
// serializzo e salvo con config x evitare loop...
rawData = JsonConvert.SerializeObject(result, JSSettings);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
}
if (result == null)
{
result = new List<ItemModel>();
}
sw.Stop();
Log.Debug($"ItemGetSearchAsync | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// Elenco righe offerta specificata
/// </summary>
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>0.9.2508.0816</Version>
<Version>0.9.2508.0818</Version>
</PropertyGroup>
<ItemGroup>
+1
View File
@@ -13,6 +13,7 @@
<link rel="stylesheet" href="lib/bootstrap-icons/font/bootstrap-icons.min.css" />
<link rel="stylesheet" href="css/site.min.css" />
<link rel="stylesheet" href="css/fonts.min.css" />
<link rel="stylesheet" href="css/textures.min.css" />
@* <link rel="stylesheet" href="app.css" /> *@
<link rel="stylesheet" href="Lux.UI.styles.css" />
+1 -1
View File
@@ -34,7 +34,7 @@
<div class="col-2">
<div class="form-floating mb-3">
<select @bind="@CurrRecord.OffertState" class="form-select">
@foreach (var item in System.Enum.GetValues(typeof(EgwCoreLib.Lux.Core.Enum.OfferStates)))
@foreach (var item in System.Enum.GetValues(typeof(EgwCoreLib.Lux.Core.Enums.OfferStates)))
{
<option value="@item">@item</option>
}
+5 -5
View File
@@ -33,7 +33,7 @@ else
<table class="table table-sm table-striped">
<thead>
<tr>
@if (DisplayMode == EgwCoreLib.Lux.Core.Enum.DisplayMode.Edit)
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
{
<th>Def</th>
<th>img</th>
@@ -47,7 +47,7 @@ else
<th class="text-end">Qty</th>
<th class="text-end">Importo </th>
<th class="text-end">Tot</th>
@if (DisplayMode == EgwCoreLib.Lux.Core.Enum.DisplayMode.Edit)
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
{
<th class="text-end" title="Cambio Materiali">Mat.</th>
}
@@ -58,7 +58,7 @@ else
{
<tr>
<td>
@if (DisplayMode == EgwCoreLib.Lux.Core.Enum.DisplayMode.Edit)
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
{
<button class="btn btn-sm btn-info" @onclick="() => DoEdit(item)"><i class="fa-solid fa-pencil"></i></button>
}
@@ -67,7 +67,7 @@ else
@item.RowNum
}
</td>
@if (DisplayMode == EgwCoreLib.Lux.Core.Enum.DisplayMode.Edit)
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
{
<td>
<img class="img-fluid" src="@(imgUrl(item.OfferRowUID, item.Environment))" width="48" />
@@ -84,7 +84,7 @@ else
@($"{item.Cost:C2}")
</td>
<td class="text-end fw-bold">@($"{item.TotalCost:C2}")</td>
@if (DisplayMode == EgwCoreLib.Lux.Core.Enum.DisplayMode.Edit)
@if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit)
{
<td class="text-end">
<button class="btn btn-sm btn-info" title="cambio materiali assegnati"><i class="fa-solid fa-arrow-right-arrow-left"></i></button>
+1 -1
View File
@@ -3,7 +3,7 @@ using EgwCoreLib.Lux.Data.DbModel;
using EgwCoreLib.Lux.Data.Services;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using static EgwCoreLib.Lux.Core.Enum;
using static EgwCoreLib.Lux.Core.Enums;
namespace Lux.UI.Components.Compo
{
+10 -4
View File
@@ -33,6 +33,12 @@
}
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="Items">
<span class="fa-solid fa-book px-2 fs-4" aria-hidden="true"></span> <span class="@hideText">Articoli</span>
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="Offers">
@@ -40,11 +46,11 @@
</NavLink>
</div>
<div class="nav-item px-3">
@* <div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
<span class="bi bi-list-ol px-2 fs-4" aria-hidden="true"></span> <span class="@hideText">Counter</span>
</NavLink>
</div>
</div> *@
<div class="nav-item px-3">
<NavLink class="nav-link" href="scratch">
@@ -89,8 +95,8 @@
</NotAuthorized>
</AuthorizeView>
<div class="nav-item px-3">
<NavLink class="nav-link" href="ResetCache">
<span class="fa-solit fa-arrows-rotate px-2 fs-4" aria-hidden="true"></span> <span class="@hideText">Flush Cache</span>
<NavLink class="nav-link bg-dark bg-opacity-50 bg-gradient" href="ResetCache">
<span class="fa-solid fa-arrows-rotate px-2 fs-4" aria-hidden="true"></span> <span class="@hideText">Flush Cache</span>
</NavLink>
</div>
</nav>
+110
View File
@@ -0,0 +1,110 @@
@page "/Items"
<div class="card shadow">
<div class="card-header">
<div class=" d-flex justify-content-between">
<div class="px-0 fs-3">
<b>Articoli</b>
</div>
<div class="px-0 d-flex justify-content-between">
<div class="px-0">
@if (!string.IsNullOrEmpty(SelCodGroup))
{
<button class="btn btn-sm btn-success" @onclick="DoAdd"><i class="fa-solid fa-cart-plus"></i> Nuovo</button>
}
</div>
<div class="px-1">
<div class="input-group input-group-sm">
<span class="input-group-text">Gruppo</span>
<select @bind="@SelCodGroup" class="form-select">
<option value="">--- Sel. Gruppo ---</option>
@foreach (var item in ListItemGroup)
{
<option value="@item.CodGroup">@item.Description</option>
}
</select>
<span class="input-group-text">Tipo</span>
<select @bind="@SelType" class="form-select">
<option value="">--- Sel. Tipo ---</option>
@foreach (var sType in Enum.GetValues(typeof(EgwCoreLib.Lux.Core.Enums.ItemClassType)))
{
<option value="@sType">@sType</option>
}
</select>
</div>
</div>
<div class="px-1">
<div class="input-group input-group-sm" title="ricerca">
<span class="input-group-text"><i class="fas fa-search"></i></span>
<input type="text" class="form-control" @bind="@searchVal">
<button class="btn btn-outline-secondary" @onclick="resetSearch"><i class="fas fa-ban"></i></button>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
@if (isLoading || ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-info text-center display-4">Nessun record trovato</div>
}
else
{
<table class="table table-sm table-striped">
<thead>
<tr>
<th>
<button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button>
</th>
<th>ID</th>
<th>Gruppo</th>
<th>Tipo</th>
<th>Serv</th>
<th>Codice</th>
<th>ItemCode</th>
<th>Suppl.Code</th>
<th>Descrizione</th>
<th class="text-end">Costo</th>
<th class="text-end">Margine</th>
<th class="text-end">Qty min</th>
<th class="text-end">Qty Max</th>
<th class="text-end">UM</th>
</tr>
</thead>
<tbody>
@foreach (var item in ListRecords)
{
<tr>
<td></td>
<td>@item.ItemID</td>
<td>@item.CodGroup</td>
<td>@item.ItemType</td>
<td>@item.IsService</td>
<td>@item.ItemCode</td>
<td>@item.ExtItemCode</td>
<td>@item.SupplCode</td>
<td>@item.Description</td>
<td>@item.Cost.ToString("C3")</td>
<td>@item.Margin.ToString("P1")</td>
<td>@item.QtyMin.ToString("F1")</td>
<td>@item.QtyMax.ToString("F1")</td>
<td>@item.UM</td>
</tr>
}
</tbody>
<tfoot>
<tr>
<td colspan="14">
<EgwCoreLib.Razor.DataPager currPage="@currPage" PageSize="@numRecord" totalCount="@totalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
</td>
</tr>
</tfoot>
</table>
}
</div>
</div>
+111
View File
@@ -0,0 +1,111 @@
using EgwCoreLib.Lux.Data.DbModel;
using EgwCoreLib.Lux.Data.Services;
using Microsoft.AspNetCore.Components;
namespace Lux.UI.Components.Pages
{
public partial class Items
{
#region Protected Fields
protected List<ItemModel> AllRecords = new List<ItemModel>();
protected List<ItemGroupModel> ListItemGroup = new List<ItemGroupModel>();
protected List<ItemModel> ListRecords = new List<ItemModel>();
protected string searchVal = "";
protected string? SelCodGroup = null;
protected EgwCoreLib.Lux.Core.Enums.ItemClassType? SelType = null;
#endregion Protected Fields
#region Protected Properties
[Inject]
protected DataLayerServices DLService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected void DoAdd()
{
EditRecord = new ItemModel()
{
CodGroup = ListItemGroup.FirstOrDefault()?.CodGroup ?? "",
ItemType = EgwCoreLib.Lux.Core.Enums.ItemClassType.ND,
IsService = false,
ItemCode = 0,
ExtItemCode = "NEW-ITEM",
SupplCode = "",
Description = $"Nuova Offerta {DateTime.Today:ddd yyyy.MM.dd}",
Cost = 0,
Margin = 0,
QtyMin = 0,
QtyMax = 0,
UM = "#"
};
}
protected override async Task OnInitializedAsync()
{
isLoading = true;
await ReloadBaseData();
await ReloadData();
UpdateTable();
}
protected void resetSearch()
{
searchVal = "";
}
#endregion Protected Methods
#region Private Fields
private int currPage = 1;
private ItemModel? EditRecord = null;
private bool isLoading = false;
private int numRecord = 10;
private int totalCount = 0;
protected void DoReset()
{
EditRecord = null;
}
#endregion Private Fields
#region Private Methods
private async Task ReloadBaseData()
{
ListItemGroup = await DLService.ItemGroupGetAllAsync();
}
private async Task ReloadData()
{
isLoading = true;
AllRecords = await DLService.ItemGetSearchAsync(searchVal);
totalCount = AllRecords.Count;
}
/// <summary>
/// Filtro e paginazione
/// </summary>
private void UpdateTable()
{
// fix paginazione
ListRecords = AllRecords
.Skip(numRecord * (currPage - 1))
.Take(numRecord)
.ToList();
isLoading = false;
}
#endregion Private Methods
}
}
+2 -2
View File
@@ -67,7 +67,7 @@
}
else if (currStep == CompileStep.Rows)
{
<OfferRowMan OfferID="@EditRecord.OfferID" DisplayMode="EgwCoreLib.Lux.Core.Enum.DisplayMode.Edit"></OfferRowMan>
<OfferRowMan OfferID="@EditRecord.OfferID" DisplayMode="EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit"></OfferRowMan>
}
else if (currStep == CompileStep.Delivery)
{
@@ -176,7 +176,7 @@ else
@if (SelRecord != null)
{
<div class="col-6">
<OfferRowMan OfferID="@SelRecord.OfferID" DisplayMode="EgwCoreLib.Lux.Core.Enum.DisplayMode.Preview"></OfferRowMan>
<OfferRowMan OfferID="@SelRecord.OfferID" DisplayMode="EgwCoreLib.Lux.Core.Enums.DisplayMode.Preview"></OfferRowMan>
</div>
}
</div>
+5 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
<Version>0.9.2508.0816</Version>
<Version>0.9.2508.0818</Version>
</PropertyGroup>
<ItemGroup>
@@ -42,6 +42,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\images\textures\" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
</Target>
+4
View File
@@ -14,5 +14,9 @@
{
"outputFile": "Components/Layout/MainLayout.razor.css",
"inputFile": "Components/Layout/MainLayout.razor.less"
},
{
"outputFile": "wwwroot/css/textures.css",
"inputFile": "wwwroot/css/textures.less"
}
]
+18
View File
@@ -0,0 +1,18 @@
.wood-01 {
/*background-color: #FB8004;*/
background-image: url('../images/textures/wood-01.jpg');
/* path to your wood texture */
background-repeat: repeat;
/* repeat both horizontally & vertically */
background-size: 100px 100px;
/* adjust size as needed */
}
.wood-02 {
/*background-color: #CC6600;*/
background-image: url('../images/textures/wood-02.jpg');
/* path to your wood texture */
background-repeat: repeat;
/* repeat both horizontally & vertically */
background-size: 50px 150px;
/* adjust size as needed */
}
+12
View File
@@ -0,0 +1,12 @@
.wood-01 {
/*background-color: #FB8004;*/
background-image: url('../images/textures/wood-01.jpg'); /* path to your wood texture */
background-repeat: repeat; /* repeat both horizontally & vertically */
background-size: 100px 100px; /* adjust size as needed */
}
.wood-02 {
/*background-color: #CC6600;*/
background-image: url('../images/textures/wood-02.jpg'); /* path to your wood texture */
background-repeat: repeat; /* repeat both horizontally & vertically */
background-size: 50px 150px; /* adjust size as needed */
}
+1
View File
@@ -0,0 +1 @@
.wood-01{background-image:url('../images/textures/wood-01.jpg');background-repeat:repeat;background-size:100px 100px;}.wood-02{background-image:url('../images/textures/wood-02.jpg');background-repeat:repeat;background-size:50px 150px;}
Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>LUX - Web Windows MES</i>
<h4>Versione: 0.9.2508.0816</h4>
<h4>Versione: 0.9.2508.0818</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
0.9.2508.0816
0.9.2508.0818
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2508.0816</version>
<version>0.9.2508.0818</version>
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>