Merge branch 'release/MoveCompoGroup'
This commit is contained in:
@@ -57,6 +57,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public bool IsNote => SellingItemID == null;
|
||||
|
||||
/// <summary>
|
||||
/// Riferimento (opzionale) al template da cui è derivato
|
||||
/// </summary>
|
||||
@@ -69,16 +70,6 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
|
||||
public bool CalcEnabled
|
||||
{
|
||||
get => ImgType == ImageType.Calculated;
|
||||
#if false
|
||||
{
|
||||
bool answ = false;
|
||||
if (SellingItemNav != null)
|
||||
{
|
||||
answ = SellingItemNav.SourceType == ItemSourceType.Jwd || SellingItemNav.SourceType == ItemSourceType.FileBTL;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils
|
||||
|
||||
if (currRec == null)
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -99,12 +99,12 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils
|
||||
|
||||
// 5. Salvo tutto in transazione
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -170,12 +170,12 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils
|
||||
dbCtx.Entry(row).State = EntityState.Modified;
|
||||
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils
|
||||
|
||||
if (currRec == null)
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -89,12 +89,12 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils
|
||||
dbCtx.DbSetTemplateRow.Add(newRec);
|
||||
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -143,12 +143,12 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils
|
||||
dbCtx.Entry(row).State = EntityState.Modified;
|
||||
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,11 +266,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
}
|
||||
}
|
||||
}
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
await tx.CommitAsync();
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,13 +54,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Job
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -126,13 +126,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Job
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,13 +54,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Job
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -125,13 +125,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Job
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -177,13 +177,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Job
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,13 +117,14 @@ namespace EgwCoreLib.Lux.Data.Repository.Production
|
||||
|
||||
// salvo TUTTI i cambiamenti...
|
||||
answ = await dbCtx.SaveChangesAsync() > 0;
|
||||
await tx.CommitAsync();
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Production
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
return totUpd;
|
||||
@@ -74,7 +74,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Production
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
return totUpd;
|
||||
@@ -106,7 +106,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Production
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
return numItem;
|
||||
|
||||
@@ -145,12 +145,12 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
|
||||
// 5. Salvo tutto in transazione
|
||||
await dbCtx.SaveChangesAsync();
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -230,13 +230,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,35 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
|
||||
public async Task<bool> AddAsync(OfferRowModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
await using var dbCtx = await CreateContextAsync(); await using var tx = await dbCtx.Database.BeginTransactionAsync();
|
||||
try
|
||||
{
|
||||
// SE ci fossero righe di indice pari o superiore le deve spostare...
|
||||
// 2. Recupero i record successivi da shiftare
|
||||
var list2Move = await dbCtx.DbSetOfferRow
|
||||
.Where(x => x.OfferID == entity.OfferID && x.RowNum >= entity.RowNum)
|
||||
.ToListAsync();
|
||||
|
||||
// aggiungo record
|
||||
await dbCtx.DbSetOfferRow.AddAsync(entity);
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
foreach (var item in list2Move)
|
||||
{
|
||||
item.RowNum++;
|
||||
dbCtx.Entry(item).State = EntityState.Modified;
|
||||
}
|
||||
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteAsync(OfferRowModel entity)
|
||||
@@ -57,13 +83,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -125,13 +151,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,13 +251,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,13 +61,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -146,13 +146,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -335,13 +335,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -379,13 +379,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return numDone;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Stats
|
||||
answ = await dbCtx.SaveChangesAsync();
|
||||
|
||||
// commit transazione
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
// libero memoria del changeTracker
|
||||
dbCtx.ChangeTracker.Clear();
|
||||
@@ -98,7 +98,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Stats
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Stats
|
||||
// salvo!
|
||||
answ = await dbCtx.SaveChangesAsync();
|
||||
// commit transazione
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
// libero memoria del changeTracker
|
||||
dbCtx.ChangeTracker.Clear();
|
||||
@@ -122,7 +122,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Stats
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,13 +58,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@@ -131,13 +131,13 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils
|
||||
bool done = await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
if (done)
|
||||
tx.Commit();
|
||||
await tx.CommitAsync();
|
||||
|
||||
return done;
|
||||
}
|
||||
catch
|
||||
{
|
||||
tx.Rollback();
|
||||
await tx.RollbackAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>1.1.2603.2413</Version>
|
||||
<Version>1.1.2603.2416</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
+25
-24
@@ -1,4 +1,4 @@
|
||||
namespace Lux.UI.Components.Compo
|
||||
namespace Lux.UI.Components.Compo.Common
|
||||
{
|
||||
public partial class CmpFooter : IDisposable
|
||||
{
|
||||
@@ -16,15 +16,30 @@ namespace Lux.UI.Components.Compo
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected DateTime adesso = DateTime.Now;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var rawVers = typeof(Program).Assembly.GetName().Version;
|
||||
version = rawVers != null ? rawVers : new Version("0.0.0.0");
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private DateTime adesso = DateTime.Now;
|
||||
|
||||
private System.Timers.Timer aTimer = null!;
|
||||
|
||||
private Version? version = null!;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
@@ -34,14 +49,7 @@ namespace Lux.UI.Components.Compo
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var rawVers = typeof(Program).Assembly.GetName().Version;
|
||||
version = rawVers != null ? rawVers : new Version("0.0.0.0");
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
protected void StartTimer()
|
||||
private void StartTimer()
|
||||
{
|
||||
if (aTimer != null)
|
||||
{
|
||||
@@ -59,13 +67,6 @@ namespace Lux.UI.Components.Compo
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private System.Timers.Timer aTimer = null!;
|
||||
private Version? version = null!;
|
||||
|
||||
#endregion Private Fields
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
+33
-37
@@ -6,7 +6,7 @@ using EgwCoreLib.Lux.Data.Services.Items;
|
||||
using EgwMultiEngineManager.Data;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Lux.UI.Components.Compo
|
||||
namespace Lux.UI.Components.Compo.Common
|
||||
{
|
||||
public partial class EditBom
|
||||
{
|
||||
@@ -26,29 +26,8 @@ namespace Lux.UI.Components.Compo
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected bool showMassEditSave
|
||||
{
|
||||
get => bomDict != null && bomDict.Any(x => x.isSelected);
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task ForceItemPrice()
|
||||
{
|
||||
isLoading = true;
|
||||
// chiamo metodo update x i soli valori selezionati...
|
||||
var list2upd = bomDict.Where(x => x.isSelected).Cast<BomItemDTO>().ToList();
|
||||
await IService.MassUpdateAsync(list2upd, totCost, (double)defMargin, defQtyMax, defUM, defRound);
|
||||
// ...e passo al controller parent LINQ projection to base type
|
||||
List<BomItemDTO> baseList = bomDict.Cast<BomItemDTO>().ToList();
|
||||
await EC_Updated.InvokeAsync(baseList);
|
||||
SelAll = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Conversione oggetti x editing
|
||||
/// </summary>
|
||||
@@ -86,6 +65,20 @@ namespace Lux.UI.Components.Compo
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Protected Classes
|
||||
|
||||
protected class BomDtoSel : BomItemDTO
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public bool isSelected { get; set; } = false;
|
||||
public int numRow { get; set; } = 1;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Protected Classes
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
@@ -121,20 +114,6 @@ namespace Lux.UI.Components.Compo
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Protected Classes
|
||||
|
||||
protected class BomDtoSel : BomItemDTO
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public bool isSelected { get; set; } = false;
|
||||
public int numRow { get; set; } = 1;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Protected Classes
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
@@ -185,6 +164,11 @@ namespace Lux.UI.Components.Compo
|
||||
}
|
||||
}
|
||||
|
||||
private bool showMassEditSave
|
||||
{
|
||||
get => bomDict != null && bomDict.Any(x => x.isSelected);
|
||||
}
|
||||
|
||||
private bool ShowVolume
|
||||
{
|
||||
get => CurrRowRec.Envir == Constants.EXECENVIRONMENTS.BEAM || CurrRowRec.Envir == Constants.EXECENVIRONMENTS.WALL;
|
||||
@@ -248,7 +232,7 @@ namespace Lux.UI.Components.Compo
|
||||
/// <summary>
|
||||
/// Salvataggio con conversion a list + ritorno a parent
|
||||
/// </summary>
|
||||
private async Task DoSave()
|
||||
private Task DoSave()
|
||||
{
|
||||
isLoading = true;
|
||||
// aggiorno l'oggetto nel mio dizionario
|
||||
@@ -261,7 +245,19 @@ namespace Lux.UI.Components.Compo
|
||||
DoCancel();
|
||||
// ...e passo al controller parent LINQ projection to base type
|
||||
List<BomItemDTO> baseList = bomDict.Cast<BomItemDTO>().ToList();
|
||||
return EC_Updated.InvokeAsync(baseList);
|
||||
}
|
||||
|
||||
private async Task ForceItemPrice()
|
||||
{
|
||||
isLoading = true;
|
||||
// chiamo metodo update x i soli valori selezionati...
|
||||
var list2upd = bomDict.Where(x => x.isSelected).Cast<BomItemDTO>().ToList();
|
||||
await IService.MassUpdateAsync(list2upd, totCost, (double)defMargin, defQtyMax, defUM, defRound);
|
||||
// ...e passo al controller parent LINQ projection to base type
|
||||
List<BomItemDTO> baseList = bomDict.Cast<BomItemDTO>().ToList();
|
||||
await EC_Updated.InvokeAsync(baseList);
|
||||
SelAll = false;
|
||||
}
|
||||
|
||||
private void SaveNumRec(int newNum)
|
||||
+1
-1
@@ -3,7 +3,7 @@ using EgwCoreLib.Lux.Data.Services.Utils;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace Lux.UI.Components.Compo
|
||||
namespace Lux.UI.Components.Compo.Generic
|
||||
{
|
||||
public partial class GenClassMan
|
||||
{
|
||||
+90
-93
@@ -3,7 +3,7 @@ using EgwCoreLib.Lux.Data.Services.Utils;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace Lux.UI.Components.Compo
|
||||
namespace Lux.UI.Components.Compo.Generic
|
||||
{
|
||||
public partial class GenValMan
|
||||
{
|
||||
@@ -59,30 +59,77 @@ namespace Lux.UI.Components.Compo
|
||||
|
||||
#endregion Public Classes
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected List<GenValueModel> AllRecords = new List<GenValueModel>();
|
||||
protected List<GenValueModel> ListRecords = new List<GenValueModel>();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected IGenValService GVService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
if (!SelFilt.Equals(actFilt) || true)
|
||||
{
|
||||
actFilt = SelFilt;
|
||||
await ReloadDataAsync();
|
||||
UpdateTable();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private FiltSelect actFilt = new FiltSelect();
|
||||
|
||||
private List<GenValueModel> AllRecords = new List<GenValueModel>();
|
||||
|
||||
private int currPage = 1;
|
||||
|
||||
private GenValueModel? EditRecord = null;
|
||||
|
||||
private bool isLoading = false;
|
||||
|
||||
private List<GenValueModel> ListRecords = new List<GenValueModel>();
|
||||
|
||||
private int numRecord = 10;
|
||||
|
||||
private GenValueModel? SelRecord = null;
|
||||
|
||||
private int totalCount = 0;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
private IGenValService GVService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private Task DoAdd()
|
||||
{
|
||||
// aggiungo un nuovo record in coda...
|
||||
EditRecord = new GenValueModel()
|
||||
{
|
||||
ClassCod = actFilt.SelCodGroup,
|
||||
ValString = $"Nuovo-{DateTime.Now:yy.MM.ss HH.mm.ss}",
|
||||
Index = totalCount + 1
|
||||
};
|
||||
return DoSave(EditRecord);
|
||||
}
|
||||
|
||||
private async Task DoCancel()
|
||||
{
|
||||
await ResetEdit();
|
||||
UpdateTable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clona record
|
||||
/// </summary>
|
||||
/// <param name="curRec"></param>
|
||||
protected void DoClone(GenValueModel curRec)
|
||||
private void DoClone(GenValueModel curRec)
|
||||
{
|
||||
#if false
|
||||
editRecord = new ItemModel()
|
||||
@@ -108,7 +155,7 @@ namespace Lux.UI.Components.Compo
|
||||
/// impossta record x eliminazione
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
protected async Task DoDelete(GenValueModel selRec)
|
||||
private async Task DoDelete(GenValueModel selRec)
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Sicuro di voler eliminare il record? Dettagli: {selRec.ClassCod} | {selRec.ValString}"))
|
||||
return;
|
||||
@@ -126,7 +173,7 @@ namespace Lux.UI.Components.Compo
|
||||
/// Edit articolo selezionato
|
||||
/// </summary>
|
||||
/// <param name="curRec"></param>
|
||||
protected void DoEdit(GenValueModel curRec)
|
||||
private void DoEdit(GenValueModel curRec)
|
||||
{
|
||||
EditRecord = curRec;
|
||||
}
|
||||
@@ -134,82 +181,11 @@ namespace Lux.UI.Components.Compo
|
||||
/// <summary>
|
||||
/// Reset selezione
|
||||
/// </summary>
|
||||
protected void DoReset()
|
||||
private void DoReset()
|
||||
{
|
||||
EditRecord = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selezione articolo x display info
|
||||
/// </summary>
|
||||
/// <param name="curRec"></param>
|
||||
protected void DoSelect(GenValueModel curRec)
|
||||
{
|
||||
SelRecord = curRec;
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
if (!SelFilt.Equals(actFilt) || true)
|
||||
{
|
||||
actFilt = SelFilt;
|
||||
await ReloadDataAsync();
|
||||
UpdateTable();
|
||||
}
|
||||
}
|
||||
|
||||
protected void SaveNumRec(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
UpdateTable();
|
||||
}
|
||||
|
||||
protected void SavePage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
UpdateTable();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private FiltSelect actFilt = new FiltSelect();
|
||||
|
||||
private int currPage = 1;
|
||||
|
||||
private GenValueModel? EditRecord = null;
|
||||
|
||||
private bool isLoading = false;
|
||||
|
||||
private int numRecord = 10;
|
||||
|
||||
private GenValueModel? SelRecord = null;
|
||||
|
||||
private int totalCount = 0;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private Task DoAdd()
|
||||
{
|
||||
// aggiungo un nuovo record in coda...
|
||||
EditRecord = new GenValueModel()
|
||||
{
|
||||
ClassCod = actFilt.SelCodGroup,
|
||||
ValString = $"Nuovo-{DateTime.Now:yy.MM.ss HH.mm.ss}",
|
||||
Index = totalCount + 1
|
||||
};
|
||||
return DoSave(EditRecord);
|
||||
}
|
||||
|
||||
private async Task DoCancel()
|
||||
{
|
||||
await ResetEdit();
|
||||
UpdateTable();
|
||||
}
|
||||
|
||||
private async Task DoSave(GenValueModel currRec)
|
||||
{
|
||||
// salvo
|
||||
@@ -220,6 +196,15 @@ namespace Lux.UI.Components.Compo
|
||||
SelRecord = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selezione articolo x display info
|
||||
/// </summary>
|
||||
/// <param name="curRec"></param>
|
||||
private void DoSelect(GenValueModel curRec)
|
||||
{
|
||||
SelRecord = curRec;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue spostamento
|
||||
/// </summary>
|
||||
@@ -262,6 +247,18 @@ namespace Lux.UI.Components.Compo
|
||||
return ReloadDataAsync();
|
||||
}
|
||||
|
||||
private void SaveNumRec(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
UpdateTable();
|
||||
}
|
||||
|
||||
private void SavePage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
UpdateTable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Filtro e paginazione
|
||||
/// </summary>
|
||||
+1
-2
@@ -1,13 +1,12 @@
|
||||
using EgwCoreLib.Lux.Core;
|
||||
using EgwCoreLib.Lux.Core.RestPayload;
|
||||
using EgwCoreLib.Lux.Data.DbModel.Sales;
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using EgwCoreLib.Lux.Data.Services.Config;
|
||||
using EgwCoreLib.Lux.Data.Services.General;
|
||||
using EgwCoreLib.Lux.Data.Services.Utils;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Lux.UI.Components.Compo
|
||||
namespace Lux.UI.Components.Compo.Offer
|
||||
{
|
||||
public partial class OfferCommonPar
|
||||
{
|
||||
+1
-1
@@ -2,7 +2,7 @@ using EgwCoreLib.Lux.Core;
|
||||
using EgwCoreLib.Lux.Data.DbModel.Sales;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Lux.UI.Components.Compo
|
||||
namespace Lux.UI.Components.Compo.Offer
|
||||
{
|
||||
public partial class OfferDelivery
|
||||
{
|
||||
+1
-1
@@ -4,7 +4,7 @@ using EgwCoreLib.Lux.Data.DbModel.Sales;
|
||||
using EgwCoreLib.Lux.Data.Services.Sales;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Lux.UI.Components.Compo
|
||||
namespace Lux.UI.Components.Compo.Offer
|
||||
{
|
||||
/// <summary>
|
||||
/// Componente per la gestione delle offerte.
|
||||
+22
-15
@@ -47,7 +47,7 @@ else
|
||||
<button class="btn btn-sm btn-success" @onclick="() => DoSelectItem()">Prodotto a Catalogo <i class="fa-solid fa-plus"></i></button>
|
||||
</div>
|
||||
<div class="px-1">
|
||||
<button class="btn btn-sm btn-success" @onclick="() => DoAddNote()">Nota <i class="fa-solid fa-plus"></i></button>
|
||||
<button class="btn btn-sm @noteCss" @onclick="() => DoAddNote()">Nota <i class="fa-solid fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -118,18 +118,13 @@ else
|
||||
<tbody>
|
||||
@foreach (var item in ListRecords)
|
||||
{
|
||||
bool isBuy = (item.SellingItemID > 2 && item.SellingItemID < 5);
|
||||
<tr class="@RowClass(item)">
|
||||
<td class="text-nowrap">
|
||||
@if (DisplayMode == DisplayMode.Preview)
|
||||
{
|
||||
@if (isBuy)
|
||||
if (item.CalcEnabled)
|
||||
{
|
||||
<img class="img-fluid p-1" src="@(imgUrl(item.ImgType, item.ImgUID, $"{item.Envir}"))" width="48" @onclick="() => ReqEditRow()" />
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (item.Envir == EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW)
|
||||
if (item.Envir == EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW)
|
||||
{
|
||||
<img class="img-fluid image-hover-pop p-1" src="@(imgUrl(item.ImgType, item.ImgUID, $"{item.Envir}"))" width="48" @onclick="() => ReqEditRow()" title="Edit Item" />
|
||||
}
|
||||
@@ -138,6 +133,15 @@ else
|
||||
<img class="img-fluid image-hover-pop" src="@(imgUrl(item.ImgType, item.ImgUID, $"{item.Envir}"))" width="64" @onclick="() => ReqEditRow()" title="Edit Item" />
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!item.IsNote)
|
||||
{
|
||||
|
||||
<img class="img-fluid p-1" src="@(imgUrl(item.ImgType, item.ImgUID, $"{item.Envir}"))" width="48" @onclick="() => ReqEditRow()" />
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -185,13 +189,9 @@ else
|
||||
@if (DisplayMode == DisplayMode.Edit)
|
||||
{
|
||||
<td>
|
||||
@if (isBuy)
|
||||
@if (item.CalcEnabled)
|
||||
{
|
||||
<img class="img-fluid p-1" src="@(imgUrl(item.ImgType, item.ImgUID, $"{item.Envir}"))" width="64" />
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (item.Envir == EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW)
|
||||
if (item.Envir == EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW)
|
||||
{
|
||||
<img class="img-fluid image-hover-pop p-1" src="@(imgUrl(item.ImgType, item.ImgUID, $"{item.Envir}"))" width="64" @onclick="() => DoEditJwd(item)" title="Edit Item" />
|
||||
}
|
||||
@@ -200,6 +200,13 @@ else
|
||||
<img class="img-fluid image-hover-pop" src="@(imgUrl(item.ImgType, item.ImgUID, $"{item.Envir}"))" width="150" @onclick="() => DoEditFile(item)" title="Edit Item" />
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!item.IsNote)
|
||||
{
|
||||
<img class="img-fluid p-1" src="@(imgUrl(item.ImgType, item.ImgUID, $"{item.Envir}"))" width="64" />
|
||||
}
|
||||
}
|
||||
</td>
|
||||
}
|
||||
<td>
|
||||
@@ -230,7 +237,7 @@ else
|
||||
}
|
||||
}
|
||||
</li>
|
||||
@if (!isBuy)
|
||||
@if (item.CalcEnabled)
|
||||
{
|
||||
@if (item.Envir != EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW || !string.IsNullOrEmpty(item.FileName))
|
||||
{
|
||||
+3
-2
@@ -6,7 +6,6 @@ using EgwCoreLib.Lux.Data.DbModel.Config;
|
||||
using EgwCoreLib.Lux.Data.DbModel.Sales;
|
||||
using EgwCoreLib.Lux.Data.DbModel.Utils;
|
||||
using EgwCoreLib.Lux.Data.Domains;
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using EgwCoreLib.Lux.Data.Services.Config;
|
||||
using EgwCoreLib.Lux.Data.Services.General;
|
||||
using EgwCoreLib.Lux.Data.Services.Items;
|
||||
@@ -22,7 +21,7 @@ using WebWindowComplex.DTO;
|
||||
using static EgwCoreLib.Lux.Core.Enums;
|
||||
using static WebWindowComplex.LayoutConst;
|
||||
|
||||
namespace Lux.UI.Components.Compo
|
||||
namespace Lux.UI.Components.Compo.Offer
|
||||
{
|
||||
public partial class OfferRowMan : IDisposable
|
||||
{
|
||||
@@ -418,6 +417,8 @@ namespace Lux.UI.Components.Compo
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private string noteCss => EditRecord == null ? "btn-success" : "btn-primary bg-gradient";
|
||||
|
||||
/// <summary>
|
||||
/// Effettua vera richiesta della BOM
|
||||
/// </summary>
|
||||
+1
-1
@@ -22,7 +22,7 @@ using WebWindowComplex;
|
||||
using WebWindowComplex.DTO;
|
||||
using static EgwCoreLib.Lux.Core.Enums;
|
||||
|
||||
namespace Lux.UI.Components.Compo
|
||||
namespace Lux.UI.Components.Compo.Order
|
||||
{
|
||||
public partial class OrderRowMan : IDisposable
|
||||
{
|
||||
@@ -1,27 +1,39 @@
|
||||
using EgwCoreLib.Lux.Data.DbModel.Items;
|
||||
using EgwCoreLib.Lux.Data.DbModel.Utils;
|
||||
using EgwCoreLib.Lux.Data.Services.Utils;
|
||||
using Lux.UI.Components.Compo;
|
||||
using Lux.UI.Components.Compo.Generic;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Lux.UI.Components.Pages
|
||||
{
|
||||
public partial class GenList
|
||||
{
|
||||
#region Protected Fields
|
||||
#region Protected Methods
|
||||
|
||||
protected List<GenClassModel> ListGenClass = new List<GenClassModel>();
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
isLoading = true;
|
||||
return ReloadBaseData();
|
||||
}
|
||||
|
||||
#endregion Protected Fields
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Protected Properties
|
||||
#region Private Fields
|
||||
|
||||
protected GenValMan.FiltSelect CurrFilt { get; set; } = new GenValMan.FiltSelect();
|
||||
private ItemModel? editRecord = null;
|
||||
private bool isLoading = false;
|
||||
private List<GenClassModel> ListGenClass = new List<GenClassModel>();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private GenValMan.FiltSelect CurrFilt { get; set; } = new GenValMan.FiltSelect();
|
||||
|
||||
[Inject]
|
||||
protected IGenClassService DLService { get; set; } = null!;
|
||||
private IGenClassService DLService { get; set; } = null!;
|
||||
|
||||
protected string SearchVal
|
||||
private string SearchVal
|
||||
{
|
||||
get => CurrFilt.SearchVal;
|
||||
set
|
||||
@@ -32,7 +44,7 @@ namespace Lux.UI.Components.Pages
|
||||
}
|
||||
}
|
||||
|
||||
protected string SelCodGroup
|
||||
private string SelCodGroup
|
||||
{
|
||||
get => CurrFilt.SelCodGroup;
|
||||
set
|
||||
@@ -46,29 +58,7 @@ namespace Lux.UI.Components.Pages
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
isLoading = true;
|
||||
return ReloadBaseData();
|
||||
}
|
||||
|
||||
protected void ResetSearch()
|
||||
{
|
||||
SearchVal = "";
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private ItemModel? editRecord = null;
|
||||
private bool isLoading = false;
|
||||
|
||||
#endregion Private Fields
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
@@ -84,6 +74,11 @@ namespace Lux.UI.Components.Pages
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private void ResetSearch()
|
||||
{
|
||||
SearchVal = "";
|
||||
}
|
||||
|
||||
private void SaveSel(string codGroup)
|
||||
{
|
||||
SelCodGroup = codGroup;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-2">
|
||||
<div class="row">
|
||||
<div class="row g-2">
|
||||
@if (isLoading)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
@@ -39,7 +39,7 @@
|
||||
{
|
||||
@if (!fullPageDetail)
|
||||
{
|
||||
<div class="@mainCss shadow">
|
||||
<div class="@mainCss">
|
||||
<div class="card shadow">
|
||||
<div class="card-header">
|
||||
<b>Cataloghi</b>
|
||||
@@ -52,7 +52,7 @@
|
||||
}
|
||||
@if (SelRecord != null)
|
||||
{
|
||||
<div class="@detailCss ps-0">
|
||||
<div class="@detailCss">
|
||||
<div class="card border-info shadow">
|
||||
<div class="card-header text-bg-info bg-opacity-50">
|
||||
@if (fullPageDetail)
|
||||
|
||||
@@ -21,11 +21,14 @@
|
||||
@using Lux.UI.Components.Compo
|
||||
@* @using Lux.UI.Components.Compo.Base *@
|
||||
@using Lux.UI.Components.Compo.Charts
|
||||
@using Lux.UI.Components.Compo.Common
|
||||
@using Lux.UI.Components.Compo.Config
|
||||
@using Lux.UI.Components.Compo.FileMan
|
||||
@using Lux.UI.Components.Compo.Generic
|
||||
@using Lux.UI.Components.Compo.Item
|
||||
@using Lux.UI.Components.Compo.JobTask
|
||||
@using Lux.UI.Components.Compo.Offer
|
||||
@using Lux.UI.Components.Compo.Order
|
||||
@using Lux.UI.Components.Compo.Planner
|
||||
@using Lux.UI.Components.Compo.WorkLoad
|
||||
@using Radzen
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
|
||||
<Version>1.1.2603.2413</Version>
|
||||
<Version>1.1.2603.2416</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -55,6 +55,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Components\Compo\Generic\" />
|
||||
<Folder Include="Components\Compo\Order\" />
|
||||
<Folder Include="unsafe_uploads\" />
|
||||
<Folder Include="wwwroot\images\textures\" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>LUX - Web Windows MES</i>
|
||||
<h4>Versione: 1.1.2603.2413</h4>
|
||||
<h4>Versione: 1.1.2603.2416</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.2603.2413
|
||||
1.1.2603.2416
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.1.2603.2413</version>
|
||||
<version>1.1.2603.2416</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>
|
||||
|
||||
Reference in New Issue
Block a user