completata prima review, da creare/testare pacchetti deploy x IIS01/02 e Donati

This commit is contained in:
Samuele E. Locatelli
2016-12-20 12:55:18 +01:00
parent db24707340
commit b296e744bb
9 changed files with 159 additions and 26 deletions
BIN
View File
Binary file not shown.
+19 -3
View File
@@ -1,4 +1,5 @@
using System;
using MP.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
@@ -12,20 +13,35 @@ namespace MP.Controllers
public ActionResult Index()
{
ViewBag.Title = "MoonPro";
// x sicurezza leggo da web.config
ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"];
using (var ctx = new MoonProEntities())
{
// esegue stored procedure come function, recuperando chiave desiderata...
var keyVal = ctx.stp_AKV_getByKey("Environment").ToList<AnagKeyValue>();
ViewBag.Environment = keyVal[0].valString;
// imposto URL dei vari siti
ViewBag.UrlMpSite = ctx.stp_AKV_getByKey("UrlMpSite").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpAdmin = ctx.stp_AKV_getByKey("UrlMpAdmin").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpIO = ctx.stp_AKV_getByKey("UrlMpIO").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpMON = ctx.stp_AKV_getByKey("UrlMpMON").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpTAB = ctx.stp_AKV_getByKey("UrlMpTAB").ToList<AnagKeyValue>()[0].valString;
}
return View();
}
public ActionResult About()
{
ViewBag.Message = "Your application description page.";
ViewBag.Title = "MoonPro";
ViewBag.Message = "MoonPro è il motore software di MAPO, la nostra soluzione hardware";
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
ViewBag.Title = "MoonPro";
ViewBag.Message = "Per contattarci";
return View();
}
+41 -2
View File
@@ -136,8 +136,27 @@
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Models\AnagKeyValue.cs" />
<Compile Include="Models\MPModel.cs" />
<Compile Include="Models\AnagKeyValue.cs">
<DependentUpon>MPModel.tt</DependentUpon>
</Compile>
<Compile Include="Models\MPModel.Context.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>MPModel.Context.tt</DependentUpon>
</Compile>
<Compile Include="Models\MPModel.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>MPModel.tt</DependentUpon>
</Compile>
<Compile Include="Models\MPModel.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>MPModel.edmx</DependentUpon>
</Compile>
<Compile Include="Models\stp_AKV_getByKey_Result.cs">
<DependentUpon>MPModel.tt</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
@@ -167,11 +186,28 @@
<Content Include="fonts\glyphicons-halflings-regular.woff" />
<Content Include="fonts\glyphicons-halflings-regular.ttf" />
<Content Include="fonts\glyphicons-halflings-regular.eot" />
<EntityDeploy Include="Models\MPModel.edmx">
<Generator>EntityModelCodeGenerator</Generator>
<LastGenOutput>MPModel.Designer.cs</LastGenOutput>
</EntityDeploy>
<Content Include="Models\MPModel.edmx.diagram">
<DependentUpon>MPModel.edmx</DependentUpon>
</Content>
<None Include="Properties\PublishProfiles\Donati.pubxml" />
<None Include="Properties\PublishProfiles\IIS01.pubxml" />
<None Include="Properties\PublishProfiles\IIS02.pubxml" />
<None Include="Properties\PublishProfiles\Steamware.pubxml" />
<None Include="Scripts\jquery-3.1.1.intellisense.js" />
<Content Include="Models\MPModel.Context.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<DependentUpon>MPModel.edmx</DependentUpon>
<LastGenOutput>MPModel.Context.cs</LastGenOutput>
</Content>
<Content Include="Models\MPModel.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<DependentUpon>MPModel.edmx</DependentUpon>
<LastGenOutput>MPModel.cs</LastGenOutput>
</Content>
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<Content Include="Scripts\jquery-3.1.1.js" />
@@ -218,6 +254,9 @@
<Name>MapoDb</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+20
View File
@@ -12,6 +12,8 @@ namespace MP.Models
using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.Core.Objects;
using System.Linq;
public partial class MoonProEntities : DbContext
{
@@ -26,5 +28,23 @@ namespace MP.Models
}
public virtual DbSet<AnagKeyValue> AnagKeyValue { get; set; }
public virtual ObjectResult<AnagKeyValue> stp_AKV_getByKey(string nomeVar)
{
var nomeVarParameter = nomeVar != null ?
new ObjectParameter("nomeVar", nomeVar) :
new ObjectParameter("nomeVar", typeof(string));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<AnagKeyValue>("stp_AKV_getByKey", nomeVarParameter);
}
public virtual ObjectResult<AnagKeyValue> stp_AKV_getByKey(string nomeVar, MergeOption mergeOption)
{
var nomeVarParameter = nomeVar != null ?
new ObjectParameter("nomeVar", nomeVar) :
new ObjectParameter("nomeVar", typeof(string));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<AnagKeyValue>("stp_AKV_getByKey", mergeOption, nomeVarParameter);
}
}
}
+17 -3
View File
@@ -4,7 +4,7 @@
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="MoonProModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
<Schema Namespace="MoonProModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
<EntityType Name="AnagKeyValue">
<Key>
<PropertyRef Name="nomeVar" />
@@ -15,11 +15,13 @@
<Property Name="valString" Type="nvarchar" MaxLength="250" />
<Property Name="descrizione" Type="nvarchar" MaxLength="250" />
</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" />
</EntityContainer>
</Schema>
</edmx:StorageModels>
</Schema></edmx:StorageModels>
<!-- CSDL content -->
<edmx:ConceptualModels>
<Schema Namespace="MoonProModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
@@ -35,7 +37,17 @@
</EntityType>
<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" />
</FunctionImport>
</EntityContainer>
<ComplexType Name="stp_AKV_getByKey_Result">
<Property Type="String" Name="nomeVar" Nullable="false" MaxLength="50" />
<Property Type="Int32" Name="valInt" Nullable="false" />
<Property Type="Double" Name="valFloat" Nullable="false" />
<Property Type="String" Name="valString" Nullable="false" MaxLength="250" />
<Property Type="String" Name="descrizione" Nullable="false" MaxLength="250" />
</ComplexType>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
@@ -53,6 +65,8 @@
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<FunctionImportMapping FunctionImportName="stp_AKV_getByKey" FunctionName="MoonProModel.Store.stp_AKV_getByKey">
</FunctionImportMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>
+22
View File
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MP.Models
{
using System;
public partial class stp_AKV_getByKey_Result
{
public string nomeVar { get; set; }
public int valInt { get; set; }
public double valFloat { get; set; }
public string valString { get; set; }
public string descrizione { get; set; }
}
}
+2 -1
View File
@@ -4,4 +4,5 @@
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<p>Use this area to provide additional information.</p>
<p>MoonPro / MAPO sono una suite di applicazioni e dispositivi hw dedicati per l'IOT,l'industry 4.0 e la gestione automatizzata dei processi produttivi.</p>
<p>Per maggiori informazioni <a href="http://www.steamware.net/iot">visita il link</a> sul nostro sito.</p>
+32 -11
View File
@@ -4,14 +4,35 @@
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<address>
One Microsoft Way<br />
Redmond, WA 98052-6399<br />
<abbr title="Phone">P:</abbr>
425.555.0100
</address>
<address>
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br />
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
</address>
<div class="row">
<div class="col-sm-4">
<h4>Sede Operativa</h4>
<address>
<strong>Steamware s.r.l.</strong><br />
via Dante Alighieri, 16<br />
24068 Seriate - BG<br />
<abbr title="Phone">P:</abbr>
035.290178<br />
<abbr title="Phone">P:</abbr>
035.460560
</address>
</div>
<div class="col-sm-4">
<h4>Sede Legale</h4>
<address>
<strong>Steamware s.r.l.</strong><br />
via Briolo Fuori, 27<br />
24015 San Giovanni Bianco - BG<br />
<abbr title="P.Iva">VAT:</abbr>03274190168
</address>
</div>
<div class="col-sm-4">
<h4>Supporto</h4>
<address>
<strong>Web:</strong><br />
Accedi al supporto dal <a href="http://www.steamware.net/support">nostro sito web</a><br />
<strong>Email:</strong><br />
Scrivi un email a <a href="mailto:info@steamware.net">info at steamware.net</a>
</address>
</div>
</div>
+6 -6
View File
@@ -3,7 +3,7 @@
}
<div class="jumbotron">
<h1>MoonPro suite - @ViewBag.Environment</h1>
<h1>MoonPro - @ViewBag.Environment</h1>
<p class="lead">Pannello di gestione della <a href="http://www.steamware.net/iot">suite IOT MoonPro</a> per l'acquisizione dei dati dai sistemi MAPO</p>
<p><i>Utilizzare i link seguenti per accedere agli applicativi</i></p>
@*<p><a href="http://www.steamware.net/iot" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>*@
@@ -11,7 +11,7 @@
<div class="row">
<div class="col-md-3">
<a href="~/MP/SITE" class="btn btn-primary btn-lg fullWidth">
<a href="http://@ViewBag.UrlMpSite" class="btn btn-primary btn-lg fullWidth" target="_blank">
<h2>MP-SITE &raquo;</h2>
</a>
<hr />
@@ -26,7 +26,7 @@
</p>
</div>
<div class="col-md-3">
<a href="~/MP/TAB" class="btn btn-info btn-lg fullWidth">
<a href="http://@ViewBag.UrlMpTAB" class="btn btn-info btn-lg fullWidth" target="_blank">
<h2>MP-TAB &raquo;</h2>
</a>
<hr />
@@ -41,7 +41,7 @@
</p>
</div>
<div class="col-md-3">
<a href="~/MP/ADMIN" class="btn btn-success btn-lg fullWidth">
<a href="http://@ViewBag.UrlMpAdmin" class="btn btn-success btn-lg fullWidth" target="_blank">
<h2>MP-ADMIN &raquo;</h2>
</a>
<hr />
@@ -55,7 +55,7 @@
</p>
</div>
<div class="col-md-3">
<a href="~/MP/MON" class="btn btn-warning btn-lg fullWidth">
<a href="http://@ViewBag.UrlMpMON" class="btn btn-warning btn-lg fullWidth" target="_blank">
<h2>MP-MON &raquo;</h2>
</a>
<hr />
@@ -67,7 +67,7 @@
</p>
<br />
<br />
<a href="~/MP/IO" class="btn btn-danger btn-lg fullWidth">
<a href="http://@ViewBag.UrlMpIO" class="btn btn-danger btn-lg fullWidth" target="_blank">
<h2>MP-IO &raquo;</h2>
</a>
<hr />