diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..541294d4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,335 @@ +#-------------------------------- +# area generale +#-------------------------------- +*.pdb +.vs/* + +# ---> VisualStudio +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# ---> C Sharp +# Build Folders (you can keep bin if you'd like, to store dlls and pdbs) +[Bb]in/ +[Oo]bj/ + +# mstest test results +TestResults + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +x64/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.log +*.vspscc +*.vssscc +.builds + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper* + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish + +# Publish Web Output +*.Publish.xml + +# NuGet Packages Directory +packages + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +[Bb]in +[Oo]bj +sql +TestResults +[Tt]est[Rr]esult* +*.Cache +ClientBin +[Ss]tyle[Cc]op.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML + diff --git a/Lux.Core/Class1.cs b/Lux.Core/Class1.cs new file mode 100644 index 00000000..d259cb46 --- /dev/null +++ b/Lux.Core/Class1.cs @@ -0,0 +1,7 @@ +namespace Lux.Core +{ + public class Class1 + { + + } +} diff --git a/Lux.Core/Lux.Core.csproj b/Lux.Core/Lux.Core.csproj new file mode 100644 index 00000000..fa71b7ae --- /dev/null +++ b/Lux.Core/Lux.Core.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/Lux.Core/Lux.Core.sln b/Lux.Core/Lux.Core.sln new file mode 100644 index 00000000..11820968 --- /dev/null +++ b/Lux.Core/Lux.Core.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36203.30 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lux.Core", "Lux.Core.csproj", "{CCE87D58-1E6C-47B3-A28C-65BFCF5F1D0C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lux.Data", "..\Lux.Data\Lux.Data.csproj", "{9BA9FBAC-0D76-41CA-9970-A8DB982CC5F0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "..\TestApp\TestApp.csproj", "{E94496AD-22BB-4443-9A81-11D19AFBE0A3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CCE87D58-1E6C-47B3-A28C-65BFCF5F1D0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CCE87D58-1E6C-47B3-A28C-65BFCF5F1D0C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CCE87D58-1E6C-47B3-A28C-65BFCF5F1D0C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CCE87D58-1E6C-47B3-A28C-65BFCF5F1D0C}.Release|Any CPU.Build.0 = Release|Any CPU + {9BA9FBAC-0D76-41CA-9970-A8DB982CC5F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9BA9FBAC-0D76-41CA-9970-A8DB982CC5F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9BA9FBAC-0D76-41CA-9970-A8DB982CC5F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9BA9FBAC-0D76-41CA-9970-A8DB982CC5F0}.Release|Any CPU.Build.0 = Release|Any CPU + {E94496AD-22BB-4443-9A81-11D19AFBE0A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E94496AD-22BB-4443-9A81-11D19AFBE0A3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E94496AD-22BB-4443-9A81-11D19AFBE0A3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E94496AD-22BB-4443-9A81-11D19AFBE0A3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {263E35AD-9F71-4286-B506-183163D91733} + EndGlobalSection +EndGlobal diff --git a/Lux.Data/AdminContext.cs b/Lux.Data/AdminContext.cs new file mode 100644 index 00000000..1be804bc --- /dev/null +++ b/Lux.Data/AdminContext.cs @@ -0,0 +1,73 @@ +using Lux.Data.DbModel; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Lux.Data +{ + public partial class AdminContext : DbContext + { + #region Private Fields + + private IConfiguration _configuration; + + #endregion Private Fields + + #region Public Constructors + + public AdminContext() + { + } + + public AdminContext(IConfiguration configuration) + { + _configuration = configuration; + } + + public AdminContext(DbContextOptions options) : base(options) + { + } + + #endregion Public Constructors + + #region Public Properties + + /// + /// User management + /// + public DbSet UserList { get; set; } + + #endregion Public Properties + + #region Private Methods + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); + + #endregion Private Methods + + #region Protected Methods + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + string connString = DbConfig.ADMIN_CONNECTION_STRING; + if (!optionsBuilder.IsConfigured) + { + var serverVersion = ServerVersion.AutoDetect(connString); + optionsBuilder.UseMySql(connString, serverVersion); + } + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity().HasKey(c => new { c.Host, c.User }); + + OnModelCreatingPartial(modelBuilder); + } + + #endregion Protected Methods + } +} diff --git a/Lux.Data/Controllers/LuxController.cs b/Lux.Data/Controllers/LuxController.cs new file mode 100644 index 00000000..70b4d637 --- /dev/null +++ b/Lux.Data/Controllers/LuxController.cs @@ -0,0 +1,112 @@ +using Lux.Data.DbModel; +using Microsoft.Extensions.Configuration; +using NLog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static System.Runtime.InteropServices.JavaScript.JSType; + +namespace Lux.Data.Controllers +{ + public class LuxController + { + // manca costruttore parametrico contoller... + + #region Public Methods + + public List ArticoliGetAll() + { + List dbResult = new List(); + //using (DataLayerContext dbCtx = new DataLayerContext(_configuration)) + using (DataLayerContext dbCtx = new DataLayerContext()) + { + try + { + dbResult = dbCtx + .DbSetArticolo + .ToList(); + } + catch (Exception exc) + { + Log.Error($"Eccezione durante ArticoliGetAll{Environment.NewLine}{exc}"); + } + } + return dbResult; + } + + public List ArticoliGetSearch(string term) + { + List dbResult = new List(); + //using (DataLayerContext dbCtx = new DataLayerContext(_configuration)) + using (DataLayerContext dbCtx = new DataLayerContext()) + { + try + { + dbResult = dbCtx + .DbSetArticolo + .Where(x => x.Description.Contains(term)) + .ToList(); + } + catch (Exception exc) + { + Log.Error($"Eccezione durante ArticoliGetSearch{Environment.NewLine}{exc}"); + } + } + return dbResult; + } + + public bool ArticoliUpsert(ArticoloModel newRec) + { + bool answ = false; + //using (DataLayerContext dbCtx = new DataLayerContext(_configuration)) + using (DataLayerContext dbCtx = new DataLayerContext()) + { + try + { + var currRec = dbCtx + .DbSetArticolo + .Where(x => x.ArtID == newRec.ArtID) + .FirstOrDefault(); + // se trovato --> aggiorno + if (currRec != null) + { + currRec.Description = newRec.Description; + currRec.CodFornitore = newRec.CodFornitore; + currRec.CodParl = newRec.CodParl; + currRec.CodArt = newRec.CodArt; + currRec.Cost = newRec.Cost; + currRec.Description = newRec.Description; + currRec.IsMake = newRec.IsMake; + currRec.IsService = newRec.IsService; + currRec.Margin = newRec.Margin; + dbCtx.Entry(currRec).State = Microsoft.EntityFrameworkCore.EntityState.Modified; + + } + // se mancasse --> aggiungo + else + { + dbCtx.DbSetArticolo.Add(newRec); + } + // salvo... + dbCtx.SaveChanges(); + } + catch (Exception exc) + { + Log.Error($"Eccezione durante ArticoliGetSearch{Environment.NewLine}{exc}"); + } + } + return answ; ; + } + + #endregion Public Methods + + #region Private Fields + + private static IConfiguration _configuration; + private static Logger Log = LogManager.GetCurrentClassLogger(); + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/Lux.Data/DataLayerContext.cs b/Lux.Data/DataLayerContext.cs new file mode 100644 index 00000000..d3f2f178 --- /dev/null +++ b/Lux.Data/DataLayerContext.cs @@ -0,0 +1,63 @@ +using Lux.Data.DbModel; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using NLog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Lux.Data +{ + public partial class DataLayerContext: DbContext + { + + private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + + private IConfiguration _configuration; + + public DataLayerContext() + { + } + + public DataLayerContext(IConfiguration configuration) + { + _configuration = configuration; + } + + public DataLayerContext(DbContextOptions options) : base(options) + { + try + { + // se non ci fosse... crea o migra! + Database.Migrate(); + } + catch (Exception exc) + { + Log.Error(exc, "Exception during context initialization 02"); + } + } + + + public virtual DbSet DbSetArticolo { get; set; } + + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + // default + string connString = DbConfig.CONNECTION_STRING; + if (string.IsNullOrEmpty(connString)) + { + connString = "Server=localhost;port=3306;database=Lux_000;uid=root;pwd=Egalware_24068!;sslmode=None;"; + } + if (!optionsBuilder.IsConfigured) + { + var serverVersion = ServerVersion.AutoDetect(connString); + optionsBuilder.UseMySql(connString, serverVersion); + } + } + } +} diff --git a/Lux.Data/DbAdmin.cs b/Lux.Data/DbAdmin.cs new file mode 100644 index 00000000..c63d594a --- /dev/null +++ b/Lux.Data/DbAdmin.cs @@ -0,0 +1,92 @@ +using Microsoft.EntityFrameworkCore; +using NLog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Lux.Data +{ + public class DbAdmin : IDisposable + { + #region Private Fields + + private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + + #endregion Private Fields + + #region Public Constructors + + public DbAdmin() + { + } + + #endregion Public Constructors + + #region Public Methods + + public static bool checkCreateUser(string username, string pwd) + { + bool answ = false; + using (AdminContext adbCtx = new AdminContext()) + { + // ricerca utente... + var numUser = adbCtx + .UserList + .Where(x => x.User == username) + .ToList() + .Count; + if (numUser > 0) + { + answ = true; + } + if (!answ) + { + // creo utente + string sqlCommand = "FLUSH PRIVILEGES;"; + adbCtx.Database.ExecuteSqlRaw(sqlCommand); + sqlCommand = $"CREATE USER '{username}'@'localhost' IDENTIFIED BY '{pwd}';"; + adbCtx.Database.ExecuteSqlRaw(sqlCommand); + sqlCommand = $"GRANT ALL ON *.* TO '{username}'@'localhost';"; + adbCtx.Database.ExecuteSqlRaw(sqlCommand); + sqlCommand = "FLUSH PRIVILEGES;"; + adbCtx.Database.ExecuteSqlRaw(sqlCommand); + } + } + return answ; + } + +#if false + public static async Task migrateDbIdentity() + { + bool answ = false; + using (UserIdentityDbContext dbCtx = new UserIdentityDbContext()) + { + await dbCtx.Database.MigrateAsync(); + answ = true; + } + return answ; + } +#endif + + public static async Task migrateDbMain() + { + bool answ = false; + using (DataLayerContext dbCtx = new DataLayerContext()) + { + await dbCtx.Database.MigrateAsync(); + answ = true; + } + return answ; + } + + + + public void Dispose() + { + } + + #endregion Public Methods + } +} diff --git a/Lux.Data/DbConfig.cs b/Lux.Data/DbConfig.cs new file mode 100644 index 00000000..507afdcc --- /dev/null +++ b/Lux.Data/DbConfig.cs @@ -0,0 +1,96 @@ +using Microsoft.EntityFrameworkCore; +using NLog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Lux.Data +{ + public class DbConfig + { + #region Public Fields + + public static string DATABASE_NAME = "LUX"; + + public static int DATABASE_PROCESS_TIMEOUT = 5; + public static string DATABASE_PWD = "viadante16"; + + // Database config + public static string DATABASE_SERV = "127.0.0.1"; + + public static string DATABASE_USER = "Lux_User"; + + #endregion Public Fields + + #region Public Properties + + /// + /// DB Connection string per azioni amministrative + /// + public static string ADMIN_CONNECTION_STRING { get; set; } = ""; + + /// + /// DB Connection string + /// + public static string CONNECTION_STRING { get; set; } = ""; + + #endregion Public Properties + + #region Public Methods + + public static bool CheckUser(string nKey, string sKey) + { + // esecuzione script di install locale + return DbAdmin.checkCreateUser(DATABASE_USER, DATABASE_PWD); + } + +#if false + public static bool ExecMigrationIdentity() + { + Log.Info($"ExecMigrationIdentity: Start"); + // esecuzione migrazione + var migrateTask = Task.Run(async () => await DbAdmin.migrateDbIdentity()); + migrateTask.Wait(); + Log.Info($"ExecMigrationIdentity: Completed"); + return migrateTask.Result; + } +#endif + + public static bool ExecMigrationMain() + { + Log.Info($"ExecMigrationMain: Start"); + // esecuzione migrazione + var migrateTask = Task.Run(async () => await DbAdmin.migrateDbMain()); + migrateTask.Wait(); + Log.Info($"ExecMigrationMain: Completed"); + return migrateTask.Result; + } + + public static void InitDb(string server, string nKey, string sKey) + { + DATABASE_SERV = server; + DATABASE_NAME = $"Lux_{nKey}"; + DATABASE_USER = $"user_{nKey}"; + DATABASE_PWD = $"pwd_{sKey}"; + CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None"; + // stringa admin con utente root egalware... + ADMIN_CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database=mysql;uid=root;pwd=Egalware_24068!;sslmode=None"; + } + + public static ServerVersion MysqlServerVersion(string connString) + { + ServerVersion serverVersion = ServerVersion.AutoDetect(connString); + return serverVersion; + } + + #endregion Public Methods + + #region Private Fields + + private static Logger Log = LogManager.GetCurrentClassLogger(); + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/Lux.Data/DbModel/ArticoloModel.cs b/Lux.Data/DbModel/ArticoloModel.cs new file mode 100644 index 00000000..8fac03db --- /dev/null +++ b/Lux.Data/DbModel/ArticoloModel.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Lux.Data.DbModel +{ + [Table("AnagArticoli")] + public class ArticoloModel + { + /// + /// ID dell'articolo + /// + [Key] + public int ArtID { get; set; } + + /// + /// Definisce l'articolo come servizio vs concreto=materiale + /// + public bool IsService { get; set; } = false; + + /// + /// Articolo di produzione (vs da acquisto) + /// + public bool IsMake { get; set; } = true; + + /// + /// CodArticolo (opzionale) numerico + /// + public int CodArt { get; set; } = 0; + + /// + /// CodArticolo (opzionale) string + /// + public string CodArtExt { get; set; } = ""; + + /// + /// Cod Parlante (opzionale) Articolo + /// + public string CodParl { get; set; } = ""; + + /// + /// Cod Fornitore (opzionale) + /// + public string CodFornitore { get; set; } = ""; + + /// + /// Descrizione + /// + public string Description { get; set; } = ""; + + /// + /// Costo (standard / senza listini) + /// + public double Cost { get; set; } = 0; + + /// + /// Margine percentuale standard + /// + public double Margin { get; set; } = 0.1; + + } +} diff --git a/Lux.Data/DbModel/UserPrivModel.cs b/Lux.Data/DbModel/UserPrivModel.cs new file mode 100644 index 00000000..ff015921 --- /dev/null +++ b/Lux.Data/DbModel/UserPrivModel.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Lux.Data.DbModel +{ + /// + /// Tabella dei USER di MySql + /// + [Table("user")] + public class UserPriv + { + #region Public Properties + + [Column("Host", Order = 1)] + public string Host { get; set; } = ""; + + [Column("User", Order = 2)] + public string User { get; set; } = ""; + + #endregion Public Properties + } +} diff --git a/Lux.Data/Lux.Data.csproj b/Lux.Data/Lux.Data.csproj new file mode 100644 index 00000000..dcc9b44c --- /dev/null +++ b/Lux.Data/Lux.Data.csproj @@ -0,0 +1,35 @@ + + + + net8.0 + enable + enable + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + diff --git a/Lux.Data/Migrations/20250618143234_InitDb.Designer.cs b/Lux.Data/Migrations/20250618143234_InitDb.Designer.cs new file mode 100644 index 00000000..7db7e227 --- /dev/null +++ b/Lux.Data/Migrations/20250618143234_InitDb.Designer.cs @@ -0,0 +1,65 @@ +// +using Lux.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Lux.Data.Migrations +{ + [DbContext(typeof(DataLayerContext))] + [Migration("20250618143234_InitDb")] + partial class InitDb + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.17") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("Lux.Data.DbModel.ArticoloModel", b => + { + b.Property("ArtID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ArtID")); + + b.Property("CodArt") + .HasColumnType("int"); + + b.Property("CodArtExt") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Cost") + .HasColumnType("decimal(65,30)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsMake") + .HasColumnType("tinyint(1)"); + + b.Property("IsService") + .HasColumnType("tinyint(1)"); + + b.Property("Margin") + .HasColumnType("double"); + + b.HasKey("ArtID"); + + b.ToTable("AnagArticoli"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Lux.Data/Migrations/20250618143234_InitDb.cs b/Lux.Data/Migrations/20250618143234_InitDb.cs new file mode 100644 index 00000000..e2c2e25c --- /dev/null +++ b/Lux.Data/Migrations/20250618143234_InitDb.cs @@ -0,0 +1,47 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Lux.Data.Migrations +{ + /// + public partial class InitDb : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AnagArticoli", + columns: table => new + { + ArtID = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + IsService = table.Column(type: "tinyint(1)", nullable: false), + IsMake = table.Column(type: "tinyint(1)", nullable: false), + CodArt = table.Column(type: "int", nullable: false), + CodArtExt = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Cost = table.Column(type: "decimal(65,30)", nullable: false), + Margin = table.Column(type: "double", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AnagArticoli", x => x.ArtID); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AnagArticoli"); + } + } +} diff --git a/Lux.Data/Migrations/20250618143455_ModificaDefArticolo01.Designer.cs b/Lux.Data/Migrations/20250618143455_ModificaDefArticolo01.Designer.cs new file mode 100644 index 00000000..017e4279 --- /dev/null +++ b/Lux.Data/Migrations/20250618143455_ModificaDefArticolo01.Designer.cs @@ -0,0 +1,73 @@ +// +using Lux.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Lux.Data.Migrations +{ + [DbContext(typeof(DataLayerContext))] + [Migration("20250618143455_ModificaDefArticolo01")] + partial class ModificaDefArticolo01 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.17") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("Lux.Data.DbModel.ArticoloModel", b => + { + b.Property("ArtID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ArtID")); + + b.Property("CodArt") + .HasColumnType("int"); + + b.Property("CodArtExt") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CodFornitore") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CodParl") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Cost") + .HasColumnType("double"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsMake") + .HasColumnType("tinyint(1)"); + + b.Property("IsService") + .HasColumnType("tinyint(1)"); + + b.Property("Margin") + .HasColumnType("double"); + + b.HasKey("ArtID"); + + b.ToTable("AnagArticoli"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Lux.Data/Migrations/20250618143455_ModificaDefArticolo01.cs b/Lux.Data/Migrations/20250618143455_ModificaDefArticolo01.cs new file mode 100644 index 00000000..9fa8ef80 --- /dev/null +++ b/Lux.Data/Migrations/20250618143455_ModificaDefArticolo01.cs @@ -0,0 +1,56 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Lux.Data.Migrations +{ + /// + public partial class ModificaDefArticolo01 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Cost", + table: "AnagArticoli", + type: "double", + nullable: false, + oldClrType: typeof(decimal), + oldType: "decimal(65,30)"); + + migrationBuilder.AddColumn( + name: "CodFornitore", + table: "AnagArticoli", + type: "longtext", + nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "CodParl", + table: "AnagArticoli", + type: "longtext", + nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "CodFornitore", + table: "AnagArticoli"); + + migrationBuilder.DropColumn( + name: "CodParl", + table: "AnagArticoli"); + + migrationBuilder.AlterColumn( + name: "Cost", + table: "AnagArticoli", + type: "decimal(65,30)", + nullable: false, + oldClrType: typeof(double), + oldType: "double"); + } + } +} diff --git a/Lux.Data/Migrations/DataLayerContextModelSnapshot.cs b/Lux.Data/Migrations/DataLayerContextModelSnapshot.cs new file mode 100644 index 00000000..7a964ef9 --- /dev/null +++ b/Lux.Data/Migrations/DataLayerContextModelSnapshot.cs @@ -0,0 +1,70 @@ +// +using Lux.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Lux.Data.Migrations +{ + [DbContext(typeof(DataLayerContext))] + partial class DataLayerContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.17") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("Lux.Data.DbModel.ArticoloModel", b => + { + b.Property("ArtID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ArtID")); + + b.Property("CodArt") + .HasColumnType("int"); + + b.Property("CodArtExt") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CodFornitore") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CodParl") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Cost") + .HasColumnType("double"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsMake") + .HasColumnType("tinyint(1)"); + + b.Property("IsService") + .HasColumnType("tinyint(1)"); + + b.Property("Margin") + .HasColumnType("double"); + + b.HasKey("ArtID"); + + b.ToTable("AnagArticoli"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Lux.Data/ModelBuilderExtensions.cs b/Lux.Data/ModelBuilderExtensions.cs new file mode 100644 index 00000000..88751e16 --- /dev/null +++ b/Lux.Data/ModelBuilderExtensions.cs @@ -0,0 +1,76 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Lux.Data +{ + public static class ModelBuilderExtensions + { + /// + /// Estensione per seed iniziale dei dati nel DB + /// + /// + public static void Seed(this ModelBuilder modelBuilder) + { +#if false + // inizializzazione dei valori di default x USER + modelBuilder.Entity().HasData( + new UserModel { UserId = 1, AuthKey = "th1sIsTh3R1vrOfThNgt98", Livello = UserLevel.SuperAdmin, MaskPlantId = 0, MaskSupplierId = 0, MaskTranspId = 0, UserName = "samuele.locatelli", Email = "samuele@steamware.net", Firstname = "Samuele", Lastname = "Locatelli" }, + new UserModel { UserId = 2, AuthKey = "th1sIsTh3R1vrOfThNgt91", Livello = UserLevel.SuperAdmin, MaskPlantId = 0, MaskSupplierId = 0, MaskTranspId = 0, UserName = "giancarlo.rottoli", Email = "giancarlo@steamware.net", Firstname = "Giancarlo", Lastname = "Rottoli" }, + new UserModel { UserId = 3, AuthKey = "th1sIsTh3R1vrOfThNgt93", Livello = UserLevel.SuperAdmin, MaskPlantId = 0, MaskSupplierId = 0, MaskTranspId = 0, UserName = "steamw.admin", Email = "info@steamware.net", Firstname = "Steamware", Lastname = "Admin" }, + new UserModel { UserId = 4, AuthKey = "th1sIsTh3R1vrOfThNgt97", Livello = UserLevel.Admin, MaskPlantId = 0, MaskSupplierId = 0, MaskTranspId = 0, UserName = "angelo.pizzaferri", Email = "a.pizzaferri@pizzaferripetroli.it", Firstname = "Angelo", Lastname = "Pizzaferri" }, + new UserModel { UserId = 5, AuthKey = "th1sIsTh3R1vrOfThNgt99", Livello = UserLevel.Admin, MaskPlantId = 0, MaskSupplierId = 0, MaskTranspId = 0, UserName = "andrei.valeanu", Email = "andrei.valeanu@winnlab.it", Firstname = "Andrei", Lastname = "Valeanu" }, + new UserModel { UserId = 6, AuthKey = "th1sIsTh3R1vrOfThNgt92", Livello = UserLevel.UserExt, MaskPlantId = 0, MaskSupplierId = 1, MaskTranspId = 0, UserName = "liquigas.user01", Email = "info@steamware.net", Firstname = "User", Lastname = "LIQUIGAS" }, + new UserModel { UserId = 7, AuthKey = "th1sIsTh3R1vrOfThNgt94", Livello = UserLevel.UserExt, MaskPlantId = 0, MaskSupplierId = 2, MaskTranspId = 0, UserName = "vulkangas.user01", Email = "info@steamware.net", Firstname = "User", Lastname = "VULKANGAS" }, + new UserModel { UserId = 8, AuthKey = "th1sIsTh3R1vrOfThNgt95", Livello = UserLevel.UserExt, MaskPlantId = 0, MaskSupplierId = 0, MaskTranspId = 1, UserName = "levorato.user01", Email = "info@steamware.net", Firstname = "User", Lastname = "LEVORATO" }, + new UserModel { UserId = 9, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.UserExt, MaskPlantId = 0, MaskSupplierId = 0, MaskTranspId = 2, UserName = "traffik.user01", Email = "info@steamware.net", Firstname = "User", Lastname = "TRAFFIK" }, + new UserModel { UserId = 10, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 1, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz03.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Collecchio" }, + new UserModel { UserId = 11, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 2, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz04.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Noceto" }, + new UserModel { UserId = 12, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 3, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz05.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Baganzola" }, + new UserModel { UserId = 13, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 4, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz08.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Pilastrello" } + ); +#endif + + //// inizializzazione dei valori di default x Plant + //modelBuilder.Entity().HasData( + // new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 }, + // new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, LevelReorder = 15000, OrderQtyStd = 18000 }, + // new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, LevelReorder = 15000, OrderQtyStd = 18000 }, + // new PlantDetailModel { PlantId = 4, PlantCode = "PIZ08", PlantDesc = "Pilastrello", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 }, + // new PlantDetailModel { PlantId = 5, PlantCode = "PIZ09", PlantDesc = "Guardamiglio", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 } + // // new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 }, + // //new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 }, + // //new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 }, + // //new PlantDetailModel { PlantId = 4, PlantCode = "PIZ08", PlantDesc = "Pilastrello", LevelMax = 26000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 } + // ); + + //// inizializzazione dei valori di default x Fornitori + //modelBuilder.Entity().HasData( + // new SupplierModel { SupplierId = 1, SupplierCode = "LIQUIGAS", SupplierDesc = "Liquigas" }, + // new SupplierModel { SupplierId = 2, SupplierCode = "VULKANGAS", SupplierDesc = "Vulkangas" } + // ); + + //// inizializzazione dei valori di default x Trasportatori + //modelBuilder.Entity().HasData( + // new TransporterModel { TransporterId = 1, TransporterCode = "LEVO", TransporterDesc = "Levorato" }, + // new TransporterModel { TransporterId = 2, TransporterCode = "TRAF", TransporterDesc = "Traffik" } + // ); + + //// init consegne... + //modelBuilder.Entity().HasData( + // new WeekPlanModel { WeekPlanId = 1, DayNum = DayOfWeek.Monday, DeliveryHour = 20, Note = "18K", PlantId = 2, SupplierId = 1, TransporterId = 1 }, + // new WeekPlanModel { WeekPlanId = 2, DayNum = DayOfWeek.Tuesday, DeliveryHour = 20, Note = "18K", PlantId = 2, SupplierId = 1, TransporterId = 1 }, + // new WeekPlanModel { WeekPlanId = 3, DayNum = DayOfWeek.Wednesday, DeliveryHour = 20, Note = "18K", PlantId = 2, SupplierId = 1, TransporterId = 2 }, + // new WeekPlanModel { WeekPlanId = 4, DayNum = DayOfWeek.Thursday, DeliveryHour = 15, Note = "9K", PlantId = 2, SupplierId = 1, TransporterId = 1 }, + // new WeekPlanModel { WeekPlanId = 5, DayNum = DayOfWeek.Thursday, DeliveryHour = 20, Note = "18K", PlantId = 2, SupplierId = 1, TransporterId = 1 }, + // new WeekPlanModel { WeekPlanId = 6, DayNum = DayOfWeek.Saturday, DeliveryHour = 20, Note = "18K", PlantId = 2, SupplierId = 1, TransporterId = 1 }, + // new WeekPlanModel { WeekPlanId = 7, DayNum = DayOfWeek.Tuesday, DeliveryHour = 14, Note = "3K", PlantId = 3, SupplierId = 1, TransporterId = 1 }, + // new WeekPlanModel { WeekPlanId = 8, DayNum = DayOfWeek.Tuesday, DeliveryHour = 15, Note = "15K", PlantId = 4, SupplierId = 1, TransporterId = 1 }, + // new WeekPlanModel { WeekPlanId = 9, DayNum = DayOfWeek.Tuesday, DeliveryHour = 17, Note = "18K", PlantId = 1, SupplierId = 2, TransporterId = 2 } + // ); + } + } +} diff --git a/README.md b/README.md index db2d181f..ec5385cd 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,151 @@ # LUX +Progetto per la realizzazione del "MES dei Falegnami"; che deve gestire il flusso logistico almeno di + + * produzione finestre e serramenti + * produzione porte ... + +## To Do + +- [ ] Completare la documentazione +- [ ] Setup repo agli sviluppatori +- [ ] Definizione struttura progetti + +## Elementi della soluzione - Entità gestite + +### Offerta + +L'offerta è il primo documento che il cliente si trova a generare prima di realizzare un nuovo progetto. + +Lofferta deve contenere riferimenti alle seguenti entità ARTICOLO: + * prodotti forniti (i serramenti) + * servizi forniti (installazione) + * accessori impliciti (certificazioni prodotto, ) + * accessori opzionali + +L'offerta è intestata ad una PERSONA (fisica o legale) + +L'offerta avrà dei dati di testata (relativi alla persona di chi offre e di chi riceve) + dati di dettaglio di tutti gli ARTICOLI offerti + dei dati di reseconto in termini di + * tempi + * costi + +indicati in modo analitico per ogni articolo (quantià * prezzo) + riassunti globalmente + +L'offerta ha un termine di validità (STANDARD) + +L'offerta è archiviata in un set informativo e può evolvere di stato o natura (offerta confermata vs ordine) + +L'offerta di norma è generata dal cliente, ma può essere prodotta per suo conto da un AGENTE /mandatario/rivenditore, che è anche lui una persona con permessi speciali che può generare offerte per nome e conto. + +Gli agenti costituiscono un criterio di ricerca e raggruppamento delle offerte per poter essere indivuate. + +Gli agenti hanno un "listino" dato da + * prezzo a listino (aumentato...) + * prezzo standard proposto di vendita + * prezzo rock bottom minimo concesso + * costo effettivo aziendale (comprensivo di margini minimi, ricarichi, costi OH) + +La valutazione degli agenti permette di classificarne l'efficienza in termini di% sulla differenza costo proposto/rockbottom e valutare se gestire la provvigione sulal abse di questo (step 2) + +L'offerta ha uno stato +* aperta +* chiusa con ordine +* persa + +Un offerta può essere modificata nel tempo. + +Di un offerta teniamo sempre ultima versione + numero revisione (x tracciare numero modifiche ) + eventuale pdf dei documenti di ogni revisione (opzionale) + +### PERSONA + +La persona individua un soggetto fisico o giuridico destinatario di una operazione o un riferimento. + +Avrà gli attributi per definire la sua natura in termini di ruoli ammessi tra + * cliente + * fornitore + +in qudsto caso i dati fiscali di riferimento devono essere completi per la documentazione tecnico/economica e fiscale di goni offerta/commessa/ordine + +Inoltre un tipo speciale di PERSONA è quello dell'utente applicativo distinto almeno dai seguenti ruoli + * utente interno standard + * agente + * responsabile/amministratore interno -## Getting started +### ARTICOLO -To make it easy for you to get started with GitLab, here's a list of recommended next steps. +Gli articoli possono essere distinti per + * fisico / servizio + * make / buy + * in caso di varianti fornitori articolo è 1 solo e gestiamo varianti fornitori come relazione esterna (con prezzo/quantità/tempi) -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! + Gli articoli conterranno minimo i seguenti dati + * codice univoco interno + * descrizione + * codice fornitore (opzionale) + * codice parlante interno + * costo/prezzo (? listini esterni?) + * margine standard (per classe?) -## Add your files -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command: +Gli articoli saranno una classe di abse, estesa dalle tipologie specifiche con attributi (es dimensioni, tipologia, colore...) specifici opzionali -``` -cd existing_repo -git remote add origin https://gitlab.steamware.net/etis/lux.git -git branch -M main -git push -uf origin main -``` +### Composer -## Integrate with your tools +Il flusso di realizzazione di un offerta, dopo la fase di intestazione dell'offerta ad una persona, prevede di inserire 1-n articoli di diversa natura. -- [ ] [Set up project integrations](https://gitlab.steamware.net/etis/lux/-/settings/integrations) +Quelli in rivendita/servizi sono esplicità (quantità/costo) -## Collaborate with your team +Gli articoli più complessi e oggetto del progetto saranno inseriti con una procedura SPECIALE; che prevede di + * TIPO DI OFFERTA (x ora fissa a serramenti) + * selezionare 1-n attributi "generali" dell'offerta, ad esempio + * tipologia (legno, legno-alluminio, pvc) + * tipologia del vetro + * spessore del serramento + * ... tutti gli attributi sono bloccabili a livello di istanza o meno (x evitare sovrascritture da parte dell'offerta contenitore) + * selezione di un articolo DA TEMPLATE (da ragioanre se davvero articolo o un sotto oggetto) + * l'articolo da template è a tutti gli effetti una singola istanza (SALVATA) di un progetto di una finestra template con le informazioni necessarie e sufficienti a definirla completamente fino a tempi/costi + * questo articolo pò essere ricalcolato ogni giorno/settimana/... per essere valido come prima stima + * il tempalte può essere inserito con valori standard di impostazione e valori calcolati standard di prezzo/tempi x avere una prima stima dell'offerta + * l'elenco dei template è ovviametne estendibile da aprte dell'utente finale + * ogni istanza di finestra (comprensiva dei suoi dati di calcolo) deve essere salvata insieme ai vari file/json/set informativi di corredo, tracui + * json di progettazione + * json/xml di richiesta/risposta ferramenta + * json/csv di configurazione della BOM prevista dei vari componenti + * altri file o oggetti encessari alle fasi di offerta fornitore e/o calcolo effettivo in produzione + * l'insieme delle informazioni collezionate a livello di offerta sono poi oggetto di VALIDAZIONE in fase di conferma ordine prima della traduzione in termini di COMMESSA effettiva di lavoro. -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/) -## Test and Deploy -Use the built-in continuous integration in GitLab. +#### Template -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) +Ogni template rappresenterà un intero serramento configurato. +Idealmente si parte SEMPRE da un template di fiestra definito. +I template di base (nell'ordine di una decina) saranno installati da noi con il sw, l'utente potrà modificarli e/o intergrare con nuovi. -*** +Un template può essere salvata solo se valido (validato dal motore di calcolo). -# Editing this README -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. +### Engine -## Suggestions for a good README +CI saranno ALMENO 2 motori: +* engine completo che contiene il CAM e fa calcoli esatti +* eingine semplificato da browser (Threejs?) -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. +questi 2 motori sono in grado di leggere entrambi il json di configurazione serramento (JWD = Json Windows Definition) e generare uno un modello completo e l'altro uno semplificato -## Name -Choose a self-explaining name for your project. +L'operatività di editing sarà fatta nel browser sul modello semplificato -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. +Eventuali "equilibrismi" richiederanno valutazione/gestione con motore CAM. -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. +### BOM -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. +### Cicli -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. +#### Pezzo -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. +## Version History -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +tabella versioni diff --git a/TestApp/Program.cs b/TestApp/Program.cs new file mode 100644 index 00000000..d5e740fa --- /dev/null +++ b/TestApp/Program.cs @@ -0,0 +1,33 @@ +// See https://aka.ms/new-console-template for more information +using Lux.Data.Controllers; + +Console.WriteLine("--------------"); +Console.WriteLine("Lux DB test"); +Console.WriteLine("--------------"); + +LuxController lControl = new LuxController(); + +var listRec = lControl.ArticoliGetAll(); +foreach (var item in listRec) +{ + Console.WriteLine($"{item.ArtID} | {item.Description} | {item.Cost}"); +} + +Console.WriteLine("--------------"); +string? search = "-"; +while (!string.IsNullOrEmpty(search)) +{ + Console.WriteLine("inserire una ricerca, enter per chiudere"); + search = Console.ReadLine(); + listRec = lControl.ArticoliGetSearch($"{search}"); + foreach (var item in listRec) + { + Console.WriteLine($"{item.ArtID} | {item.Description} | {item.Cost}"); + } +} + + + + +Console.WriteLine("Premere un tasto per chiudere"); +Console.ReadLine(); diff --git a/TestApp/TestApp.csproj b/TestApp/TestApp.csproj new file mode 100644 index 00000000..6d99cc4a --- /dev/null +++ b/TestApp/TestApp.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + +