Aggiunta pagina default x redirect + alcuni test diritti utente

This commit is contained in:
Samuele E. Locatelli
2020-01-10 17:15:01 +01:00
parent 475971c167
commit a7c56c271b
8 changed files with 131 additions and 2 deletions
+17
View File
@@ -0,0 +1,17 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="NKC_WF.Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>Welcome!</h1>
</div>
</form>
</body>
</html>
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace NKC_WF
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Redirect("site/Default");
}
}
}
+26
View File
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <generato automaticamente>
// Codice generato da uno strumento.
//
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
// il codice viene rigenerato.
// </generato automaticamente>
//------------------------------------------------------------------------------
namespace NKC_WF
{
public partial class Default
{
/// <summary>
/// Controllo form1.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
}
}
+8
View File
@@ -233,6 +233,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="Default.aspx" />
<Content Include="Home.aspx" />
<Content Include="site\About.aspx" />
<Content Include="App_Readme\Elmah.txt" />
@@ -427,6 +428,13 @@
<Link>VersGen.cs</Link>
</Compile>
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Default.aspx.designer.cs">
<DependentUpon>Default.aspx</DependentUpon>
</Compile>
<Compile Include="Home.aspx.cs">
<DependentUpon>Home.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
+3 -2
View File
@@ -1,4 +1,5 @@
using System;
using SteamWare;
using System;
using System.Configuration;
namespace NKC_WF.WebUserControls
@@ -34,7 +35,7 @@ namespace NKC_WF.WebUserControls
private void setClock()
{
lblDateTime.Text = DateTime.Now.ToString("ddd dd.MM.yyyy, HH:mm:ss");
lblCodOperatore.Text = $"{AppData.DataLayer.man.CodSoggCurrUser} - {AppData.DataLayer.man.CognNomeCurrUser}";
lblCodOperatore.Text = $"{user_std.UtSn.CognomeNome} ({Page.User.Identity.Name})";
}
}
}
+8
View File
@@ -3,4 +3,12 @@
<h1>User Auth test</h1>
<%: User.Identity.Name %>
<asp:DropDownList runat="server" ID="ddlSelData" AutoPostBack="true" OnSelectedIndexChanged="ddlSelData_SelectedIndexChanged">
<asp:ListItem Text="--- Selezionare ---" Value="0" />
<asp:ListItem Text="DIRITTI" Value="diritti" />
<asp:ListItem Text="MAPPA" Value="mappa" />
<asp:ListItem Text="PERMESSI" Value="permessi" />
</asp:DropDownList>
<asp:Literal runat="server" ID="litOut" />
</asp:Content>
+34
View File
@@ -13,5 +13,39 @@ namespace NKC_WF.site
{
}
protected void ddlSelData_SelectedIndexChanged(object sender, EventArgs e)
{
// a seconda delal richeista mostro qualcosa di diverso...
string selVal = ddlSelData.SelectedValue;
string dataVal = $"<h3>{selVal}</h3>";
dataVal += "<ul>";
switch (selVal)
{
case "diritti":
var diritti = SteamWare.user_std.UtSn.diritti;
foreach (var item in diritti)
{
dataVal += $"<li>CDC {item.COD_CDC} | MOD {item.COD_MODULO} | FUN {item.COD_FUNZIONE}</li>";
}
break;
case "mappa":
var mappa = SteamWare.user_std.UtSn.mappaSito;
dataVal += $"<li>{mappa}</li>";
break;
case "permessi":
var permessi = SteamWare.user_std.UtSn.permessi;
foreach (var item in permessi)
{
dataVal += $"<li>COD {item.COD_PERMESSO} | NOME {item.NOME} | URL {item.URL}</li>";
}
break;
case "0":
default:
break;
}
dataVal += "</ul>";
litOut.Text = dataVal;
}
}
}
+18
View File
@@ -13,5 +13,23 @@ namespace NKC_WF.site
public partial class TestAuth
{
/// <summary>
/// Controllo ddlSelData.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlSelData;
/// <summary>
/// Controllo litOut.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litOut;
}
}