Elenco clienti funzionante
This commit is contained in:
parent
b33f36a779
commit
0cd1367ef6
@ -39,12 +39,15 @@
|
||||
<Columns>
|
||||
<PropertyColumn Property="x => x.Name" Title="Cliente">
|
||||
<CellTemplate>
|
||||
<MudText Typo="Typo.body2">
|
||||
@context.Item.DisplayName
|
||||
</MudText>
|
||||
<MudText Typo="Typo.body1" Style="font-weight: bold;">
|
||||
@context.Item.Name
|
||||
</MudText>
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">
|
||||
@* #@context.Item.Id - @context.Item.Slug *@
|
||||
P. Iva: @context.Item.PartitaIva
|
||||
</MudText>
|
||||
<MudText Typo="Typo.body1">
|
||||
@context.Item.Name
|
||||
@context.Item.PartitaIva
|
||||
</MudText>
|
||||
</CellTemplate>
|
||||
</PropertyColumn>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using IntegryControlPanel.Models.IntegryControlPanel;
|
||||
using IntegryControlPanel.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
@ -19,100 +20,100 @@ namespace IntegryControlPanel.Controllers
|
||||
/// <summary>
|
||||
/// Ottiene tutti i customer con le informazioni anagrafiche joinate dalla vista vw_customer_anag_info
|
||||
/// </summary>
|
||||
//[HttpGet]
|
||||
//public async Task<ActionResult<IEnumerable<CustomerWithAnagInfo>>> GetCustomersWithAnagInfo()
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var customers = await _service.GetCustomersWithAnagInfoAsync();
|
||||
// return Ok(customers);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customers with anag info");
|
||||
// return StatusCode(500, "Errore interno del server");
|
||||
// }
|
||||
//}
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<CustomerWithAnagInfo>>> GetCustomersWithAnagInfo()
|
||||
{
|
||||
try
|
||||
{
|
||||
var customers = await _service.GetCustomersWithAnagInfoAsync();
|
||||
return Ok(customers);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error retrieving customers with anag info");
|
||||
return StatusCode(500, "Errore interno del server");
|
||||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Ottiene tutti i customer attivi con le informazioni anagrafiche
|
||||
///// </summary>
|
||||
//[HttpGet("active")]
|
||||
//public async Task<ActionResult<IEnumerable<CustomerWithAnagInfo>>> GetActiveCustomersWithAnagInfo()
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var customers = await _service.GetActiveCustomersWithAnagInfoAsync();
|
||||
// return Ok(customers);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving active customers with anag info");
|
||||
// return StatusCode(500, "Errore interno del server");
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// Ottiene tutti i customer attivi con le informazioni anagrafiche
|
||||
/// </summary>
|
||||
[HttpGet("active")]
|
||||
public async Task<ActionResult<IEnumerable<CustomerWithAnagInfo>>> GetActiveCustomersWithAnagInfo()
|
||||
{
|
||||
try
|
||||
{
|
||||
var customers = await _service.GetActiveCustomersWithAnagInfoAsync();
|
||||
return Ok(customers);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error retrieving active customers with anag info");
|
||||
return StatusCode(500, "Errore interno del server");
|
||||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Ottiene un customer con informazioni anagrafiche tramite ID
|
||||
///// </summary>
|
||||
//[HttpGet("{id:int}")]
|
||||
//public async Task<ActionResult<CustomerWithAnagInfo>> GetCustomerWithAnagInfoById(int id)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var customer = await _service.GetCustomerWithAnagInfoByIdAsync(id);
|
||||
// if (customer == null)
|
||||
// return NotFound($"Customer con ID {id} non trovato");
|
||||
/// <summary>
|
||||
/// Ottiene un customer con informazioni anagrafiche tramite ID
|
||||
/// </summary>
|
||||
[HttpGet("{id:int}")]
|
||||
public async Task<ActionResult<CustomerWithAnagInfo>> GetCustomerWithAnagInfoById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var customer = await _service.GetCustomerWithAnagInfoByIdAsync(id);
|
||||
if (customer == null)
|
||||
return NotFound($"Customer con ID {id} non trovato");
|
||||
|
||||
// return Ok(customer);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customer with anag info by id {CustomerId}", id);
|
||||
// return StatusCode(500, "Errore interno del server");
|
||||
// }
|
||||
//}
|
||||
return Ok(customer);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error retrieving customer with anag info by id {CustomerId}", id);
|
||||
return StatusCode(500, "Errore interno del server");
|
||||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Ottiene un customer con informazioni anagrafiche tramite slug
|
||||
///// </summary>
|
||||
//[HttpGet("slug/{slug}")]
|
||||
//public async Task<ActionResult<CustomerWithAnagInfo>> GetCustomerWithAnagInfoBySlug(string slug)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var customer = await _service.GetCustomerWithAnagInfoBySlugAsync(slug);
|
||||
// if (customer == null)
|
||||
// return NotFound($"Customer con slug '{slug}' non trovato");
|
||||
/// <summary>
|
||||
/// Ottiene un customer con informazioni anagrafiche tramite slug
|
||||
/// </summary>
|
||||
[HttpGet("slug/{slug}")]
|
||||
public async Task<ActionResult<CustomerWithAnagInfo>> GetCustomerWithAnagInfoBySlug(string slug)
|
||||
{
|
||||
try
|
||||
{
|
||||
var customer = await _service.GetCustomerWithAnagInfoBySlugAsync(slug);
|
||||
if (customer == null)
|
||||
return NotFound($"Customer con slug '{slug}' non trovato");
|
||||
|
||||
// return Ok(customer);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customer with anag info by slug {Slug}", slug);
|
||||
// return StatusCode(500, "Errore interno del server");
|
||||
// }
|
||||
//}
|
||||
return Ok(customer);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error retrieving customer with anag info by slug {Slug}", slug);
|
||||
return StatusCode(500, "Errore interno del server");
|
||||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Cerca customer con informazioni anagrafiche per termine di ricerca
|
||||
///// </summary>
|
||||
//[HttpGet("search")]
|
||||
//public async Task<ActionResult<IEnumerable<CustomerWithAnagInfo>>> SearchCustomersWithAnagInfo([FromQuery] string term)
|
||||
//{
|
||||
// if (string.IsNullOrWhiteSpace(term))
|
||||
// return BadRequest("Il termine di ricerca non può essere vuoto");
|
||||
/// <summary>
|
||||
/// Cerca customer con informazioni anagrafiche per termine di ricerca
|
||||
/// </summary>
|
||||
[HttpGet("search")]
|
||||
public async Task<ActionResult<IEnumerable<CustomerWithAnagInfo>>> SearchCustomersWithAnagInfo([FromQuery] string term)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(term))
|
||||
return BadRequest("Il termine di ricerca non può essere vuoto");
|
||||
|
||||
// try
|
||||
// {
|
||||
// var customers = await _service.SearchCustomersWithAnagInfoAsync(term);
|
||||
// return Ok(customers);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error searching customers with anag info for term {SearchTerm}", term);
|
||||
// return StatusCode(500, "Errore interno del server");
|
||||
// }
|
||||
//}
|
||||
try
|
||||
{
|
||||
var customers = await _service.SearchCustomersWithAnagInfoAsync(term);
|
||||
return Ok(customers);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error searching customers with anag info for term {SearchTerm}", term);
|
||||
return StatusCode(500, "Errore interno del server");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,980 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using IntegryControlPanel.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IntegryControlPanel.Migrations.IntegryControlPanelDb
|
||||
{
|
||||
[DbContext(typeof(IntegryControlPanelDbContext))]
|
||||
[Migration("20250925162221_AddCustomerAnagInfoView")]
|
||||
partial class AddCustomerAnagInfoView
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.9")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("AnnoContab")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("anno_contab");
|
||||
|
||||
b.Property<int?>("AnnoMagaz")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("anno_magaz");
|
||||
|
||||
b.Property<bool>("AnsiPadding")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("ansi_padding")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<bool>("ConcatNullYieldsNull")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("concat_null_yields_null")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<bool>("DelimitedIdentifier")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("delimited_identifier")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<string>("MenuPersonalizzato")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("menu_personalizzato");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<bool>("NewUpdProgMaga")
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("new_upd_prog_maga");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__applicat__3213E83F4185DE9F");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_D5E65179395C3F3");
|
||||
|
||||
b.ToTable("application_infos", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Client", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("DeviceId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("device_id");
|
||||
|
||||
b.Property<DateTime>("InsertDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("insert_date");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("NomeAzienda")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("nome_azienda");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__clients__3213E83FFF8DC3E2");
|
||||
|
||||
b.ToTable("clients", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Configurazioni", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("MaxPermSize")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("max_perm_size");
|
||||
|
||||
b.Property<string>("NomeAzienda")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("nome_azienda");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<string>("Xms")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xms");
|
||||
|
||||
b.Property<string>("Xmx")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xmx");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__configur__3213E83FB9077FED");
|
||||
|
||||
b.ToTable("configurazioni", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Customer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<bool>("Active")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("active")
|
||||
.HasDefaultValueSql("('0')");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("partita_iva");
|
||||
|
||||
b.Property<string>("Slug")
|
||||
.IsRequired()
|
||||
.HasMaxLength(191)
|
||||
.HasColumnType("nvarchar(191)")
|
||||
.HasColumnName("slug");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__customer__3213E83FD00417AC");
|
||||
|
||||
b.HasIndex(new[] { "Slug" }, "UNIQ_62534E21989D9B62")
|
||||
.IsUnique()
|
||||
.HasFilter("([slug] IS NOT NULL)");
|
||||
|
||||
b.ToTable("customers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.CustomerWithAnagInfo", b =>
|
||||
{
|
||||
b.ToTable((string)null);
|
||||
|
||||
b.ToSqlQuery("\r\n SELECT \r\n c.id,\r\n c.name,\r\n c.slug,\r\n c.active,\r\n c.partita_iva,\r\n COALESCE(va.name, c.name) AS display_name\r\n FROM customers c\r\n LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug\r\n ");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("ProductEdition")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_edition");
|
||||
|
||||
b.Property<string>("ProductLevel")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_level");
|
||||
|
||||
b.Property<string>("ProductVersion")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_version");
|
||||
|
||||
b.Property<string>("ProductVersionName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("product_version_name");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__database__3213E83F8526E221");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "UNIQ_1D94CC5C9395C3F3")
|
||||
.IsUnique()
|
||||
.HasFilter("([customer_id] IS NOT NULL)");
|
||||
|
||||
b.ToTable("database_engines", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabasesInfo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("DatabaseEngineId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("database_engine_id");
|
||||
|
||||
b.Property<string>("LogicalName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("logical_name");
|
||||
|
||||
b.Property<int>("MaxSizeMb")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("max_size_mb");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<int>("SizeMb")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("size_mb");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__database__3213E83FC619B4B0");
|
||||
|
||||
b.HasIndex(new[] { "DatabaseEngineId" }, "IDX_99DAF4F8AB25983");
|
||||
|
||||
b.ToTable("databases_info", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Device", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.IsRequired()
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("info")
|
||||
.HasComment("(DC2Type:simple_array)");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("ip");
|
||||
|
||||
b.Property<int>("Port")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("port");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__devices__3213E83F185C7B65");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_11074E9A9395C3F3");
|
||||
|
||||
b.ToTable("devices", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Installation", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("DeviceId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("device_id");
|
||||
|
||||
b.Property<DateTime>("InstallDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("install_date");
|
||||
|
||||
b.Property<DateTime>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("notes");
|
||||
|
||||
b.Property<string>("Options")
|
||||
.IsRequired()
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("options")
|
||||
.HasComment("(DC2Type:simple_array)");
|
||||
|
||||
b.Property<int?>("ReleaseId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("release_id");
|
||||
|
||||
b.Property<int?>("ServerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("server_id");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__installa__3213E83F11ECD973");
|
||||
|
||||
b.HasIndex(new[] { "ServerId" }, "IDX_A774F67B1844E6B7");
|
||||
|
||||
b.HasIndex(new[] { "DeviceId" }, "IDX_A774F67B94A4C7D4");
|
||||
|
||||
b.HasIndex(new[] { "ReleaseId" }, "IDX_A774F67BB12A727D");
|
||||
|
||||
b.ToTable("installations", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.PvmsInfo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("DefaultCharset")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("default_charset");
|
||||
|
||||
b.Property<string>("Imagick")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("imagick");
|
||||
|
||||
b.Property<bool>("MagicQuotesGpc")
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("magic_quotes_gpc");
|
||||
|
||||
b.Property<int>("MaxExecutionTime")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("max_execution_time");
|
||||
|
||||
b.Property<int>("MaxInputVars")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("max_input_vars");
|
||||
|
||||
b.Property<string>("MemoryLimit")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("memory_limit");
|
||||
|
||||
b.Property<string>("PhpVersion")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("php_version");
|
||||
|
||||
b.Property<string>("PostMaxSize")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("post_max_size");
|
||||
|
||||
b.Property<bool>("SodiumMissing")
|
||||
.HasColumnType("bit")
|
||||
.HasColumnName("sodium_missing");
|
||||
|
||||
b.Property<string>("Timezone")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("timezone");
|
||||
|
||||
b.Property<string>("UploadMaxSize")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("upload_max_size");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__pvms_inf__3213E83F8EA1FE36");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_4BCCAB779395C3F3");
|
||||
|
||||
b.ToTable("pvms_info", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Release", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Changelog")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("changelog");
|
||||
|
||||
b.Property<DateTime>("ReleaseDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("release_date");
|
||||
|
||||
b.Property<int?>("ServiceId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("service_id");
|
||||
|
||||
b.Property<string>("Version")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("version");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__releases__3213E83F59E90B83");
|
||||
|
||||
b.HasIndex(new[] { "ServiceId" }, "IDX_7896E4D1ED5CA9E6");
|
||||
|
||||
b.ToTable("releases", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.SalvataggiSoap", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("ApplicationInfoId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("application_info_id");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__salvatag__3213E83F51C2D8BF");
|
||||
|
||||
b.HasIndex(new[] { "ApplicationInfoId" }, "IDX_BC9B16D5B635C4CB");
|
||||
|
||||
b.ToTable("salvataggi_soap", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Server", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime?>("CreatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("info")
|
||||
.HasComment("(DC2Type:simple_array)");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("ip");
|
||||
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("MaxPermSize")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("max_perm_size");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<int?>("Port")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("port");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("updated_at");
|
||||
|
||||
b.Property<string>("Xms")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xms");
|
||||
|
||||
b.Property<string>("Xmx")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xmx");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__servers__3213E83F0E4B2C74");
|
||||
|
||||
b.HasIndex(new[] { "CustomerId" }, "IDX_4F8AF5F79395C3F3");
|
||||
|
||||
b.ToTable("servers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Service", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<DateTime>("InsertDate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("insert_date");
|
||||
|
||||
b.Property<string>("Language")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("language");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<string>("Slug")
|
||||
.IsRequired()
|
||||
.HasMaxLength(191)
|
||||
.HasColumnType("nvarchar(191)")
|
||||
.HasColumnName("slug");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK__services__3213E83FB43C1FE2");
|
||||
|
||||
b.HasIndex(new[] { "Slug" }, "UNIQ_7332E169989D9B62")
|
||||
.IsUnique()
|
||||
.HasFilter("([slug] IS NOT NULL)");
|
||||
|
||||
b.ToTable("services", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.VwCustomerServerInfo", b =>
|
||||
{
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(298)
|
||||
.HasColumnType("nvarchar(298)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("partita_iva");
|
||||
|
||||
b.Property<string>("RagSoc")
|
||||
.HasMaxLength(40)
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnName("rag_soc");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<string>("SimpleName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("simple_name");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("updated_at");
|
||||
|
||||
b.ToTable((string)null);
|
||||
|
||||
b.ToView("vw_customer_server_info", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.VwServerLastUpdate", b =>
|
||||
{
|
||||
b.Property<DateTime?>("CreatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int?>("CustomerId")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("customer_id");
|
||||
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.IsUnicode(false)
|
||||
.HasColumnType("varchar(max)")
|
||||
.HasColumnName("info");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("ip");
|
||||
|
||||
b.Property<string>("JavaVersion")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("java_version");
|
||||
|
||||
b.Property<DateTime?>("LastUpdate")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("last_update");
|
||||
|
||||
b.Property<string>("MaxPermSize")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("max_perm_size");
|
||||
|
||||
b.Property<string>("OsArch")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_arch");
|
||||
|
||||
b.Property<string>("OsName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("os_name");
|
||||
|
||||
b.Property<int?>("Port")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("port");
|
||||
|
||||
b.Property<string>("RemoteAddr")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("remote_addr");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasPrecision(6)
|
||||
.HasColumnType("datetime2(6)")
|
||||
.HasColumnName("updated_at");
|
||||
|
||||
b.Property<string>("Xms")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xms");
|
||||
|
||||
b.Property<string>("Xmx")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)")
|
||||
.HasColumnName("xmx");
|
||||
|
||||
b.ToTable((string)null);
|
||||
|
||||
b.ToView("vw_server_last_update", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("ApplicationInfos")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_D5E65179395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithOne("DatabaseEngine")
|
||||
.HasForeignKey("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", "CustomerId")
|
||||
.HasConstraintName("FK_1D94CC5C9395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabasesInfo", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", "DatabaseEngine")
|
||||
.WithMany("DatabasesInfos")
|
||||
.HasForeignKey("DatabaseEngineId")
|
||||
.HasConstraintName("FK_99DAF4F8AB25983");
|
||||
|
||||
b.Navigation("DatabaseEngine");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Device", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("Devices")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_11074E9A9395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Installation", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Device", "Device")
|
||||
.WithMany("Installations")
|
||||
.HasForeignKey("DeviceId")
|
||||
.HasConstraintName("FK_A774F67B94A4C7D4");
|
||||
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Release", "Release")
|
||||
.WithMany("Installations")
|
||||
.HasForeignKey("ReleaseId")
|
||||
.HasConstraintName("FK_A774F67BB12A727D");
|
||||
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Server", "Server")
|
||||
.WithMany("Installations")
|
||||
.HasForeignKey("ServerId")
|
||||
.HasConstraintName("FK_A774F67B1844E6B7");
|
||||
|
||||
b.Navigation("Device");
|
||||
|
||||
b.Navigation("Release");
|
||||
|
||||
b.Navigation("Server");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.PvmsInfo", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("PvmsInfos")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_4BCCAB779395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Release", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Service", "Service")
|
||||
.WithMany("Releases")
|
||||
.HasForeignKey("ServiceId")
|
||||
.HasConstraintName("FK_7896E4D1ED5CA9E6");
|
||||
|
||||
b.Navigation("Service");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.SalvataggiSoap", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", "ApplicationInfo")
|
||||
.WithMany("SalvataggiSoaps")
|
||||
.HasForeignKey("ApplicationInfoId")
|
||||
.HasConstraintName("FK_BC9B16D5B635C4CB");
|
||||
|
||||
b.Navigation("ApplicationInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Server", b =>
|
||||
{
|
||||
b.HasOne("IntegryControlPanel.Models.IntegryControlPanel.Customer", "Customer")
|
||||
.WithMany("Servers")
|
||||
.HasForeignKey("CustomerId")
|
||||
.HasConstraintName("FK_4F8AF5F79395C3F3");
|
||||
|
||||
b.Navigation("Customer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.ApplicationInfo", b =>
|
||||
{
|
||||
b.Navigation("SalvataggiSoaps");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Customer", b =>
|
||||
{
|
||||
b.Navigation("ApplicationInfos");
|
||||
|
||||
b.Navigation("DatabaseEngine");
|
||||
|
||||
b.Navigation("Devices");
|
||||
|
||||
b.Navigation("PvmsInfos");
|
||||
|
||||
b.Navigation("Servers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", b =>
|
||||
{
|
||||
b.Navigation("DatabasesInfos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Device", b =>
|
||||
{
|
||||
b.Navigation("Installations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Release", b =>
|
||||
{
|
||||
b.Navigation("Installations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Server", b =>
|
||||
{
|
||||
b.Navigation("Installations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.Service", b =>
|
||||
{
|
||||
b.Navigation("Releases");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IntegryControlPanel.Migrations.IntegryControlPanelDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddCustomerAnagInfoView : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(@"CREATE VIEW vw_customer_anag_info AS
|
||||
SELECT
|
||||
slug,
|
||||
ISNULL(rag_soc, customers.name) +
|
||||
IIF(COUNT(partita_iva) OVER (partition by partita_iva) > 1,
|
||||
CONCAT(' (', customers.name, ')'),
|
||||
''
|
||||
) AS name
|
||||
FROM customers
|
||||
LEFT OUTER JOIN (
|
||||
SELECT DISTINCT part_iva, rag_soc
|
||||
FROM studioml.dbo.gtb_anag
|
||||
INNER JOIN studioml.dbo.vtb_clie ON vtb_clie.cod_anag = gtb_anag.cod_anag
|
||||
WHERE flag_stato = 'A'
|
||||
) gtb_anag ON customers.partita_iva = gtb_anag.part_iva");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("DROP VIEW vw_customer_anag_info");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -229,6 +229,13 @@ namespace IntegryControlPanel.Migrations.IntegryControlPanelDb
|
||||
b.ToTable("customers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.CustomerWithAnagInfo", b =>
|
||||
{
|
||||
b.ToTable((string)null);
|
||||
|
||||
b.ToSqlQuery("\r\n SELECT \r\n c.id,\r\n c.name,\r\n c.slug,\r\n c.active,\r\n c.partita_iva,\r\n COALESCE(va.name, c.name) AS display_name\r\n FROM customers c\r\n LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug\r\n ");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IntegryControlPanel.Models.IntegryControlPanel.DatabaseEngine", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
namespace IntegryControlPanel.Models.IntegryControlPanel;
|
||||
|
||||
public partial class CustomerWithAnagInfo
|
||||
{
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
public string Slug { get; set; } = null!;
|
||||
|
||||
public bool? Active { get; set; }
|
||||
|
||||
public string? PartitaIva { get; set; }
|
||||
|
||||
public string? DisplayName { get; set; }
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
namespace IntegryControlPanel.Models.IntegryControlPanel;
|
||||
|
||||
public partial class VwCustomerAnagInfo
|
||||
{
|
||||
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
public string Slug { get; set; } = null!;
|
||||
}
|
||||
@ -53,15 +53,11 @@ namespace IntegryControlPanel.Services
|
||||
Task<int> GetTotalDevicesAsync();
|
||||
Task<int> GetTotalInstallationsAsync();
|
||||
|
||||
// Customer Server Info View operations
|
||||
//Task<IEnumerable<VwCustomerAnagInfo>> GetCustomerServerInfoAsync();
|
||||
//Task<IEnumerable<VwCustomerAnagInfo>> GetCustomerServerInfoBySlugAsync(string slug);
|
||||
|
||||
//// CustomerWithAnagInfo operations
|
||||
//Task<IEnumerable<CustomerWithAnagInfo>> GetCustomersWithAnagInfoAsync();
|
||||
//Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoByIdAsync(int id);
|
||||
//Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoBySlugAsync(string slug);
|
||||
//Task<IEnumerable<CustomerWithAnagInfo>> GetActiveCustomersWithAnagInfoAsync();
|
||||
//Task<IEnumerable<CustomerWithAnagInfo>> SearchCustomersWithAnagInfoAsync(string searchTerm);
|
||||
// CustomerWithAnagInfo operations
|
||||
Task<IEnumerable<CustomerWithAnagInfo>> GetCustomersWithAnagInfoAsync();
|
||||
Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoByIdAsync(int id);
|
||||
Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoBySlugAsync(string slug);
|
||||
Task<IEnumerable<CustomerWithAnagInfo>> GetActiveCustomersWithAnagInfoAsync();
|
||||
Task<IEnumerable<CustomerWithAnagInfo>> SearchCustomersWithAnagInfoAsync(string searchTerm);
|
||||
}
|
||||
}
|
||||
@ -581,144 +581,131 @@ namespace IntegryControlPanel.Services
|
||||
|
||||
#endregion
|
||||
|
||||
//#region CustomerWithAnagInfo Operations
|
||||
#region CustomerWithAnagInfo Operations
|
||||
|
||||
//public async Task<IEnumerable<CustomerWithAnagInfo>> GetCustomersWithAnagInfoAsync()
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var query = @"
|
||||
// SELECT
|
||||
// c.id,
|
||||
// c.name,
|
||||
// c.slug,
|
||||
// c.active,
|
||||
// c.partita_iva,
|
||||
// COALESCE(va.name, c.name) AS display_name
|
||||
// FROM customers c
|
||||
// LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
// ORDER BY COALESCE(va.name, c.name), c.name
|
||||
// ";
|
||||
public async Task<IEnumerable<CustomerWithAnagInfo>> GetCustomersWithAnagInfoAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _context.CustomerWithAnagInfos.ToListAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error retrieving customers with anag info");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
// return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query).ToListAsync();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customers with anag info");
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
public async Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoByIdAsync(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var query = @"
|
||||
SELECT
|
||||
c.id,
|
||||
c.name,
|
||||
c.slug,
|
||||
c.active,
|
||||
c.partita_iva,
|
||||
COALESCE(va.name, c.name) AS display_name
|
||||
FROM customers c
|
||||
LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
WHERE c.id = {0}
|
||||
";
|
||||
|
||||
//public async Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoByIdAsync(int id)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var query = @"
|
||||
// SELECT
|
||||
// c.id,
|
||||
// c.name,
|
||||
// c.slug,
|
||||
// c.active,
|
||||
// c.partita_iva,
|
||||
// COALESCE(va.name, c.name) AS display_name
|
||||
// FROM customers c
|
||||
// LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
// WHERE c.id = {0}
|
||||
// ";
|
||||
return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query, id).FirstOrDefaultAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error retrieving customer with anag info by id {CustomerId}", id);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
// return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query, id).FirstOrDefaultAsync();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customer with anag info by id {CustomerId}", id);
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
public async Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoBySlugAsync(string slug)
|
||||
{
|
||||
try
|
||||
{
|
||||
var query = @"
|
||||
SELECT
|
||||
c.id,
|
||||
c.name,
|
||||
c.slug,
|
||||
c.active,
|
||||
c.partita_iva,
|
||||
COALESCE(va.name, c.name) AS display_name
|
||||
FROM customers c
|
||||
LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
WHERE c.slug = {0}
|
||||
";
|
||||
|
||||
//public async Task<CustomerWithAnagInfo?> GetCustomerWithAnagInfoBySlugAsync(string slug)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var query = @"
|
||||
// SELECT
|
||||
// c.id,
|
||||
// c.name,
|
||||
// c.slug,
|
||||
// c.active,
|
||||
// c.partita_iva,
|
||||
// COALESCE(va.name, c.name) AS display_name
|
||||
// FROM customers c
|
||||
// LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
// WHERE c.slug = {0}
|
||||
// ";
|
||||
return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query, slug).FirstOrDefaultAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error retrieving customer with anag info by slug {Slug}", slug);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
// return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query, slug).FirstOrDefaultAsync();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving customer with anag info by slug {Slug}", slug);
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
public async Task<IEnumerable<CustomerWithAnagInfo>> GetActiveCustomersWithAnagInfoAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
var query = @"
|
||||
SELECT
|
||||
c.id,
|
||||
c.name,
|
||||
c.slug,
|
||||
c.active,
|
||||
c.partita_iva,
|
||||
COALESCE(va.name, c.name) AS display_name
|
||||
FROM customers c
|
||||
LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
WHERE c.active = 1
|
||||
ORDER BY COALESCE(va.name, c.name), c.name
|
||||
";
|
||||
|
||||
//public async Task<IEnumerable<CustomerWithAnagInfo>> GetActiveCustomersWithAnagInfoAsync()
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var query = @"
|
||||
// SELECT
|
||||
// c.id,
|
||||
// c.name,
|
||||
// c.slug,
|
||||
// c.active,
|
||||
// c.partita_iva,
|
||||
// COALESCE(va.name, c.name) AS display_name
|
||||
// FROM customers c
|
||||
// LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
// WHERE c.active = 1
|
||||
// ORDER BY COALESCE(va.name, c.name), c.name
|
||||
// ";
|
||||
return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query).ToListAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error retrieving active customers with anag info");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
// return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query).ToListAsync();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error retrieving active customers with anag info");
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
public async Task<IEnumerable<CustomerWithAnagInfo>> SearchCustomersWithAnagInfoAsync(string searchTerm)
|
||||
{
|
||||
try
|
||||
{
|
||||
var query = @"
|
||||
SELECT
|
||||
c.id,
|
||||
c.name,
|
||||
c.slug,
|
||||
c.active,
|
||||
c.partita_iva,
|
||||
COALESCE(va.name, c.name) AS display_name
|
||||
FROM customers c
|
||||
LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
WHERE COALESCE(va.name, c.name) LIKE {0}
|
||||
OR c.name LIKE {0}
|
||||
OR c.slug LIKE {0}
|
||||
OR c.partita_iva LIKE {0}
|
||||
ORDER BY COALESCE(va.name, c.name), c.name
|
||||
";
|
||||
|
||||
//public async Task<IEnumerable<CustomerWithAnagInfo>> SearchCustomersWithAnagInfoAsync(string searchTerm)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var query = @"
|
||||
// SELECT
|
||||
// c.id,
|
||||
// c.name,
|
||||
// c.slug,
|
||||
// c.active,
|
||||
// c.partita_iva,
|
||||
// COALESCE(va.name, c.name) AS display_name
|
||||
// FROM customers c
|
||||
// LEFT JOIN vw_customer_anag_info va ON c.slug = va.slug
|
||||
// WHERE COALESCE(va.name, c.name) LIKE {0}
|
||||
// OR c.name LIKE {0}
|
||||
// OR c.slug LIKE {0}
|
||||
// OR c.partita_iva LIKE {0}
|
||||
// ORDER BY COALESCE(va.name, c.name), c.name
|
||||
// ";
|
||||
var searchPattern = $"%{searchTerm}%";
|
||||
return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query, searchPattern).ToListAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error searching customers with anag info for term {SearchTerm}", searchTerm);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
// var searchPattern = $"%{searchTerm}%";
|
||||
// return await _context.Database.SqlQueryRaw<CustomerWithAnagInfo>(query, searchPattern).ToListAsync();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// _logger.LogError(ex, "Error searching customers with anag info for term {SearchTerm}", searchTerm);
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
|
||||
//#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user