Merge branch 'release/UpdateMetodoEditUtente'
This commit is contained in:
@@ -308,11 +308,54 @@ namespace GPW_Admin.WebUserControls
|
||||
{
|
||||
if (!licenzeGPW.checkLicenze)
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
// annullo update se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.EditIndex = -1;
|
||||
grView.DataBind();
|
||||
}
|
||||
else
|
||||
{
|
||||
// disattivo la licenza corrente...
|
||||
var localUserList = licenzeGPW.getDipAttivi();
|
||||
// cerco!
|
||||
if (e.InputParameters["Original_idxDipendente"] != null)
|
||||
{
|
||||
string origIdxDip = $"{e.InputParameters["Original_idxDipendente"]}";
|
||||
int idxDip = 0;
|
||||
int.TryParse(origIdxDip, out idxDip);
|
||||
if (idxDip > 0)
|
||||
{
|
||||
var currUser = localUserList.Where(x => x.idxDipendente == idxDip).FirstOrDefault();
|
||||
|
||||
// verifico SE sia disponibile licenza...
|
||||
var activationsList = licenzeGPW.ListaAttivazioni;
|
||||
var currHash = DataProxy.DP.hashCodImpiego(currUser);
|
||||
var currAct = activationsList.Where(x => x.CodImpiego == currHash).FirstOrDefault();
|
||||
|
||||
if (currAct != null)
|
||||
{
|
||||
// riesegue controllo ed disattiva
|
||||
Dictionary<string, string> ParamList = new Dictionary<string, string>();
|
||||
ParamList.Add(currAct.CodImpiego, currAct.Chiave);
|
||||
bool fatto = licenzeGPW.tryDeactivation(ParamList).Result;
|
||||
if (fatto)
|
||||
{
|
||||
DataProxy.DP.taDipendenti.updateActive(false, idxDip);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// annullo update se attivazione NON trovata...
|
||||
e.Cancel = true;
|
||||
grView.EditIndex = -1;
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,7 +453,7 @@ namespace GPW_Admin.WebUserControls
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Verifica licenza (se sia libera x modifca o prima associazione)
|
||||
/// Verifica licenza (se sia libera x modifica o prima associazione)
|
||||
/// </summary>
|
||||
/// <param name="idxDIp"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -982,14 +982,14 @@ namespace GPW_data
|
||||
// cerco online
|
||||
RestClient client = new RestClient(apiUrl);
|
||||
//client.Authenticator = new HttpBasicAuthenticator("username", "password");
|
||||
var request = new RestRequest($"/api/attivazioni", DataFormat.Json);
|
||||
var request = new RestRequest($"/api/attivazioni/removeKey", DataFormat.Json);
|
||||
UserLicenseRequest newBody = new UserLicenseRequest()
|
||||
{
|
||||
MasterKey = MasterKey,
|
||||
ParamDict = ParamsList
|
||||
};
|
||||
request.AddJsonBody(newBody);
|
||||
var response = client.Delete(request);
|
||||
var response = client.Post(request);
|
||||
// controllo risposta
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user