Files
Samuele Locatelli a2171e643d Aggiunta proxy iniziale:
- FTP
- Gomba
- Icoel
- MultiCcn
- OSAI
- SqlDB
2024-12-23 09:01:29 +01:00

36 lines
1.7 KiB
C#

using EgwProxy.SqlDb.DbModels;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwProxy.SqlDb
{
public class MyDbInitializer : IDatabaseInitializer<SyncStateDbContext>
{
public void InitializeDatabase(SyncStateDbContext context)
{
// aggiunta preliminare tipo attività sync ammessi
context.DbSetActListType.AddOrUpdate<ActTypeModel>(
new ActTypeModel() { Action = "SetPodlData", Description = "Sincronizzazione dati PODL | MES --> MACH" },
new ActTypeModel() { Action = "GetPodlData", Description = "Lettura stato macchina x avvio prod ODL da PODL e sync relativa | MACH --> MES" },
new ActTypeModel() { Action = "GetEvList", Description = "Lettura info da impianto e decodifica come EvList | MACH --> MES" },
new ActTypeModel() { Action = "GetFluxLog", Description = "Lettura info da impianto e decodifica come FluxLog | MACH --> MES" }
);
context.DbSetSyncState.AddOrUpdate<SyncStateModel>(
new SyncStateModel() { TableName = "ActList", LastIdx = 0, Note = "NO EXEC", LastUpdate = DateTime.Today },
new SyncStateModel() { TableName = "PODL_req", LastIdx = 0, Note = "NO EXEC", LastUpdate = DateTime.Today },
new SyncStateModel() { TableName = "EvList", LastIdx = 0, Note = "NO EXEC", LastUpdate = DateTime.Today },
new SyncStateModel() { TableName = "FluxLog", LastIdx = 0, Note = "NO EXEC", LastUpdate = DateTime.Today }
);
context.SaveChanges();
}
}
}