delete msgService da dossier

This commit is contained in:
zaccaria.majid
2022-10-19 12:49:13 +02:00
parent 0c5e41826e
commit 591b66b52d
9 changed files with 156 additions and 44 deletions
+23 -9
View File
@@ -61,15 +61,25 @@ namespace MP.SPEC.Components
}
public void Dispose()
{
#if false
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated -= OnSeachUpdated;
MessageService.EA_SearchUpdated -= OnSeachUpdated;
#endif
currRecord = null;
SearchRecords = null;
ListRecords = null;
GC.Collect();
}
private SelectDossierParams lastFilter { get; set; } = new SelectDossierParams() { CurrPage = -1 };
protected override async Task OnParametersSetAsync()
{
if (!lastFilter.Equals(SelFilter))
{
lastFilter = SelFilter.clone();
await reloadData(true);
}
}
#endregion Public Methods
#region Protected Properties
@@ -79,10 +89,12 @@ namespace MP.SPEC.Components
[Inject]
protected MpDataService MDService { get; set; } = null!;
#if false
[Inject]
protected MessageService MessageService { get; set; } = null!;
#endif
#endregion Protected Properties
#region Protected Methods
@@ -113,8 +125,10 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync()
{
#if false
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated += OnSeachUpdated;
MessageService.EA_SearchUpdated += OnSeachUpdated;
#endif
ListStati = await MDService.AnagStatiComm();
await reloadData(true);
}
@@ -159,11 +173,11 @@ namespace MP.SPEC.Components
#endregion Private Fields
#region Private Properties
private int currPage
{
get => MessageService.currPage;
set => MessageService.currPage = value;
get => SelFilter.CurrPage;
set => SelFilter.CurrPage = value;
}
private bool isLoading { get; set; } = false;
@@ -177,8 +191,8 @@ namespace MP.SPEC.Components
private int numRecord
{
get => MessageService.numRecord;
set => MessageService.numRecord = value;
get => SelFilter.NumRec;
set => SelFilter.NumRec = value;
}
private string SelArticolo
+74
View File
@@ -0,0 +1,74 @@
namespace MP.SPEC.Data
{
public class SelectArticoliParams
{
#region Public Constructors
public SelectArticoliParams()
{ }
#endregion Public Constructors
#region Public Properties
public int CurrPage { get; set; } = 1;
public string IdxMacchina { get; set; } = "*";
public string Azienda { get; set; } = "*";
public int MaxRecord { get; set; } = 100;
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
#endregion Public Properties
#region Public Methods
public SelectArticoliParams clone()
{
SelectArticoliParams clonedData = new SelectArticoliParams()
{
CurrPage = this.CurrPage,
IdxMacchina = this.IdxMacchina,
Azienda = this.Azienda,
MaxRecord = this.MaxRecord,
NumRec = this.NumRec,
TotCount = this.TotCount
};
return clonedData;
}
public override bool Equals(object obj)
{
if (!(obj is SelectArticoliParams item))
return false;
if (MaxRecord != item.MaxRecord)
return false;
if (NumRec != item.NumRec)
return false;
if (TotCount != item.TotCount)
return false;
if (CurrPage != item.CurrPage)
return false;
if (IdxMacchina != item.IdxMacchina)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
+26 -15
View File
@@ -1,4 +1,6 @@
namespace MP.SPEC.Data
using MP.Data;
namespace MP.SPEC.Data
{
public class SelectDossierParams
{
@@ -13,31 +15,34 @@
public int CurrPage { get; set; } = 1;
public DateTime DtEnd { get; set; } = InitDatetime(5);
public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
public DateTime DtStart { get; set; } = InitDatetime(5).AddDays(-730);
public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-730);
public string IdxMacchina { get; set; } = "*";
public string CodArticolo { get; set; } = "*";
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
public int MaxRecord { get; set; } = 100;
#endregion Public Properties
#region Public Methods
/// <summary>
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <returns></returns>
public static DateTime InitDatetime(int minRound)
public SelectDossierParams clone()
{
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
return endRounded;
SelectDossierParams clonedData = new SelectDossierParams()
{
DtEnd = this.DtEnd,
DtStart = this.DtStart,
CurrPage = this.CurrPage,
IdxMacchina = this.IdxMacchina,
CodArticolo = this.CodArticolo,
MaxRecord = this.MaxRecord,
NumRec = this.NumRec,
TotCount = this.TotCount
};
return clonedData;
}
public override bool Equals(object obj)
@@ -54,6 +59,12 @@
if (MaxRecord != item.MaxRecord)
return false;
if (TotCount != item.TotCount)
return false;
if (NumRec != item.NumRec)
return false;
if (DtEnd != item.DtEnd)
return false;
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2210.1910</Version>
<Version>6.16.2210.1912</Version>
</PropertyGroup>
<ItemGroup>
+10 -9
View File
@@ -24,9 +24,11 @@ namespace MP.SPEC.Pages
return answ;
}
private SelectArticoliParams currFilter = new SelectArticoliParams();
public void Dispose()
{
MessageService.EA_SearchUpdated -= OnSeachUpdated;
//MessageService.EA_SearchUpdated -= OnSeachUpdated;
currRecord = null;
ListTipoArt = null;
ListAziende = null;
@@ -54,9 +56,11 @@ namespace MP.SPEC.Pages
[Inject]
protected MpDataService MDService { get; set; } = null!;
#if false
[Inject]
protected MessageService MessageService { get; set; } = null!;
protected MessageService MessageService { get; set; } = null!;
#endif
[Inject]
protected NavigationManager NavManager { get; set; }
@@ -131,9 +135,6 @@ namespace MP.SPEC.Pages
protected override async Task OnInitializedAsync()
{
numRecord = 10;
// mostro ricerca
MessageService.ShowSearch = true;
MessageService.EA_SearchUpdated += OnSeachUpdated;
configData = await MDService.ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
if (currRec != null)
@@ -172,14 +173,14 @@ namespace MP.SPEC.Pages
{
Azienda = selRec.Azienda,
CodArticolo = selRec.CodArticolo,
DescArticolo = $"CLONE - { selRec.DescArticolo }",
DescArticolo = $"CLONE - {selRec.DescArticolo}",
Disegno = selRec.Disegno,
Tipo=selRec.Tipo
Tipo = selRec.Tipo
};
currRecord = newRec;
await Task.Delay(1);
}
protected async Task update(AnagArticoli selRec)
{
@@ -294,7 +295,7 @@ namespace MP.SPEC.Pages
private async Task reloadData()
{
isLoading = true;
SearchRecords = await MDService.ArticoliGetSearch(100000, selAzienda, MessageService.SearchVal);
SearchRecords = await MDService.ArticoliGetSearch(100000, selAzienda, "*");
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
isLoading = false;
}
+19 -7
View File
@@ -23,8 +23,10 @@ namespace MP.SPEC.Pages
[Inject]
protected MpDataService MDService { get; set; } = null!;
#if false
[Inject]
protected MessageService MsgService { get; set; } = null!;
protected MessageService MsgService { get; set; } = null!;
#endif
#endregion Protected Properties
@@ -51,9 +53,11 @@ namespace MP.SPEC.Pages
{
isLoading = true;
isFiltering = true;
#if false
// disabilito ricerca...
MsgService.SearchVal = "";
MsgService.ShowSearch = false;
MsgService.ShowSearch = false;
#endif
// fix pagina
await Task.Delay(1);
var modFilter = currFilter;
@@ -115,8 +119,8 @@ namespace MP.SPEC.Pages
private int currPage
{
get => MsgService.currPage;
set => MsgService.currPage = value;
get => currFilter.CurrPage;
set => currFilter.CurrPage = value;
}
private Dossiers? currRecordDoss { get; set; } = null;
@@ -125,11 +129,15 @@ namespace MP.SPEC.Pages
private int numRecord
{
get => MsgService.numRecord;
set => MsgService.numRecord = value;
get => currFilter.NumRec;
set => currFilter.NumRec = value;
}
private int totalCount { get; set; } = 0;
private int totalCount
{
get => currFilter.TotCount;
set => currFilter.TotCount = value;
}
#endregion Private Properties
@@ -146,6 +154,10 @@ namespace MP.SPEC.Pages
currFilter = newParams;
isLoading = false;
}
protected void UpdateTotCount(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Private Methods
}
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2210.1910</h4>
<h4>Versione: 6.16.2210.1912</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2210.1910
6.16.2210.1912
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2210.1910</version>
<version>6.16.2210.1912</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>