- Licenze locali: disponibili <%: numLicenze %> / attivate <%: utentiAttivi %>
+ Licenze locali: disponibili <%: numLicenze %> / utenti attivi <%: utentiAttivi %>
diff --git a/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.cs b/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.cs
index 0476044..0f0bad0 100644
--- a/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.cs
+++ b/GPW_Admin/WebUserControls/mod_adminDipendenti.ascx.cs
@@ -68,6 +68,12 @@ namespace GPW_Admin.WebUserControls
bool refreshAct = licenzeGPW.RefreshActInfo().Result;
}
+ private void fixVisibility()
+ {
+ lbtFixMissing.Visible = (numLicenzeOnline == numLicenze && attivazioniOnline != utentiAttivi);
+ grView.PageSize = utils.pageSize;
+ }
+
#endregion Private Methods
#region Protected Methods
@@ -213,12 +219,16 @@ namespace GPW_Admin.WebUserControls
{
raiseReset();
}
+
+ // cmq faccio refresh
+ fullRefresh();
}
}
protected void lbtRefresh_Click(object sender, EventArgs e)
{
fullRefresh();
+ grView.DataBind();
}
///
@@ -251,8 +261,7 @@ namespace GPW_Admin.WebUserControls
{
fullRefresh();
}
- lbtFixMissing.Visible = (numLicenzeOnline == numLicenze && attivazioniOnline != utentiAttivi);
- grView.PageSize = utils.pageSize;
+ fixVisibility();
}
///
@@ -374,7 +383,8 @@ namespace GPW_Admin.WebUserControls
public void doUpdate()
{
- grView.PageSize = utils.pageSize;
+ fullRefresh();
+ fixVisibility();
grView.DataBind();
}
diff --git a/GPW_Admin/dipendenti.aspx.cs b/GPW_Admin/dipendenti.aspx.cs
index 95e2c88..b833b05 100644
--- a/GPW_Admin/dipendenti.aspx.cs
+++ b/GPW_Admin/dipendenti.aspx.cs
@@ -37,9 +37,16 @@ namespace GPW_Admin
fixDisplay();
}
+ private void Cmp_userLicense_eh_addNew(object sender, EventArgs e)
+ {
+ mod_adminDipendenti1.doUpdate();
+ fixDisplay();
+ }
+
private void Cmp_userLicense_eh_doReset(object sender, EventArgs e)
{
//IdxDipSel = 0;
+ mod_adminDipendenti1.doUpdate();
fixDisplay();
}
@@ -92,6 +99,7 @@ namespace GPW_Admin
mod_adminDipendenti1.eh_addNew += Mod_adminDipendenti1_eh_addNew;
mod_adminDipendenti1.eh_doReset += Mod_adminDipendenti1_eh_doReset;
cmp_userLicense.eh_doReset += Cmp_userLicense_eh_doReset;
+ cmp_userLicense.eh_addNew += Cmp_userLicense_eh_addNew;
}
#endregion Protected Methods
diff --git a/GPW_Data/licenzeGPW.cs b/GPW_Data/licenzeGPW.cs
index ae844e2..ae88493 100644
--- a/GPW_Data/licenzeGPW.cs
+++ b/GPW_Data/licenzeGPW.cs
@@ -16,10 +16,10 @@ namespace GPW_data
#region Protected Fields
///
- /// Urla di abse chiamate API gestione licenze
- /// protected static string apiUrl = "https://localhost:44351/";
+ /// Url di base chiamate API gestione licenze
///
- protected static string apiUrl = "https://iis01.egalware.com/ELM.API/";
+ //protected static string apiUrl = "https://iis01.egalware.com/ELM.API/";
+ protected static string apiUrl = "https://localhost:44351/";
///
/// Durata cache statica locale dati licenza
@@ -543,6 +543,41 @@ namespace GPW_data
return await Task.FromResult(answ);
}
+ ///
+ /// Tenta disattivazione licenza dato codice impiego
+ ///
+ /// Dizionario codici da eliminare (CodImpiego/MasterKey)
+ ///
+ public static async Task tryDeactivation(Dictionary ParamsList)
+ {
+ bool answ = false;
+ // cerco attivazione...
+ var refreshDone = RefreshActInfo().Result;
+ if (refreshDone)
+ {
+ // cerco online
+ RestClient client = new RestClient(apiUrl);
+ //client.Authenticator = new HttpBasicAuthenticator("username", "password");
+ var request = new RestRequest($"/api/attivazioni", DataFormat.Json);
+ UserLicenseRequest newBody = new UserLicenseRequest()
+ {
+ MasterKey = MasterKey,
+ ParamDict = ParamsList
+ };
+ request.AddJsonBody(newBody);
+ var response = client.Delete(request);
+ // controllo risposta
+ if (response.StatusCode == System.Net.HttpStatusCode.OK)
+ {
+ // verifico risposta
+ string rawData = response.Content;
+ bool.TryParse(rawData, out answ);
+ }
+ }
+
+ return await Task.FromResult(answ);
+ }
+
#endregion Public Methods
}
}
\ No newline at end of file