From 4c5b6c0bf6b1a6ea8ea8f119d3c8282fe71d570a Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 18 Nov 2021 10:48:20 +0100 Subject: [PATCH] inizio modifiche x display tickets --- GPW_Admin/GPW_Admin.csproj | 8 ++ .../WebUserControls/cmp_ticketFreeActiv.ascx | 2 +- GPW_Admin/WebUserControls/cmp_ticketList.ascx | 57 ++++++++++ .../WebUserControls/cmp_ticketList.ascx.cs | 88 +++++++++++++++ .../cmp_ticketList.ascx.designer.cs | 44 ++++++++ .../WebUserControls/cmp_userLicense.ascx | 102 +++++++++--------- .../WebUserControls/mod_adminDipendenti.ascx | 5 +- .../mod_adminDipendenti.ascx.cs | 26 ++++- .../mod_adminDipendenti.ascx.designer.cs | 91 +++++++++------- GPW_Admin/dipendenti.aspx | 3 + GPW_Admin/dipendenti.aspx.cs | 22 ++-- GPW_Admin/dipendenti.aspx.designer.cs | 9 ++ GPW_Data/licenzeGPW.cs | 2 +- 13 files changed, 357 insertions(+), 102 deletions(-) create mode 100644 GPW_Admin/WebUserControls/cmp_ticketList.ascx create mode 100644 GPW_Admin/WebUserControls/cmp_ticketList.ascx.cs create mode 100644 GPW_Admin/WebUserControls/cmp_ticketList.ascx.designer.cs diff --git a/GPW_Admin/GPW_Admin.csproj b/GPW_Admin/GPW_Admin.csproj index c03f47a..90897d8 100644 --- a/GPW_Admin/GPW_Admin.csproj +++ b/GPW_Admin/GPW_Admin.csproj @@ -660,6 +660,7 @@ + @@ -1087,6 +1088,13 @@ cmp_ticketFreeActiv.ascx + + cmp_ticketList.ascx + ASPXCodeBehind + + + cmp_ticketList.ascx + cmp_toggle.ascx ASPXCodeBehind diff --git a/GPW_Admin/WebUserControls/cmp_ticketFreeActiv.ascx b/GPW_Admin/WebUserControls/cmp_ticketFreeActiv.ascx index 193b378..a4c3af5 100644 --- a/GPW_Admin/WebUserControls/cmp_ticketFreeActiv.ascx +++ b/GPW_Admin/WebUserControls/cmp_ticketFreeActiv.ascx @@ -1,6 +1,6 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_ticketFreeActiv.ascx.cs" Inherits="GPW_Admin.WebUserControls.cmp_ticketFreeActiv" %> -
+
diff --git a/GPW_Admin/WebUserControls/cmp_ticketList.ascx b/GPW_Admin/WebUserControls/cmp_ticketList.ascx new file mode 100644 index 0000000..1162ed0 --- /dev/null +++ b/GPW_Admin/WebUserControls/cmp_ticketList.ascx @@ -0,0 +1,57 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_ticketList.ascx.cs" Inherits="GPW_Admin.WebUserControls.cmp_ticketList" %> + + +
+
+ elenco ticket aperti + + +
+
+ + + +
+
+ matr: + +
+
+
+
+ nato: + + + + +
+
+ +
+
+
+
+ +
+
+ periodo lavorativo: + + --> + +
+
+ Attivo: + +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/GPW_Admin/WebUserControls/cmp_ticketList.ascx.cs b/GPW_Admin/WebUserControls/cmp_ticketList.ascx.cs new file mode 100644 index 0000000..37d1d93 --- /dev/null +++ b/GPW_Admin/WebUserControls/cmp_ticketList.ascx.cs @@ -0,0 +1,88 @@ +using GPW_data; +using System; +using System.Linq; + +namespace GPW_Admin.WebUserControls +{ + public partial class cmp_ticketList : BaseUserControl + { + #region Protected Properties + + protected string ChiaveUtente + { + get + { + string answ = ""; + if (currRowDip != null) + { + answ = currRowDip.authKey; + } + return answ; + } + } + + /// + /// Cod impiego calcolato + /// + protected string CodImpiego + { + get + { + return DataProxy.DP.hashCodImpiego(currRowDip); + } + } + + protected DS_Applicazione.DipendentiRow currRowDip + { + get + { + return DataProxy.DP.getRowDip(idxDipSel); + } + } + + protected int idxSubLic + { + get + { + int answ = 0; + // verifico SE sia disponibile licenza... + var activationsList = licenzeGPW.ListaAttivazioni; + var currHash = DataProxy.DP.hashCodImpiego(currRowDip); + var currAct = activationsList.Where(x => x.CodImpiego == currHash).FirstOrDefault(); + if (currAct != null) + { + answ = currAct.IdxSubLic; + } + return answ; + } + } + + #endregion Protected Properties + + #region Public Properties + + public int idxDipSel + { + get + { + int answ = 0; + int.TryParse(hfIdxDip.Value, out answ); + return answ; + } + set + { + hfIdxDip.Value = $"{value}"; + } + } + + #endregion Public Properties + + #region Protected Methods + + protected void Page_Load(object sender, EventArgs e) + { + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/GPW_Admin/WebUserControls/cmp_ticketList.ascx.designer.cs b/GPW_Admin/WebUserControls/cmp_ticketList.ascx.designer.cs new file mode 100644 index 0000000..5e86ab2 --- /dev/null +++ b/GPW_Admin/WebUserControls/cmp_ticketList.ascx.designer.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GPW_Admin.WebUserControls +{ + + + public partial class cmp_ticketList + { + + /// + /// frmView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.FormView frmView; + + /// + /// ods control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource ods; + + /// + /// hfIdxDip control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hfIdxDip; + } +} diff --git a/GPW_Admin/WebUserControls/cmp_userLicense.ascx b/GPW_Admin/WebUserControls/cmp_userLicense.ascx index 029e5b2..f605c74 100644 --- a/GPW_Admin/WebUserControls/cmp_userLicense.ascx +++ b/GPW_Admin/WebUserControls/cmp_userLicense.ascx @@ -1,58 +1,62 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_userLicense.ascx.cs" Inherits="GPW_Admin.WebUserControls.cmp_userLicense" %> - - -
-
-
-
- - - -
-
- nato: +
+
+ + +
+
+
+
+ + + +
+
+ nato: - - - -
-
- matr: + + + +
+
+ matr: -
-
-
-
- -
-
- -
-
- periodo lavorativo: +
+
+
+
+ +
+
+ +
+
+ periodo lavorativo: - --> + --> -
-
- Attivo: +
+
+ Attivo: +
+
+
+
+ Attiva Utente + Cessazione Utente + Assegna licenza + Rigenera AuthKey SMART
-
-
- Attiva Utente - Cessazione Utente - Assegna licenza - Rigenera AuthKey SMART -
-
- - - - - - - - \ No newline at end of file + + + + + + + + +
+
diff --git a/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx b/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx index 67e0a22..c87c10d 100644 --- a/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx +++ b/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx @@ -23,7 +23,7 @@ Allocazione Licenze 
- Ticket aperti <%: numTickets %> + Ticket aperti <%: numTickets %>
@@ -339,4 +339,5 @@ TypeName="GPW_data.DS_UtilityTableAdapters.v_selCodOrarioTableAdapter"> - \ No newline at end of file + + \ No newline at end of file diff --git a/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.cs b/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.cs index da16038..3eb80ba 100644 --- a/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.cs +++ b/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.cs @@ -46,6 +46,20 @@ namespace GPW_Admin.WebUserControls hfReqTicket.Value = $"{value}"; } } + public bool showTickets + { + get + { + bool answ = false; + bool.TryParse(hfShowTickets.Value, out answ); + return answ; + } + set + { + hfShowTickets.Value = $"{value}"; + } + } + public int numLicenze { @@ -206,6 +220,7 @@ namespace GPW_Admin.WebUserControls protected void btnReset_Click(object sender, EventArgs e) { isTicketReq = false; + showTickets = false; resetSelezione(); } @@ -342,12 +357,17 @@ namespace GPW_Admin.WebUserControls protected void lbtSelect_Click(object sender, EventArgs e) { isTicketReq = false; + showTickets = false; } protected void lbtShowTickets_Click(object sender, EventArgs e) { - // mostro blocco tickets - // !!! FARE FixMe !!! TODO + // indico richiesta showTickets + isTicketReq = false; + showTickets = true; + // sollevo evento + raiseEvent(); + } /// @@ -358,6 +378,7 @@ namespace GPW_Admin.WebUserControls protected void lbtTicket_Click(object sender, EventArgs e) { isTicketReq = true; + showTickets = false; } /// @@ -389,6 +410,7 @@ namespace GPW_Admin.WebUserControls if (!Page.IsPostBack) { isTicketReq = false; + showTickets=false; fullRefresh(); } fixVisibility(); diff --git a/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.designer.cs b/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.designer.cs index bd2806c..7dd66a5 100644 --- a/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.designer.cs +++ b/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ -// -// Codice generato da uno strumento. +// +// 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. -// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// //------------------------------------------------------------------------------ namespace GPW_Admin.WebUserControls @@ -15,111 +15,120 @@ namespace GPW_Admin.WebUserControls { /// - /// Controllo divDB. + /// divDB control. /// /// - /// 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. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl divDB; /// - /// Controllo divOnline. + /// divOnline control. /// /// - /// 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. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl divOnline; /// - /// Controllo lbtRefresh. + /// lbtRefresh control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.LinkButton lbtRefresh; /// - /// Controllo lbtFixMissing. + /// lbtFixMissing control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.LinkButton lbtFixMissing; /// - /// Controllo lbtShowTickets. + /// lbtShowTickets control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.LinkButton lbtShowTickets; /// - /// Controllo chkshowAll. + /// chkshowAll control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.CheckBox chkshowAll; /// - /// Controllo grView. + /// grView control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.GridView grView; /// - /// Controllo ods. + /// ods control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.ObjectDataSource ods; /// - /// Controllo lblNumRec. + /// lblNumRec control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.Label lblNumRec; /// - /// Controllo odsOrario. + /// odsOrario control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.ObjectDataSource odsOrario; /// - /// Controllo odsGruppi. + /// odsGruppi control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.ObjectDataSource odsGruppi; /// - /// Controllo hfReqTicket. + /// hfReqTicket control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.HiddenField hfReqTicket; + + /// + /// hfShowTickets control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hfShowTickets; } } diff --git a/GPW_Admin/dipendenti.aspx b/GPW_Admin/dipendenti.aspx index 4f7f265..e50ae33 100644 --- a/GPW_Admin/dipendenti.aspx +++ b/GPW_Admin/dipendenti.aspx @@ -6,6 +6,8 @@ <%@ Register Src="~/WebUserControls/cmp_toggle.ascx" TagPrefix="uc1" TagName="cmp_toggle" %> <%@ Register Src="~/WebUserControls/cmp_userLicense.ascx" TagPrefix="uc1" TagName="cmp_userLicense" %> <%@ Register Src="~/WebUserControls/cmp_ticketFreeActiv.ascx" TagPrefix="uc1" TagName="cmp_ticketFreeActiv" %> +<%@ Register Src="~/WebUserControls/cmp_ticketList.ascx" TagPrefix="uc1" TagName="cmp_ticketList" %> +
@@ -24,6 +26,7 @@
+ diff --git a/GPW_Admin/dipendenti.aspx.cs b/GPW_Admin/dipendenti.aspx.cs index e1e68e3..6e48af3 100644 --- a/GPW_Admin/dipendenti.aspx.cs +++ b/GPW_Admin/dipendenti.aspx.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; using System.Web.UI; -using System.Web.UI.WebControls; namespace GPW_Admin { @@ -67,27 +63,40 @@ namespace GPW_Admin cmp_userCard.showExt = cmp_toggleLinkExt.toggleValue; cmp_userLicense.Visible = IdxDipSel > 0; cmp_ticketFreeActiv.Visible = cmp_ticketFreeActiv.idxDipSel > 0; + cmp_ticketList.Visible = cmp_ticketList.idxDipSel > 0; } private void Mod_adminDipendenti1_eh_addNew(object sender, EventArgs e) { + // reset preliminare + IdxDipSel = 0; + cmp_ticketFreeActiv.idxDipSel = 0; + // imposto solo 1 if (mod_adminDipendenti1.isTicketReq) { - IdxDipSel = 0; cmp_ticketFreeActiv.idxDipSel = mod_adminDipendenti1.IdxDipSel; } else { IdxDipSel = mod_adminDipendenti1.IdxDipSel; - cmp_ticketFreeActiv.idxDipSel = 0; } fixDisplay(); } + private void Mod_adminDipendenti1_eh_doRefresh(object sender, EventArgs e) + { + // mostro elenco tickets + IdxDipSel = 0; + cmp_ticketFreeActiv.idxDipSel = 0; + cmp_ticketList.idxDipSel = mod_adminDipendenti1.IdxDipSel; + fixDisplay(); + } + private void Mod_adminDipendenti1_eh_doReset(object sender, EventArgs e) { IdxDipSel = 0; cmp_ticketFreeActiv.idxDipSel = 0; + cmp_ticketList.idxDipSel = 0; fixDisplay(); } @@ -116,6 +125,7 @@ namespace GPW_Admin cmp_toggleLinkExt.ehToggle += Cmp_toggleLinkExt_ehToggle; mod_adminDipendenti1.eh_addNew += Mod_adminDipendenti1_eh_addNew; mod_adminDipendenti1.eh_doReset += Mod_adminDipendenti1_eh_doReset; + mod_adminDipendenti1.eh_doRefresh += Mod_adminDipendenti1_eh_doRefresh; cmp_userLicense.eh_doReset += Cmp_userLicense_eh_doReset; cmp_userLicense.eh_addNew += Cmp_userLicense_eh_addNew; cmp_ticketFreeActiv.eh_doRefresh += Cmp_ticketFreeActiv_eh_doRefresh; diff --git a/GPW_Admin/dipendenti.aspx.designer.cs b/GPW_Admin/dipendenti.aspx.designer.cs index 0946717..6891eff 100644 --- a/GPW_Admin/dipendenti.aspx.designer.cs +++ b/GPW_Admin/dipendenti.aspx.designer.cs @@ -41,6 +41,15 @@ namespace GPW_Admin /// protected global::GPW_Admin.WebUserControls.cmp_userLicense cmp_userLicense; + /// + /// cmp_ticketList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GPW_Admin.WebUserControls.cmp_ticketList cmp_ticketList; + /// /// cmp_ticketFreeActiv control. /// diff --git a/GPW_Data/licenzeGPW.cs b/GPW_Data/licenzeGPW.cs index 159a475..d58b1a8 100644 --- a/GPW_Data/licenzeGPW.cs +++ b/GPW_Data/licenzeGPW.cs @@ -927,7 +927,7 @@ namespace GPW_data RestClient client = new RestClient(apiUrl); //client.Authenticator = new HttpBasicAuthenticator("username", "password"); string MKeyEnc = HttpUtility.UrlEncode(MasterKey); - var request = new RestRequest($"/api/ticket/{installazione}?CodApp={applicazione}?Chiave={MKeyEnc}", DataFormat.Json); + var request = new RestRequest($"/api/ticket/{installazione}?CodApp={applicazione}&Chiave={MKeyEnc}", DataFormat.Json); var response = client.Get(request); // controllo risposta if (response.StatusCode == System.Net.HttpStatusCode.OK)