Aggiunto metodo force upload x alias
This commit is contained in:
@@ -77,6 +77,50 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Esegue sync Alias da locale a remoto (post insert/update locale)
|
||||
/// - upload + sync (cloud)
|
||||
/// </summary>
|
||||
/// <returns>Risultato sincronizzazione</returns>
|
||||
public SyncResult AliasForceUpload()
|
||||
{
|
||||
SyncResult answ = SyncResult.ERR_ND;
|
||||
// verifico server ok
|
||||
bool servOk = commLib.CheckRemote();
|
||||
if (!servOk)
|
||||
{
|
||||
answ = SyncResult.ERR_ServerKo;
|
||||
}
|
||||
else
|
||||
{
|
||||
using (AliasController dbContr = new AliasController())
|
||||
{
|
||||
try
|
||||
{
|
||||
// in primis leggo l'elenco materiali dal DB locale
|
||||
List<AliasModel> listDb = dbContr.GetFilt("MatCode");
|
||||
List<AliasDTO> list2send = listDb.Select(x => AliasController.ConvToDto(x)).ToList();
|
||||
// preparo pacchetto invio...
|
||||
bool okMat = commLib.AliasSend(list2send);
|
||||
// se inviato confermo!
|
||||
if (!okMat)
|
||||
{
|
||||
answ = SyncResult.ERR_CloudAliasNotSent;
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = SyncResult.ALL_OK;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
answ = SyncResult.ERR_ServerKo;
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue sync Alias:
|
||||
/// - download + sync (locale)
|
||||
@@ -237,7 +281,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
bool okSend = false;
|
||||
// se richiesto PRIMA fa il try-fix ProdId e ProjCloudId
|
||||
if(tryFixProj)
|
||||
if (tryFixProj)
|
||||
{
|
||||
bool fixDone = lmDbContr.TryFixProjCloudId();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabelal delle singole istsanze prodotte\
|
||||
/// Tabella delle singole istanze prodotte
|
||||
/// </summary>
|
||||
[Table("PartList")]
|
||||
public class PartModel
|
||||
|
||||
Reference in New Issue
Block a user