bozza gestione elenco utenti in MP LAND

This commit is contained in:
Samuele E. Locatelli
2018-05-29 00:18:54 +02:00
parent 1b921943b5
commit 010ed20ce2
13 changed files with 156 additions and 30 deletions
-1
View File
@@ -58,7 +58,6 @@
<div class="row mb-1">
<div class="col-12">
<div class="ui-title text-uppercase">@Html.DisplayFor(modelItem => item.Nome)</div>
@*<div class="small text-lowercase">@Html.DisplayFor(modelItem => item.DescrizioneStato)</div>*@
</div>
</div>
<div class="row pt-0 pb-2 px-1 fontSmall">
+36 -3
View File
@@ -5,6 +5,9 @@ using System.Diagnostics;
using System.Linq;
using System.Web.Configuration;
using System.Web.Mvc;
using ZXing.Common;
using ZXing;
using ZXing.QrCode;
namespace MP.Controllers
{
@@ -29,7 +32,7 @@ namespace MP.Controllers
ViewBag.UrlMpMON = ctx.stp_AKV_getByKey("UrlMpMON").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpTAB = ctx.stp_AKV_getByKey("UrlMpTAB").ToList<AnagKeyValue>()[0].valString;
}
catch(Exception exc)
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Eccezione in composizione HOME page LAND:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
ViewBag.UrlMpSite = WebConfigurationManager.AppSettings["UrlMpSite"];//"../MP/SITE";
@@ -156,8 +159,8 @@ namespace MP.Controllers
done += UpdateMan.obj.downloadLatest(updateUrl("ADM"), localDownloadPath("ADM"), "ADM");
done += UpdateMan.obj.downloadLatest(updateUrl("IO"), localDownloadPath("IO"), "IO");
done += UpdateMan.obj.downloadLatest(updateUrl("LAND"), localDownloadPath("LAND"), "LAND");
done += UpdateMan.obj.downloadLatest(updateUrl("MON"), localDownloadPath("MON"),"MON");
done += UpdateMan.obj.downloadLatest(updateUrl("SITE"), localDownloadPath("SITE"),"SITE");
done += UpdateMan.obj.downloadLatest(updateUrl("MON"), localDownloadPath("MON"), "MON");
done += UpdateMan.obj.downloadLatest(updateUrl("SITE"), localDownloadPath("SITE"), "SITE");
done += UpdateMan.obj.downloadLatest(updateUrl("TAB"), localDownloadPath("TAB"), "TAB");
stopWatch.Stop();
// calcolo elapsed time come TimeSpan value.
@@ -176,6 +179,36 @@ namespace MP.Controllers
}
public ActionResult UserListQR()
{
QrCodeEncodingOptions options = new QrCodeEncodingOptions
{
DisableECI = true,
CharacterSet = "UTF-8",
Width = 250,
Height = 250,
};
var writer = new BarcodeWriter();
writer.Format = BarcodeFormat.QR_CODE;
writer.Options = options;
ViewBag.Title = "MAPO QR";
ViewBag.Message = "Elenco Utenti";
ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"];
using (var ctx = new MoonProEntities())
{
try
{
// esegue stored procedure come function, recuperando chiave desiderata...
var elOperatori = ctx.AnagraficaOperatori.ToList<AnagraficaOperatori>();
ViewBag.elOperatori = elOperatori;
}
catch
{ }
}
return View(ViewBag.elOperatori);
}
/// <summary>
/// Path locale dove scaricare gli installer
/// </summary>
+10
View File
@@ -116,6 +116,12 @@
<HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="zxing, Version=0.16.4.0, Culture=neutral, PublicKeyToken=4e88037ac681fe60, processorArchitecture=MSIL">
<HintPath>..\packages\ZXing.Net.0.16.4\lib\net461\zxing.dll</HintPath>
</Reference>
<Reference Include="zxing.presentation, Version=0.16.4.0, Culture=neutral, PublicKeyToken=4e88037ac681fe60, processorArchitecture=MSIL">
<HintPath>..\packages\ZXing.Net.0.16.4\lib\net461\zxing.presentation.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\VersGen\MoonPro.cs">
@@ -131,6 +137,9 @@
<Compile Include="Models\AnagKeyValue.cs">
<DependentUpon>MPModel.tt</DependentUpon>
</Compile>
<Compile Include="Models\AnagraficaOperatori.cs">
<DependentUpon>MPModel.tt</DependentUpon>
</Compile>
<Compile Include="Models\MPModel.Context.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@@ -264,6 +273,7 @@
<Content Include="Views\Home\Contact.cshtml" />
<Content Include="Views\Home\Index.cshtml" />
<Content Include="Views\Home\Packages.cshtml" />
<Content Include="Views\Home\UserListQR.cshtml" />
<None Include="Views\Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
+5 -4
View File
@@ -1,16 +1,17 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
// Codice generato da un modello.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// Le modifiche manuali a questo file potrebbero causare un comportamento imprevisto dell'applicazione.
// Se il codice viene rigenerato, le modifiche manuali al file verranno sovrascritte.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MP.Models
{
using System;
using System.Collections.Generic;
public partial class AnagKeyValue
{
public string nomeVar { get; set; }
+23
View File
@@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Codice generato da un modello.
//
// Le modifiche manuali a questo file potrebbero causare un comportamento imprevisto dell'applicazione.
// Se il codice viene rigenerato, le modifiche manuali al file verranno sovrascritte.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MP.Models
{
using System;
using System.Collections.Generic;
public partial class AnagraficaOperatori
{
public int MatrOpr { get; set; }
public string Cognome { get; set; }
public string Nome { get; set; }
public Nullable<bool> isAdmin { get; set; }
public string authKey { get; set; }
}
}
+8 -5
View File
@@ -1,18 +1,20 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
// Codice generato da un modello.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// Le modifiche manuali a questo file potrebbero causare un comportamento imprevisto dell'applicazione.
// Se il codice viene rigenerato, le modifiche manuali al file verranno sovrascritte.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MP.Models
{
using System;
using System.Data.Entity;
using System.Data.Entity.Core.Objects;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.Core.Objects;
using System.Linq;
public partial class MoonProEntities : DbContext
{
public MoonProEntities()
@@ -26,6 +28,7 @@ namespace MP.Models
}
public virtual DbSet<AnagKeyValue> AnagKeyValue { get; set; }
public virtual DbSet<AnagraficaOperatori> AnagraficaOperatori { get; set; }
public virtual ObjectResult<AnagKeyValue> stp_AKV_getByKey(string nomeVar)
{
+9 -9
View File
@@ -1,10 +1,10 @@
// T4 code generation is enabled for model 'C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\MAPO\MoonPro_dotnet\MP\Models\MPModel.edmx'.
// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer
// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model
// is open in the designer.
// Generazione del codice predefinita abilitata per il modello 'C:\Users\samuele\Documents\VisualStudioProjects\MoonPro_dotnet\MP\Models\MPModel.edmx'.
// Per abilitare la generazione del codice legacy, modificare il valore della proprietà della finestra di progettazione 'Strategia di generazione del codice
// su 'Legacy ObjectContext'. Questa proprietà è disponibile nella finestra Proprietà quando il modello è
// aperto nella finestra di progettazione.
// If no context and entity classes have been generated, it may be because you created an empty model but
// have not yet chosen which version of Entity Framework to use. To generate a context class and entity
// classes for your model, open the model in the designer, right-click on the designer surface, and
// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation
// Item...'.
// La mancata generazione di classi contesto ed entità può essere dovuta al fatto che è stato creato un modello vuoto, ma
// non è ancora stata scelta la versione di Entity Framework da utilizzare. Per generare una classe contesto e classi entità
// per il modello, aprire il modello nella finestra di progettazione, fare clic con il pulsante destro del mouse nell'area di progettazione e
// selezionare 'Aggiorna modello da database...', 'Genera database da modello...' o 'Aggiungi elemento di generazione
// codice...'.
+3 -3
View File
@@ -1,9 +1,9 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
// Codice generato da un modello.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// Le modifiche manuali a questo file potrebbero causare un comportamento imprevisto dell'applicazione.
// Se il codice viene rigenerato, le modifiche manuali al file verranno sovrascritte.
// </auto-generated>
//------------------------------------------------------------------------------
+34 -1
View File
@@ -15,11 +15,22 @@
<Property Name="valString" Type="nvarchar" MaxLength="250" />
<Property Name="descrizione" Type="nvarchar" MaxLength="250" />
</EntityType>
<EntityType Name="AnagraficaOperatori">
<Key>
<PropertyRef Name="MatrOpr" />
</Key>
<Property Name="MatrOpr" Type="int" Nullable="false" />
<Property Name="Cognome" Type="nvarchar" MaxLength="50" />
<Property Name="Nome" Type="nvarchar" MaxLength="50" />
<Property Name="isAdmin" Type="bit" />
<Property Name="authKey" Type="nvarchar" MaxLength="50" />
</EntityType>
<Function Name="stp_AKV_getByKey" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
<Parameter Name="nomeVar" Type="nvarchar" Mode="In" />
</Function>
<EntityContainer Name="MoonProModelStoreContainer">
<EntitySet Name="AnagKeyValue" EntityType="Self.AnagKeyValue" Schema="dbo" store:Type="Tables" />
<EntitySet Name="AnagraficaOperatori" EntityType="Self.AnagraficaOperatori" Schema="dbo" store:Type="Tables" />
</EntityContainer>
</Schema></edmx:StorageModels>
<!-- CSDL content -->
@@ -38,8 +49,9 @@
<EntityContainer Name="MoonProEntities" annotation:LazyLoadingEnabled="true">
<EntitySet Name="AnagKeyValue" EntityType="Self.AnagKeyValue" />
<FunctionImport Name="stp_AKV_getByKey" EntitySet="AnagKeyValue" ReturnType="Collection(MoonProModel.AnagKeyValue)">
<Parameter Name="nomeVar" Mode="In" Type="String" />
<Parameter Name="nomeVar" Mode="In" Type="String" />
</FunctionImport>
<EntitySet Name="AnagraficaOperatori" EntityType="MoonProModel.AnagraficaOperatori" />
</EntityContainer>
<ComplexType Name="stp_AKV_getByKey_Result">
<Property Type="String" Name="nomeVar" Nullable="false" MaxLength="50" />
@@ -48,6 +60,16 @@
<Property Type="String" Name="valString" Nullable="false" MaxLength="250" />
<Property Type="String" Name="descrizione" Nullable="false" MaxLength="250" />
</ComplexType>
<EntityType Name="AnagraficaOperatori">
<Key>
<PropertyRef Name="MatrOpr" />
</Key>
<Property Name="MatrOpr" Type="Int32" Nullable="false" />
<Property Name="Cognome" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="Nome" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="isAdmin" Type="Boolean" />
<Property Name="authKey" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
</EntityType>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
@@ -67,6 +89,17 @@
</EntitySetMapping>
<FunctionImportMapping FunctionImportName="stp_AKV_getByKey" FunctionName="MoonProModel.Store.stp_AKV_getByKey">
</FunctionImportMapping>
<EntitySetMapping Name="AnagraficaOperatori">
<EntityTypeMapping TypeName="MoonProModel.AnagraficaOperatori">
<MappingFragment StoreEntitySet="AnagraficaOperatori">
<ScalarProperty Name="authKey" ColumnName="authKey" />
<ScalarProperty Name="isAdmin" ColumnName="isAdmin" />
<ScalarProperty Name="Nome" ColumnName="Nome" />
<ScalarProperty Name="Cognome" ColumnName="Cognome" />
<ScalarProperty Name="MatrOpr" ColumnName="MatrOpr" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>
+1
View File
@@ -6,6 +6,7 @@
<edmx:Diagrams>
<Diagram DiagramId="a6d61082f57a4ed79c7abe33c0053690" Name="Diagram1">
<EntityTypeShape EntityType="MoonProModel.AnagKeyValue" Width="1.5" PointX="0.75" PointY="0.75" IsExpanded="true" />
<EntityTypeShape EntityType="MoonProModel.AnagraficaOperatori" Width="1.5" PointX="3.375" PointY="0.75" />
</Diagram>
</edmx:Diagrams>
</edmx:Designer>
+5 -4
View File
@@ -1,15 +1,16 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
// Codice generato da un modello.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// Le modifiche manuali a questo file potrebbero causare un comportamento imprevisto dell'applicazione.
// Se il codice viene rigenerato, le modifiche manuali al file verranno sovrascritte.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MP.Models
{
using System;
public partial class stp_AKV_getByKey_Result
{
public string nomeVar { get; set; }
+21
View File
@@ -0,0 +1,21 @@
@model IEnumerable<MP.Models.AnagraficaOperatori>
@{
ViewBag.Title = "QR Codes";
}
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<p>Elenco utenti e codici accesso barcode per TAB</p>
<div class="row">
@foreach (var item in Model)
{
<div class="col-xs-4">
@item.MatrOpr
</div>
<div class="col-xs-8">
@item.authKey
</div>
}
</div>
+1
View File
@@ -16,4 +16,5 @@
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net462" />
<package id="Respond" version="1.4.2" targetFramework="net462" />
<package id="WebGrease" version="1.6.0" targetFramework="net462" />
<package id="ZXing.Net" version="0.16.4" targetFramework="net462" />
</packages>