diff --git a/GPW_Admin/WebUserControls/cmp_userLicense.ascx.cs b/GPW_Admin/WebUserControls/cmp_userLicense.ascx.cs index 795e6af..53ba49f 100644 --- a/GPW_Admin/WebUserControls/cmp_userLicense.ascx.cs +++ b/GPW_Admin/WebUserControls/cmp_userLicense.ascx.cs @@ -11,6 +11,42 @@ namespace GPW_Admin.WebUserControls { public partial class cmp_userLicense : 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.getCodImpiego(currRowDip); + } + } + + protected DS_Applicazione.DipendentiRow currRowDip + { + get + { + return DataProxy.DP.getRowDip(idxDipSel); + } + } + + #endregion Protected Properties + #region Public Properties public int idxDipSel @@ -29,43 +65,46 @@ namespace GPW_Admin.WebUserControls #endregion Public Properties - #region Protected Properties + #region Protected Methods - protected string ChiaveUtente + protected void lbrRelease_Click(object sender, EventArgs e) { - get + // riesegue controllo ed disattiva + DataProxy.DP.taDipendenti.updateActive(false, idxDipSel); + frmView.DataBind(); + raiseReset(); + } + + protected void lbtActivate_Click(object sender, EventArgs e) + { + // riesegue controllo ed attiva + DataProxy.DP.taDipendenti.updateActive(true, idxDipSel); + frmView.DataBind(); + raiseReset(); + } + + protected void lbtReissue_Click(object sender, EventArgs e) + { + // verifica SE ci sono licenze disponibili + if (licenzeGPW.licenzeOnline > licenzeGPW.attivazioniOnline) { - string answ = ""; - if (currRowDip != null) + // effettua riassegnazione + bool fatto = licenzeGPW.tryActivation(CodImpiego, ChiaveUtente).Result; + if (fatto) { - answ = currRowDip.authKey; + bool step1 = licenzeGPW.RefreshAppInfo().Result; + bool step2 = licenzeGPW.RefreshActInfo().Result; + bool step3 = licenzeGPW.RefreshLicInfo().Result; + raiseReset(); } - return answ; } } - protected string CodImpiego + protected void Page_Load(object sender, EventArgs e) { - get - { - string answ = ""; - if (currRowDip != null) - { - answ = $"{currRowDip.idxDipendente}|{currRowDip.Cognome}.{currRowDip.Nome}|{currRowDip.CF}|{currRowDip.dataAssunzione:yyyyMMdd}|{currRowDip.email}|{currRowDip.matricola}"; - } - return answ; - } } - protected DS_Applicazione.DipendentiRow currRowDip - { - get - { - return DataProxy.DP.getRowDip(idxDipSel); - } - } - - #endregion Protected Properties + #endregion Protected Methods #region Public Methods @@ -152,46 +191,5 @@ namespace GPW_Admin.WebUserControls } #endregion Public Methods - - #region Protected Methods - - protected void lbrRelease_Click(object sender, EventArgs e) - { - // riesegue controllo ed disattiva - DataProxy.DP.taDipendenti.updateActive(false, idxDipSel); - frmView.DataBind(); - raiseReset(); - } - - protected void lbtActivate_Click(object sender, EventArgs e) - { - // riesegue controllo ed attiva - DataProxy.DP.taDipendenti.updateActive(true, idxDipSel); - frmView.DataBind(); - raiseReset(); - } - - protected void lbtReissue_Click(object sender, EventArgs e) - { - // verifica SE ci sono licenze disponibili - if (licenzeGPW.licenzeOnline > licenzeGPW.attivazioniOnline) - { - // effettua riassegnazione - bool fatto = licenzeGPW.tryActivation(CodImpiego, ChiaveUtente).Result; - if (fatto) - { - bool step1 = licenzeGPW.RefreshAppInfo().Result; - bool step2 = licenzeGPW.RefreshActInfo().Result; - bool step3 = licenzeGPW.RefreshLicInfo().Result; - raiseReset(); - } - } - } - - protected void Page_Load(object sender, EventArgs e) - { - } - - #endregion Protected Methods } } \ No newline at end of file