Ancora update metodi gestione licenza

This commit is contained in:
Samuele Locatelli
2021-11-04 19:43:31 +01:00
parent 5bf2dccbfc
commit bb0441398a
7 changed files with 248 additions and 3 deletions
+8
View File
@@ -660,6 +660,7 @@
<Content Include="WebUserControls\cmp_righePag.ascx" />
<Content Include="WebUserControls\cmp_toggle.ascx" />
<Content Include="WebUserControls\cmp_userCard.ascx" />
<Content Include="WebUserControls\cmp_UserLicAdmin.ascx" />
<Content Include="WebUserControls\cmp_vocabolario.ascx" />
<Content Include="WebUserControls\mod_adminClienti.ascx" />
<Content Include="WebUserControls\mod_adminDipendenti.ascx" />
@@ -1098,6 +1099,13 @@
<Compile Include="WebUserControls\cmp_userCard.ascx.designer.cs">
<DependentUpon>cmp_userCard.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\cmp_UserLicAdmin.ascx.cs">
<DependentUpon>cmp_UserLicAdmin.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebUserControls\cmp_UserLicAdmin.ascx.designer.cs">
<DependentUpon>cmp_UserLicAdmin.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\cmp_vocabolario.ascx.cs">
<DependentUpon>cmp_vocabolario.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
+2 -1
View File
@@ -1,6 +1,7 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/BMP.Master" AutoEventWireup="true" CodeBehind="UserLicMan.aspx.cs" Inherits="GPW_Admin.UserLicMan" %>
<%@ Register Src="~/WebUserControls/mod_pageSize.ascx" TagPrefix="uc1" TagName="mod_pageSize" %>
<%@ Register Src="~/WebUserControls/cmp_UserLicAdmin.ascx" TagPrefix="uc1" TagName="cmp_UserLicAdmin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="server">
@@ -9,7 +10,7 @@
<b><%: traduci(titolo) %></b>
</div>
<div class="card-body">
gestione utenti
<uc1:cmp_UserLicAdmin runat="server" id="cmp_UserLicAdmin" />
</div>
<div class="card-footer text-right">
<uc1:mod_pageSize runat="server" ID="mod_pageSize" />
+2 -2
View File
@@ -13,7 +13,7 @@ namespace GPW_Admin
private void Mod_pageSize_eh_nuovaSize(object sender, EventArgs e)
{
//cmp_checkC19.pageSize = mod_pageSize.pageSize;
cmp_UserLicAdmin.pageSize = mod_pageSize.pageSize;
}
#endregion Private Methods
@@ -25,7 +25,7 @@ namespace GPW_Admin
if (!Page.IsPostBack)
{
mod_pageSize.pageSize = 20;
//cmp_checkC19.pageSize = mod_pageSize.pageSize;
cmp_UserLicAdmin.pageSize = mod_pageSize.pageSize;
}
mod_pageSize.eh_nuovaSize += Mod_pageSize_eh_nuovaSize;
}
+9
View File
@@ -14,6 +14,15 @@ namespace GPW_Admin
public partial class UserLicMan
{
/// <summary>
/// cmp_UserLicAdmin 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_UserLicAdmin cmp_UserLicAdmin;
/// <summary>
/// mod_pageSize control.
/// </summary>
@@ -0,0 +1,91 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_UserLicAdmin.ascx.cs" Inherits="GPW_Admin.WebUserControls.cmp_UserLicAdmin" %>
Gestione licenze utenti
<ul>
<li>conteggio num licenze disponibili ed impegnate</li>
<li>elenco utenti ATTIVI</li>
<li>possibilità di DISATTIVARE singoli utenti POST verifica online che siano "sbloccabili" (2 mesi da attivazione licenza)</li>
<li>creazione nuovi utenti (NON ATTIVI) --> togliere da altra pagina</li>
<li>possibilità di attivare licenze x NUOVI utenti</li>
<li>generazione del token MD5 dell'elenco utenti licenziati x creare il emccanismo di attivazione licenze su REDIS x check</li>
</ul>
<asp:GridView runat="server" ID="grView" DataSourceID="ods" CssClass="table table-sm table-striped" AutoGenerateColumns="False" DataKeyNames="idxDipendente">
<Columns>
<asp:BoundField DataField="idxDipendente" HeaderText="idxDipendente" InsertVisible="False" ReadOnly="True" SortExpression="idxDipendente" />
<asp:BoundField DataField="matricola" HeaderText="matricola" SortExpression="matricola" />
<asp:BoundField DataField="CF" HeaderText="CF" SortExpression="CF" />
<asp:BoundField DataField="Cognome" HeaderText="Cognome" SortExpression="Cognome" />
<asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
<asp:BoundField DataField="dataNascita" HeaderText="dataNascita" SortExpression="dataNascita" />
<asp:BoundField DataField="luogoNascita" HeaderText="luogoNascita" SortExpression="luogoNascita" />
<asp:BoundField DataField="provNascita" HeaderText="provNascita" SortExpression="provNascita" />
<asp:BoundField DataField="nazNascita" HeaderText="nazNascita" SortExpression="nazNascita" />
<asp:BoundField DataField="codHw" HeaderText="codHw" SortExpression="codHw" />
<asp:BoundField DataField="codOrario" HeaderText="codOrario" SortExpression="codOrario" />
<asp:CheckBoxField DataField="mailLastOp" HeaderText="mailLastOp" SortExpression="mailLastOp" />
<asp:CheckBoxField DataField="mailDay" HeaderText="mailDay" SortExpression="mailDay" />
<asp:CheckBoxField DataField="mailWeek" HeaderText="mailWeek" SortExpression="mailWeek" />
<asp:CheckBoxField DataField="mailMonth" HeaderText="mailMonth" SortExpression="mailMonth" />
<asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
<asp:BoundField DataField="authKey" HeaderText="authKey" SortExpression="authKey" />
<asp:BoundField DataField="numAuth" HeaderText="numAuth" SortExpression="numAuth" />
<asp:BoundField DataField="WOL_MAC" HeaderText="WOL_MAC" SortExpression="WOL_MAC" />
<asp:BoundField DataField="dominio" HeaderText="dominio" SortExpression="dominio" />
<asp:BoundField DataField="utente" HeaderText="utente" SortExpression="utente" />
<asp:BoundField DataField="codDipendenteExt" HeaderText="codDipendenteExt" SortExpression="codDipendenteExt" />
<asp:BoundField DataField="gruppo" HeaderText="gruppo" SortExpression="gruppo" />
<asp:BoundField DataField="dataAssunzione" HeaderText="dataAssunzione" SortExpression="dataAssunzione" />
<asp:BoundField DataField="dataCessazione" HeaderText="dataCessazione" SortExpression="dataCessazione" />
<asp:CheckBoxField DataField="attivo" HeaderText="attivo" SortExpression="attivo" />
</Columns>
<EditRowStyle CssClass="table-primary" />
<SelectedRowStyle CssClass="table-info" />
<HeaderStyle CssClass="default" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OnInserting="recuperaFooter" DeleteMethod="deleteQuery" InsertMethod="insertQuery" OldValuesParameterFormatString="original_{0}" SelectMethod="getAttivi" TypeName="GPW_data.DS_ApplicazioneTableAdapters.DipendentiTableAdapter" UpdateMethod="updateQuery" FilterExpression=" (Cognome like '%{0}%') OR (Nome like '%{0}%') OR (CF like '%{0}%') OR (matricola like '%{0}%') OR (email like '%{0}%') " OnUpdating="ods_Updating">
<FilterParameters>
<asp:SessionParameter SessionField="valoreSearch" Type="String" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxDipendente" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="matricola" Type="String" />
<asp:Parameter Name="CF" Type="String" />
<asp:Parameter Name="Cognome" Type="String" />
<asp:Parameter Name="Nome" Type="String" />
<asp:Parameter Name="dataNascita" Type="DateTime" />
<asp:Parameter Name="luogoNascita" Type="String" />
<asp:Parameter Name="provNascita" Type="String" />
<asp:Parameter Name="nazNascita" Type="String" />
<asp:Parameter Name="email" Type="String" />
<asp:Parameter Name="dominio" Type="String" />
<asp:Parameter Name="utente" Type="String" />
<asp:Parameter Name="codOrario" Type="String" />
<asp:Parameter Name="gruppo" Type="String" />
<asp:Parameter Name="attivo" Type="Boolean" />
</InsertParameters>
<SelectParameters>
<asp:ControlParameter ControlID="chkshowAll" DefaultValue="false" Name="showAll" PropertyName="Checked" Type="Boolean" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="matricola" Type="String"></asp:Parameter>
<asp:Parameter Name="CF" Type="String" />
<asp:Parameter Name="Cognome" Type="String" />
<asp:Parameter Name="Nome" Type="String" />
<asp:Parameter Name="dataNascita" Type="DateTime" />
<asp:Parameter Name="luogoNascita" Type="String" />
<asp:Parameter Name="provNascita" Type="String" />
<asp:Parameter Name="nazNascita" Type="String" />
<asp:Parameter Name="email" Type="String" />
<asp:Parameter Name="dominio" Type="String" />
<asp:Parameter Name="utente" Type="String" />
<asp:Parameter Name="codOrario" Type="String" />
<asp:Parameter Name="attivo" Type="Boolean" />
<asp:Parameter Name="gruppo" Type="String" />
<asp:Parameter Name="Original_idxDipendente" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
@@ -0,0 +1,101 @@
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
{
public partial class cmp_UserLicAdmin : System.Web.UI.UserControl
{
#region Public Properties
public int pageSize
{
get
{
return grView.PageSize;
}
set
{
grView.PageSize = value;
}
}
#endregion Public Properties
#region Protected Methods
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
{
if (e != null)
{
if (chkLicOk)
{
//recupero la riga footer...
DataColumnCollection colonne = colonneObj();
string nomeCol;
string tipoColonna = "";
foreach (DataColumn colonna in colonne)
{
nomeCol = colonna.ColumnName;
// cerco un textbox o quello che sia...
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
{
tipoColonna = "textBox";
}
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
{
tipoColonna = "dropDownList";
}
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
{
tipoColonna = "checkBox";
}
// in base al tipo salvo negli inputparameters dell'ODS
switch (tipoColonna)
{
case "textBox":
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
break;
case "dropDownList":
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
break;
case "checkBox":
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
break;
default:
break;
}
tipoColonna = "";
}
// attivo imposto a true!
e.InputParameters["attivo"] = "true";
// sistemo calendario!
}
else
{
// annullo insert se licenze sforate...
e.Cancel = true;
grView.DataBind();
}
}
}
#endregion Protected Methods
}
}
@@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <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_UserLicAdmin
{
/// <summary>
/// grView 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.GridView grView;
/// <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;
}
}