7d289a3b64
pulizia codice...
147 lines
4.2 KiB
C#
147 lines
4.2 KiB
C#
using SteamWare;
|
|
using System;
|
|
using System.Web.UI.WebControls;
|
|
|
|
public partial class mod_gestUtentiGIM : System.Web.UI.UserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
traduciObj();
|
|
}
|
|
|
|
private void traduciObj()
|
|
{
|
|
lblUsers.Text = traduci("ElencoUtentiStd");
|
|
lblSuperusers.Text = traduci("ElencoElUtentiSU");
|
|
btnPromuovi.Text = traduci("promuoviUtente");
|
|
btnDeclassa.Text = traduci("declassaUtente");
|
|
}
|
|
/// <summary>
|
|
/// wrapper traduzione
|
|
/// </summary>
|
|
/// <param name="lemma"></param>
|
|
/// <returns></returns>
|
|
public string traduci(object lemma)
|
|
{
|
|
return user_std.UtSn.Traduci(lemma.ToString());
|
|
}
|
|
/// <summary>
|
|
/// reset delle selezioni
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnResetU_Click(object sender, EventArgs e)
|
|
{
|
|
resetSelezioneUser();
|
|
lblWarning.Visible = false;
|
|
}
|
|
/// <summary>
|
|
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
|
/// </summary>
|
|
public void resetSelezioneUser()
|
|
{
|
|
grViewUsers.SelectedIndex = -1;
|
|
grViewUsers.DataBind();
|
|
}
|
|
/// <summary>
|
|
/// reset delle selezioni
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnResetSU_Click(object sender, EventArgs e)
|
|
{
|
|
resetSelezioneSuperUser();
|
|
lblWarning.Visible = false;
|
|
}
|
|
/// <summary>
|
|
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
|
/// </summary>
|
|
public void resetSelezioneSuperUser()
|
|
{
|
|
grViewSuperusers.SelectedIndex = -1;
|
|
grViewSuperusers.DataBind();
|
|
}
|
|
protected void btnPromuovi_Click(object sender, EventArgs e)
|
|
{
|
|
if (grViewUsers.SelectedIndex != -1)
|
|
{
|
|
lblWarning.Visible = false;
|
|
user_std.UtSn.assegnaDirittoUtente(grViewUsers.SelectedValue.ToString(), memLayer.ML.confReadString("autoEnrollCdc"), "GIM", "GIM_SU");
|
|
}
|
|
else
|
|
{
|
|
lblWarning.Visible = true;
|
|
lblWarning.Text = traduci("utenteNonSelezionato");
|
|
}
|
|
resetSelezioneUser();
|
|
grViewUsers.DataBind();
|
|
resetSelezioneSuperUser();
|
|
grViewSuperusers.DataBind();
|
|
}
|
|
protected void btnDeclassa_Click(object sender, EventArgs e)
|
|
{
|
|
if (grViewSuperusers.SelectedIndex != -1)
|
|
{
|
|
lblWarning.Visible = false;
|
|
user_std.UtSn.rimuoviDirittoUtente(grViewSuperusers.SelectedValue.ToString(), memLayer.ML.confReadString("autoEnrollCdc"), "GIM", "GIM_SU");
|
|
}
|
|
else
|
|
{
|
|
lblWarning.Visible = true;
|
|
lblWarning.Text = traduci("utenteNonSelezionato");
|
|
}
|
|
resetSelezioneUser();
|
|
grViewUsers.DataBind();
|
|
resetSelezioneSuperUser();
|
|
grViewSuperusers.DataBind();
|
|
}
|
|
|
|
/// <summary>
|
|
/// traduce gli header delle colonne
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void grViewUsers_DataBound(object sender, EventArgs e)
|
|
{
|
|
if (grViewUsers.Rows.Count > 0)
|
|
{
|
|
LinkButton lb;
|
|
// aggiorno gli headers
|
|
foreach (TableCell cella in grViewUsers.HeaderRow.Cells)
|
|
{
|
|
try
|
|
{
|
|
lb = (LinkButton)cella.Controls[0];
|
|
lb.Text = traduci(lb.Text);
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// traduce gli header delle colonne seconda tab
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void grViewSuperusers_DataBound(object sender, EventArgs e)
|
|
{
|
|
if (grViewSuperusers.Rows.Count > 0)
|
|
{
|
|
LinkButton lb;
|
|
// aggiorno gli headers
|
|
foreach (TableCell cella in grViewSuperusers.HeaderRow.Cells)
|
|
{
|
|
try
|
|
{
|
|
lb = (LinkButton)cella.Controls[0];
|
|
lb.Text = traduci(lb.Text);
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
}
|
|
}
|
|
}
|