Fix gestione QRCode link
This commit is contained in:
@@ -539,6 +539,7 @@
|
||||
<Content Include="WebUserControls\cmp_periodoAnalisi.ascx" />
|
||||
<Content Include="WebUserControls\cmp_righePag.ascx" />
|
||||
<Content Include="WebUserControls\cmp_toggle.ascx" />
|
||||
<Content Include="WebUserControls\cmp_userCard.ascx" />
|
||||
<Content Include="WebUserControls\cmp_vocabolario.ascx" />
|
||||
<Content Include="WebUserControls\mod_adminClienti.ascx" />
|
||||
<Content Include="WebUserControls\mod_adminDipendenti.ascx" />
|
||||
@@ -949,6 +950,13 @@
|
||||
<Compile Include="WebUserControls\cmp_toggle.ascx.designer.cs">
|
||||
<DependentUpon>cmp_toggle.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\cmp_userCard.ascx.cs">
|
||||
<DependentUpon>cmp_userCard.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\cmp_userCard.ascx.designer.cs">
|
||||
<DependentUpon>cmp_userCard.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\cmp_vocabolario.ascx.cs">
|
||||
<DependentUpon>cmp_vocabolario.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_userCard.ascx.cs" Inherits="GPW_Admin.WebUserControls.cmp_userCard" %>
|
||||
|
||||
<div class="row textCondens">
|
||||
<asp:HiddenField runat="server" ID="hfShowExt" />
|
||||
<asp:Repeater runat="server" ID="repUserCards" DataSourceID="ods">
|
||||
<ItemTemplate>
|
||||
<div class="col-md-6 my-4">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<asp:Image runat="server" CssClass="img-fluid" ID="imgQR" ImageUrl='<%# getImgUrl(Eval("idxDipendente"),Eval("authKey")) %>' />
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="img-fluid">
|
||||
<img src="../images/LogoSteamware.png" height="64" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 textCondens" style="font-size: 3em;">
|
||||
<b><%# Eval("Cognome") %> </b>
|
||||
<%# Eval("Nome") %>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<i>SMART Access Link</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:Repeater>
|
||||
</div>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getAttivi" TypeName="GPW_data.DS_ApplicazioneTableAdapters.DipendentiTableAdapter" FilterExpression=" (Cognome like '%{0}%') OR (Nome like '%{0}%') OR (CF like '%{0}%') OR (matricola like '%{0}%') OR (email like '%{0}%') ">
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter SessionField="valoreSearch" Type="String" />
|
||||
</FilterParameters>
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="hfShowAll" DefaultValue="false" Name="showAll" PropertyName="Value" Type="Boolean" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:HiddenField runat="server" ID="hfShowAll" />
|
||||
@@ -0,0 +1,92 @@
|
||||
using Newtonsoft.Json;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace GPW_Admin.WebUserControls
|
||||
{
|
||||
/// <summary>
|
||||
/// Payload da deserializzare json
|
||||
/// </summary>
|
||||
public struct qrPayload
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string baseUrl { get; set; }
|
||||
public string[] parameters { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
public partial class cmp_userCard : System.Web.UI.UserControl
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public bool showAll
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse(hfShowAll.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfShowAll.Value = $"{value}";
|
||||
repUserCards.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
public bool showExt
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse(hfShowExt.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfShowExt.Value = $"{value}";
|
||||
repUserCards.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public string getImgUrl(object idxDip, object UserAuthkey)
|
||||
{
|
||||
string urlName = showExt ? "smartBaseUrlExt" : "smartBaseUrlInt";
|
||||
string[] valori = new string[2];
|
||||
valori[0] = $"{idxDip}";
|
||||
valori[1] = $"{UserAuthkey}";
|
||||
|
||||
string baseUrl = $"{memLayer.ML.CRS("UrlQRCodeGen")}/HOME/QR_site/JSON?val=";
|
||||
qrPayload currPayload = new qrPayload()
|
||||
{
|
||||
// NB: & --> %26
|
||||
baseUrl = memLayer.ML.CRS(urlName) + "jumper?idxDipendente={0}%26UserAuthkey={1}",
|
||||
parameters = valori
|
||||
};
|
||||
string payload = JsonConvert.SerializeObject(currPayload);
|
||||
string answ = $"{baseUrl}{payload}";
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW_Admin.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class cmp_userCard
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// hfShowExt control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfShowExt;
|
||||
|
||||
/// <summary>
|
||||
/// repUserCards control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater repUserCards;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// hfShowAll control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfShowAll;
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,14 @@ namespace GPW_Admin.WebUserControls
|
||||
}
|
||||
}
|
||||
|
||||
public bool showAll
|
||||
{
|
||||
get
|
||||
{
|
||||
return chkshowAll.Checked;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -71,6 +79,10 @@ namespace GPW_Admin.WebUserControls
|
||||
protected void chkshowAll_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
grView.DataBind();
|
||||
if (eh_resetSelezione != null)
|
||||
{
|
||||
eh_resetSelezione(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -2,13 +2,27 @@
|
||||
|
||||
<%@ Register Src="~/WebUserControls/mod_adminDipendenti.ascx" TagName="mod_adminDipendenti" TagPrefix="uc1" %>
|
||||
<%@ Register Src="~/WebUserControls/mod_pageSize.ascx" TagPrefix="uc1" TagName="mod_pageSize" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_userCard.ascx" TagPrefix="uc1" TagName="cmp_userCard" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_toggle.ascx" TagPrefix="uc1" TagName="cmp_toggle" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="server">
|
||||
<div class="card m-2">
|
||||
<div class="card-header">
|
||||
<b><%: traduci(titolo) %></b>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<b><%: traduci(titolo) %></b>
|
||||
</div>
|
||||
<div class="col-4 text-right">
|
||||
<uc1:cmp_toggle runat="server" ID="cmp_toggleCards" messageOff="Gestione Dati" messageOn="Cards Utente" />
|
||||
<uc1:cmp_toggle runat="server" ID="cmp_toggleLinkExt" messageOff="Link Interno" messageOn="Link Esterno" />
|
||||
|
||||
<i class="fa fa-qrcode fa-2x" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<uc1:mod_adminDipendenti ID="mod_adminDipendenti1" runat="server" />
|
||||
<uc1:cmp_userCard runat="server" ID="cmp_userCard" />
|
||||
</div>
|
||||
<div class="card-footer text-right">
|
||||
<uc1:mod_pageSize runat="server" ID="mod_pageSize" />
|
||||
|
||||
@@ -11,6 +11,31 @@ namespace GPW_Admin
|
||||
{
|
||||
#region Private Methods
|
||||
|
||||
private void Cmp_toggleCards_ehToggle(object sender, EventArgs e)
|
||||
{
|
||||
fixDisplay();
|
||||
}
|
||||
|
||||
private void Cmp_toggleLinkExt_ehToggle(object sender, EventArgs e)
|
||||
{
|
||||
fixDisplay();
|
||||
}
|
||||
|
||||
private void fixDisplay()
|
||||
{
|
||||
mod_adminDipendenti1.Visible = !cmp_toggleCards.toggleValue;
|
||||
cmp_userCard.Visible = cmp_toggleCards.toggleValue;
|
||||
mod_adminDipendenti1.doUpdate();
|
||||
cmp_toggleLinkExt.Visible = cmp_toggleCards.toggleValue;
|
||||
cmp_userCard.showAll = mod_adminDipendenti1.showAll;
|
||||
cmp_userCard.showExt = cmp_toggleLinkExt.toggleValue;
|
||||
}
|
||||
|
||||
private void Mod_adminDipendenti1_eh_resetSelezione(object sender, EventArgs e)
|
||||
{
|
||||
fixDisplay();
|
||||
}
|
||||
|
||||
private void Mod_pageSize_eh_nuovaSize(object sender, EventArgs e)
|
||||
{
|
||||
mod_adminDipendenti1.doUpdate();
|
||||
@@ -20,9 +45,21 @@ namespace GPW_Admin
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void chkShowCards_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
fixDisplay();
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
fixDisplay();
|
||||
}
|
||||
mod_pageSize.eh_nuovaSize += Mod_pageSize_eh_nuovaSize;
|
||||
mod_adminDipendenti1.eh_resetSelezione += Mod_adminDipendenti1_eh_resetSelezione;
|
||||
cmp_toggleCards.ehToggle += Cmp_toggleCards_ehToggle;
|
||||
cmp_toggleLinkExt.ehToggle += Cmp_toggleLinkExt_ehToggle;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
Generated
+38
-11
@@ -1,10 +1,10 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW_Admin
|
||||
@@ -15,20 +15,47 @@ namespace GPW_Admin
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo mod_adminDipendenti1.
|
||||
/// cmp_toggleCards control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW_Admin.WebUserControls.cmp_toggle cmp_toggleCards;
|
||||
|
||||
/// <summary>
|
||||
/// cmp_toggleLinkExt control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW_Admin.WebUserControls.cmp_toggle cmp_toggleLinkExt;
|
||||
|
||||
/// <summary>
|
||||
/// mod_adminDipendenti1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW_Admin.WebUserControls.mod_adminDipendenti mod_adminDipendenti1;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo mod_pageSize.
|
||||
/// cmp_userCard control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW_Admin.WebUserControls.cmp_userCard cmp_userCard;
|
||||
|
||||
/// <summary>
|
||||
/// mod_pageSize control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW_Admin.WebUserControls.mod_pageSize mod_pageSize;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user