Aggiunta lettura RAW dati scarti
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Configuration;
|
||||
using System.Text;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MpDataLayer;
|
||||
|
||||
namespace MP_STATS.Data
|
||||
{
|
||||
public class MpStatsService
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static ILogger<MpStatsService> _logger;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected static string connStringBBM = "";
|
||||
protected static string connStringFatt = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Public Fields
|
||||
|
||||
public static MpDataLayer.Controllers.MpStatsController dbController;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MpStatsService(IConfiguration configuration, ILogger<MpStatsService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
string connStr = _configuration.GetConnectionString("Mp.Stats");
|
||||
if (string.IsNullOrEmpty(connStr))
|
||||
{
|
||||
_logger.LogError("ConnString empty!");
|
||||
}
|
||||
else
|
||||
{
|
||||
dbController = new MpDataLayer.Controllers.MpStatsController(configuration);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine($"DbController OK");
|
||||
//sb.AppendLine($"CST: {dbController.CustomersCount()} | CNT: {dbController.CountersCount()} | BSK: {dbController.BasketsCount()} | NGT: {dbController.NegotiationsCount()} | DOC: {dbController.DocsCount()} | ITM: {dbController.ItemsCount()} | RES: {dbController.ResourcesCount()}");
|
||||
_logger.LogInformation(sb.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void rollBackEdit(object item)
|
||||
{
|
||||
dbController.rollBackEntity(item);
|
||||
}
|
||||
|
||||
public Task<MpDataLayer.DatabaseModels.ResScarti[]> ScartiGetAll(int numRecord, string searchVal = "")
|
||||
{
|
||||
return Task.FromResult(dbController.ScartiGetAll(numRecord, searchVal).ToArray());
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,15 @@
|
||||
<h3>Controlli</h3>
|
||||
@page "/controlli"
|
||||
|
||||
@using MP_STATS.Components
|
||||
@using MP_STATS.Data
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header table-primary h1">Controlli</div>
|
||||
<div class="card-body">
|
||||
elenco controlli
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-8 text-right">
|
||||
<div class="text-light display-4">
|
||||
<span class="oi oi-basket" aria-hidden="true"></span> | <span class="oi oi-cart" aria-hidden="true"></span> | <span class="oi oi-document" aria-hidden="true"></span> | <span class="oi oi-envelope-open" aria-hidden="true"></span> | <span class="oi oi-puzzle-piece" aria-hidden="true"></span> | <span class="oi oi-badge" aria-hidden="true"></span> | <span class="oi oi-wrench" aria-hidden="true"></span>
|
||||
<span class="oi oi-book" aria-hidden="true"></span> | <span class="oi oi-document" aria-hidden="true"></span> | <span class="oi oi-beaker" aria-hidden="true"></span> | <span class="oi oi-warning" aria-hidden="true"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,13 +24,7 @@
|
||||
<div class="card">
|
||||
<div class="card-header table-primary h1">@Anno</div>
|
||||
<div class="card-body">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<HomeButton NavLink="baskets" Icon="oi oi-basket" Descript="Baskets" />
|
||||
<HomeButton NavLink="produzione" Icon="oi oi-book" Descript="Produzione" />
|
||||
<HomeButton NavLink="negotiations" Icon="oi oi-cart" Descript="Negoziazioni" />
|
||||
<HomeButton NavLink="docs" Icon="oi oi-document" Descript="Documenti" />
|
||||
@*<HomeButton NavLink="resources" Icon="oi oi-puzzle-piece" Descript="Risorse" />*@
|
||||
|
||||
@@ -1,5 +1,59 @@
|
||||
<h3>Scarti</h3>
|
||||
@page "/scarti"
|
||||
|
||||
@code {
|
||||
@using MP_STATS.Components
|
||||
@using MP_STATS.Data
|
||||
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-header table-primary h1">Scarti</div>
|
||||
<div class="card-body">
|
||||
@if (currRecord != null)
|
||||
{
|
||||
@*<BasketEditor Basket="@currBasket" DataReset="ResetData" DataUpdated="UpdateData"></BasketEditor>*@
|
||||
}
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<p><em>Loading...</em></p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@*<th></th>*@
|
||||
<th>Macchina</th>
|
||||
<th>Data</th>
|
||||
<th>ODL/Commessa</th>
|
||||
<th>Articolo</th>
|
||||
<th>Descrizione</th>
|
||||
<th>Qta</th>
|
||||
<th>Operatore</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record.DataOra, @record.IdxMacchina, @record.Causale)">
|
||||
@*<td><button class="btn btn-sm btn-info" @onclick="() => Edit(record)"><span class="oi oi-pencil"></span></button> <button class="btn btn-sm btn-success" @onclick="() => ShowDocs(record)" title="Vai ai documenti"><span class="oi oi-document"></span></button></td>*@
|
||||
<td>@record.IdxMacchina</td>
|
||||
<td>@record.DataOra</td>
|
||||
<td>@record.IdxOdl | @record.KeyRichiesta</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td>@record.Descrizione</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td>@record.MatrOpr</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<div class="row">
|
||||
<div class="col-8 col-lg-10">
|
||||
</div>
|
||||
<div class="col-4 col-lg-2">
|
||||
<DataPager numRecord="@numRecord" numRecordChanged="ForceReload" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,146 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP_STATS.Data;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP_STATS.Pages
|
||||
{
|
||||
public partial class Scarti : ComponentBase, IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private MpDataLayer.DatabaseModels.ResScarti currRecord = null;
|
||||
|
||||
private MpDataLayer.DatabaseModels.ResScarti[] ListRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int numRecord { get; set; } = 10;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected MessageService MessageService { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavManager { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected MpStatsService StatService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task ForceReload(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal);
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
MessageService.ShowSearch = true;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal);
|
||||
}
|
||||
|
||||
protected void ResetData()
|
||||
{
|
||||
StatService.rollBackEdit(currRecord);
|
||||
currRecord = null;
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public string checkSelect(DateTime DataOra, string IdxMacchina, string Causale)
|
||||
{
|
||||
string answ = "";
|
||||
if (currRecord != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = (currRecord.DataOra == DataOra && currRecord.IdxMacchina == IdxMacchina && currRecord.Causale == Causale) ? "table-info" : "";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
||||
}
|
||||
|
||||
public void OnSeachUpdated()
|
||||
{
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
UpdateData();
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#if false
|
||||
[Inject]
|
||||
protected BBM_SelectData SelectData { get; set; }
|
||||
|
||||
protected void CreateNew()
|
||||
{
|
||||
// recupero counter
|
||||
string newCode = BBMService.CounterGetNext("EGW.B", 6);
|
||||
DatabaseModels.BasketsModel newRecord = new DatabaseModels.BasketsModel()
|
||||
{
|
||||
CodBasket = newCode,
|
||||
DataIns = DateTime.Now,
|
||||
CustomerId = 1,
|
||||
Descript = "New Basket"
|
||||
};
|
||||
currBasket = newRecord;
|
||||
}
|
||||
|
||||
protected async Task Delete(SHERPA.BBM.DatabaseModels.BasketsModel currRecord)
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Sicuro di voler eliminare il Basket '{currRecord.CodBasket}'?"))
|
||||
return;
|
||||
|
||||
BBMService.BasketsDelete(currRecord);
|
||||
await UpdateData();
|
||||
}
|
||||
|
||||
protected void Edit(SHERPA.BBM.DatabaseModels.BasketsModel currRecord)
|
||||
{
|
||||
currBasket = currRecord;
|
||||
}
|
||||
|
||||
protected void ShowDocs(SHERPA.BBM.DatabaseModels.BasketsModel currRecord)
|
||||
{
|
||||
// salvo
|
||||
SelectData.BasketId = currRecord.BasketId;
|
||||
SelectData.NegotiationId = 0;
|
||||
// rimando...
|
||||
NavManager.NavigateTo("docs");
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -12,19 +12,14 @@
|
||||
<span class="oi oi-home" aria-hidden="true"></span> Home
|
||||
</NavLink>
|
||||
</li>
|
||||
@*<li class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="diario">
|
||||
<span class="oi oi-check" aria-hidden="true" title="Statistiche Controlli"></span> Diario Impianti
|
||||
</NavLink>
|
||||
</li>*@
|
||||
<li class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="produzione">
|
||||
<span class="oi oi-book" aria-hidden="true" title="Dati di Produzione"></span> Diario Produzione
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="scarti">
|
||||
<span class="oi oi-warning" aria-hidden="true" title="Registro Scarti"></span> Scarti
|
||||
<NavLink class="nav-link" href="diario">
|
||||
<span class="oi oi-document" aria-hidden="true" title="Statistiche Controlli"></span> User Action Log
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item px-3">
|
||||
@@ -32,6 +27,11 @@
|
||||
<span class="oi oi-beaker" aria-hidden="true" title="Registro Controlli"></span> Controlli
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="scarti">
|
||||
<span class="oi oi-warning" aria-hidden="true" title="Registro Scarti"></span> Scarti
|
||||
</NavLink>
|
||||
</li>
|
||||
@*<li class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="counter">
|
||||
<span class="oi oi-plus" aria-hidden="true"></span> Counter
|
||||
|
||||
+33
-16
@@ -18,28 +18,22 @@ namespace MP_STATS
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
|
||||
|
||||
services.AddLocalization();
|
||||
#endregion Public Properties
|
||||
|
||||
services.AddRazorPages();
|
||||
services.AddServerSideBlazor();
|
||||
//services.AddSingleton<BBM_EFService>();
|
||||
//services.AddScoped<BBM_SelectData>();
|
||||
services.AddScoped<MessageService>();
|
||||
services.AddSingleton<WeatherForecastService>();
|
||||
}
|
||||
#region Public Methods
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
@@ -55,7 +49,7 @@ namespace MP_STATS
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
// cultura IT...
|
||||
// cultura IT...
|
||||
var supportedCultures = new[]{
|
||||
new CultureInfo("it-IT")
|
||||
};
|
||||
@@ -77,5 +71,28 @@ namespace MP_STATS
|
||||
endpoints.MapFallbackToPage("/_Host");
|
||||
});
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddLocalization();
|
||||
|
||||
services.AddRazorPages();
|
||||
services.AddServerSideBlazor();
|
||||
services.AddSingleton<IConfiguration>(Configuration);
|
||||
|
||||
#if false
|
||||
services.AddDbContext<BloggingContext>(options =>
|
||||
options.UseSqlServer(Configuration.GetConnectionString("BloggingDatabase")));
|
||||
#endif
|
||||
|
||||
//services.AddScoped<BBM_SelectData>();
|
||||
services.AddSingleton<MpStatsService>();
|
||||
services.AddScoped<MessageService>();
|
||||
services.AddSingleton<WeatherForecastService>();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"SherpaBBM": "Data Source=SQL2012DEV;Initial Catalog=SHERPA.BBM;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=Sherpa.BBM;",
|
||||
"SherpaFatt": "Data Source=SQL2012DEV;Initial Catalog=SHERPA.Fatt;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=Sherpa.BBM;"
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||
"Mp.Stats": "Server=SQL2016DEV;Database=MoonPro_STATS;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.STATS;"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Configuration;
|
||||
using NLog;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace MpDataLayer.Controllers
|
||||
{
|
||||
public class MpStatsController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static MoonPro_STATSContext dbCtx;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MpStatsController(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
dbCtx = new MoonPro_STATSContext(configuration);
|
||||
Log.Info("Avviata classe MpStatsController.MpStatsController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Annulla modifiche su una specifica entity (cancel update)
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <returns></returns>
|
||||
public bool rollBackEntity(object item)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified)
|
||||
{
|
||||
dbCtx.Entry(item).Reload();
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella scarti da filtro
|
||||
/// </summary>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ResScarti> ScartiGetAll(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<DatabaseModels.ResScarti> dbResult = new List<DatabaseModels.ResScarti>();
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetScarti
|
||||
.Where(x => x.KeyRichiesta.Contains(searchVal) || x.Descrizione.Contains(searchVal) || x.CodArticolo.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||
.OrderByDescending(x => x.DataOra)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -5,15 +5,19 @@ using System.Collections.Generic;
|
||||
|
||||
namespace MpDataLayer.DatabaseModels
|
||||
{
|
||||
public partial class VRc
|
||||
public partial class ResControlli
|
||||
{
|
||||
public int IdxControllo { get; set; }
|
||||
#region Public Properties
|
||||
|
||||
public string CodArticolo { get; set; }
|
||||
public DateTime DataOra { get; set; }
|
||||
public bool EsitoOk { get; set; }
|
||||
public int IdxControllo { get; set; }
|
||||
public string IdxMacchina { get; set; }
|
||||
public int IdxOdl { get; set; }
|
||||
public string CodArticolo { get; set; }
|
||||
public int MatrOpr { get; set; }
|
||||
public bool EsitoOk { get; set; }
|
||||
public string Note { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,18 +5,22 @@ using System.Collections.Generic;
|
||||
|
||||
namespace MpDataLayer.DatabaseModels
|
||||
{
|
||||
public partial class VR
|
||||
public partial class ResScarti
|
||||
{
|
||||
public string IdxMacchina { get; set; }
|
||||
public DateTime DataOra { get; set; }
|
||||
#region Public Properties
|
||||
|
||||
public string Causale { get; set; }
|
||||
public int Qta { get; set; }
|
||||
public string Note { get; set; }
|
||||
public string CodArticolo { get; set; }
|
||||
public int MatrOpr { get; set; }
|
||||
public DateTime DataOra { get; set; }
|
||||
public DateTime? DataOraProdRec { get; set; }
|
||||
public string Descrizione { get; set; }
|
||||
public string KeyRichiesta { get; set; }
|
||||
public string IdxMacchina { get; set; }
|
||||
public int IdxOdl { get; set; }
|
||||
public string KeyRichiesta { get; set; }
|
||||
public int MatrOpr { get; set; }
|
||||
public string Note { get; set; }
|
||||
public int Qta { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,17 +5,21 @@ using System.Collections.Generic;
|
||||
|
||||
namespace MpDataLayer.DatabaseModels
|
||||
{
|
||||
public partial class VUl
|
||||
public partial class UserActionLog
|
||||
{
|
||||
public int IdxLog { get; set; }
|
||||
#region Public Properties
|
||||
|
||||
public string Azione { get; set; }
|
||||
public string CodArticolo { get; set; }
|
||||
public string Cognome { get; set; }
|
||||
public DateTime DataOraRif { get; set; }
|
||||
public int IdxLog { get; set; }
|
||||
public string IdxMacchina { get; set; }
|
||||
public int MatrOpr { get; set; }
|
||||
public string Cognome { get; set; }
|
||||
public string Nome { get; set; }
|
||||
public string CodArticolo { get; set; }
|
||||
public string Azione { get; set; }
|
||||
public string Valore { get; set; }
|
||||
public decimal Qta { get; set; }
|
||||
public string Valore { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MpDataLayer.DatabaseModels;
|
||||
using NLog;
|
||||
|
||||
#nullable disable
|
||||
|
||||
@@ -9,10 +11,19 @@ namespace MpDataLayer
|
||||
{
|
||||
public partial class MoonPro_STATSContext : DbContext
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private IConfiguration _configuration;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MoonPro_STATSContext()
|
||||
public MoonPro_STATSContext(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public MoonPro_STATSContext(DbContextOptions<MoonPro_STATSContext> options)
|
||||
@@ -50,8 +61,7 @@ namespace MpDataLayer
|
||||
public virtual DbSet<Ul> Uls { get; set; }
|
||||
#endif
|
||||
|
||||
#region Public Properties
|
||||
|
||||
#if false
|
||||
public virtual DbSet<VDdbLightOld> VDdbLightOlds { get; set; }
|
||||
public virtual DbSet<VDdbLight> VDdbLights { get; set; }
|
||||
public virtual DbSet<VDdb> VDdbs { get; set; }
|
||||
@@ -64,14 +74,20 @@ namespace MpDataLayer
|
||||
public virtual DbSet<VOdl> VOdls { get; set; }
|
||||
public virtual DbSet<VOdl1> VOdls1 { get; set; }
|
||||
public virtual DbSet<VPodlNonChiusi> VPodlNonChiusis { get; set; }
|
||||
public virtual DbSet<VRc> VRcs { get; set; }
|
||||
public virtual DbSet<VR> VRs { get; set; }
|
||||
public virtual DbSet<VR1> VRs1 { get; set; }
|
||||
#endif
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public virtual DbSet<ResControlli> DbSetControlli { get; set; }
|
||||
public virtual DbSet<ResScarti> DbSetScarti { get; set; }
|
||||
#if false
|
||||
public virtual DbSet<vRS> VRs1 { get; set; }
|
||||
public virtual DbSet<VTcrDay> VTcrDays { get; set; }
|
||||
public virtual DbSet<VTcr> VTcrs { get; set; }
|
||||
public virtual DbSet<VTcr1> VTcrs1 { get; set; }
|
||||
public virtual DbSet<VTcStat> VTcStats { get; set; }
|
||||
public virtual DbSet<VUl> VUls { get; set; }
|
||||
#endif
|
||||
public virtual DbSet<UserActionLog> DbSetUserLog { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -87,8 +103,12 @@ namespace MpDataLayer
|
||||
{
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
string connString = _configuration.GetConnectionString("Mp.Stats");
|
||||
|
||||
optionsBuilder.UseSqlServer(_configuration.GetConnectionString("Mp.Stats"));
|
||||
|
||||
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
|
||||
optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;");
|
||||
//optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -892,7 +912,6 @@ namespace MpDataLayer
|
||||
.HasMaxLength(250)
|
||||
.HasDefaultValueSql("('')");
|
||||
});
|
||||
#endif
|
||||
|
||||
modelBuilder.Entity<VDdb>(entity =>
|
||||
{
|
||||
@@ -1273,8 +1292,9 @@ namespace MpDataLayer
|
||||
|
||||
entity.Property(e => e.TotOreProg).HasColumnType("decimal(32, 11)");
|
||||
});
|
||||
#endif
|
||||
|
||||
modelBuilder.Entity<VR>(entity =>
|
||||
modelBuilder.Entity<ResScarti>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
|
||||
@@ -1310,8 +1330,9 @@ namespace MpDataLayer
|
||||
.IsRequired()
|
||||
.HasMaxLength(250);
|
||||
});
|
||||
#if false
|
||||
|
||||
modelBuilder.Entity<VR1>(entity =>
|
||||
modelBuilder.Entity<vRS>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
|
||||
@@ -1353,8 +1374,9 @@ namespace MpDataLayer
|
||||
.IsRequired()
|
||||
.HasMaxLength(250);
|
||||
});
|
||||
#endif
|
||||
|
||||
modelBuilder.Entity<VRc>(entity =>
|
||||
modelBuilder.Entity<ResControlli>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
|
||||
@@ -1381,34 +1403,35 @@ namespace MpDataLayer
|
||||
.HasMaxLength(250);
|
||||
});
|
||||
|
||||
#if false
|
||||
modelBuilder.Entity<VTcStat>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
{
|
||||
entity.HasNoKey();
|
||||
|
||||
entity.ToView("v_TC_Stat", "export");
|
||||
entity.ToView("v_TC_Stat", "export");
|
||||
|
||||
entity.Property(e => e.CodArticolo)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
entity.Property(e => e.CodArticolo)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.CodGruppo)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
entity.Property(e => e.CodGruppo)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.CodMacchina).HasMaxLength(50);
|
||||
entity.Property(e => e.CodMacchina).HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.DescMacchina).HasMaxLength(50);
|
||||
entity.Property(e => e.DescMacchina).HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.IdxMacchina)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
entity.Property(e => e.IdxMacchina)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.TcStat)
|
||||
.HasColumnType("decimal(18, 8)")
|
||||
.HasColumnName("TC_Stat");
|
||||
entity.Property(e => e.TcStat)
|
||||
.HasColumnType("decimal(18, 8)")
|
||||
.HasColumnName("TC_Stat");
|
||||
|
||||
entity.Property(e => e.TcType).HasColumnName("TC_Type");
|
||||
});
|
||||
entity.Property(e => e.TcType).HasColumnName("TC_Type");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<VTcr>(entity =>
|
||||
{
|
||||
@@ -1514,8 +1537,9 @@ namespace MpDataLayer
|
||||
.HasColumnType("decimal(18, 8)")
|
||||
.HasColumnName("TCMin");
|
||||
});
|
||||
#endif
|
||||
|
||||
modelBuilder.Entity<VUl>(entity =>
|
||||
modelBuilder.Entity<UserActionLog>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
|
||||
@@ -1551,6 +1575,7 @@ namespace MpDataLayer
|
||||
.IsRequired()
|
||||
.HasMaxLength(250);
|
||||
});
|
||||
#if false
|
||||
|
||||
modelBuilder.Entity<VetoTc>(entity =>
|
||||
{
|
||||
@@ -1571,6 +1596,7 @@ namespace MpDataLayer
|
||||
.HasColumnName("VetoTC")
|
||||
.HasDefaultValueSql("((1))");
|
||||
});
|
||||
#endif
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
@@ -30,11 +30,23 @@
|
||||
<Compile Remove="DatabaseModels\TcStat.cs" />
|
||||
<Compile Remove="DatabaseModels\TestJason.cs" />
|
||||
<Compile Remove="DatabaseModels\Ul.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\" />
|
||||
<Folder Include="DatabaseModels\" />
|
||||
<Compile Remove="DatabaseModels\VDdb.cs" />
|
||||
<Compile Remove="DatabaseModels\VDdbLight.cs" />
|
||||
<Compile Remove="DatabaseModels\VDdbLightOld.cs" />
|
||||
<Compile Remove="DatabaseModels\VDdbTurni.cs" />
|
||||
<Compile Remove="DatabaseModels\VEcp.cs" />
|
||||
<Compile Remove="DatabaseModels\VEcp1.cs" />
|
||||
<Compile Remove="DatabaseModels\VEcpExtended.cs" />
|
||||
<Compile Remove="DatabaseModels\VetoTc.cs" />
|
||||
<Compile Remove="DatabaseModels\VKit.cs" />
|
||||
<Compile Remove="DatabaseModels\VOdl.cs" />
|
||||
<Compile Remove="DatabaseModels\VOdl1.cs" />
|
||||
<Compile Remove="DatabaseModels\VPodlNonChiusi.cs" />
|
||||
<Compile Remove="DatabaseModels\VR1.cs" />
|
||||
<Compile Remove="DatabaseModels\VTcr.cs" />
|
||||
<Compile Remove="DatabaseModels\VTcr1.cs" />
|
||||
<Compile Remove="DatabaseModels\VTcrDay.cs" />
|
||||
<Compile Remove="DatabaseModels\VTcStat.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -45,6 +57,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NLog" Version="4.7.10" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user