update pacchetti + fix gestione operatività vietata x utenti NON attivi (x check licenze) / da testare integrazione redis x applicazioni ADMIN, BCODE e SMART
This commit is contained in:
@@ -26,7 +26,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<%--<div class="row" style="float: none; text-align: center; margin: auto;">--%>
|
||||
<div runat="server" id="divSx" visible="false">
|
||||
<asp:Panel ID="pnlEditOre" runat="server" Height="100%" Visible="false">
|
||||
<div class="blockSpac">
|
||||
@@ -72,8 +71,6 @@
|
||||
</b><b>
|
||||
<asp:Label ID="lblh_lav" runat="server" Text='<%# formatDurata(Eval("h_lav")) %>' CssClass='<%# classByPerm(Eval("minPerm")) %>'
|
||||
ToolTip='<%# tooltipPermStra(Eval("minStra"),Eval("minPerm")) %>' /></b>
|
||||
<%--<asp:ImageButton ID="imgEditTimbr" runat="server" CausesValidation="False" CommandName="Select" ToolTip="Edit Timbrature"
|
||||
ImageUrl="~/images/edit_s.png" OnClick="imgEditTimbr_Click" CommandArgument='<%# Eval("Data") %>' />--%>
|
||||
<asp:LinkButton runat="server" ID="lnkEditTimbr" CausesValidation="False" CommandName="Select" ToolTip="Edit Timbrature" CommandArgument='<%# Eval("Data") %>' Visible='<%# regAttEnabled %>' CssClass="text-danger" OnClick="lnkEditTimbr_Click"><i class="fa fa-pencil fa-2x" aria-hidden="true"></i></asp:LinkButton>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
@@ -100,7 +97,6 @@
|
||||
<div style="text-align: right; margin: auto; margin-left: 8px;">
|
||||
<b>
|
||||
<asp:Label ID="lblh_com" runat="server" Text='<%# formatDurata(Eval("h_com")) %>' /></b>
|
||||
<%--<asp:ImageButton ID="imgEditComm" runat="server" CausesValidation="False" CommandName="Select" ToolTip="Edit Ore commesse" ImageUrl="~/images/edit_s.png" OnClick="imgEditComm_Click" CommandArgument='<%# Eval("Data") %>' Visible='<%# regAttEnabled %>' />--%>
|
||||
<asp:LinkButton runat="server" ID="lnkEditComm" CausesValidation="False" CommandName="Select" ToolTip="Edit Ore commesse" CommandArgument='<%# Eval("Data") %>' Visible='<%# regAttEnabled %>' CssClass="text-success" OnClick="lnkEditComm_Click"><i class="fa fa-pencil fa-2x" aria-hidden="true"></i></asp:LinkButton>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -10,423 +10,430 @@ using GPW_data;
|
||||
|
||||
namespace GPW_Commesse.WebUserControls
|
||||
{
|
||||
/// <summary>
|
||||
/// modalità ammesse per il controllo
|
||||
/// </summary>
|
||||
public enum modoCommesse
|
||||
{
|
||||
/// <summary>
|
||||
/// modalità ammesse per il controllo
|
||||
/// elenco giornate e resoconto
|
||||
/// </summary>
|
||||
public enum modoCommesse
|
||||
elenco,
|
||||
/// <summary>
|
||||
/// edit timbrature attivo
|
||||
/// </summary>
|
||||
editTimb,
|
||||
/// <summary>
|
||||
/// edit Registro Attività attivo
|
||||
/// </summary>
|
||||
editRegAtt
|
||||
}
|
||||
public partial class mod_commUtLog : System.Web.UI.UserControl
|
||||
{
|
||||
public modoCommesse activeMode
|
||||
{
|
||||
/// <summary>
|
||||
/// elenco giornate e resoconto
|
||||
/// </summary>
|
||||
elenco,
|
||||
/// <summary>
|
||||
/// edit timbrature attivo
|
||||
/// </summary>
|
||||
editTimb,
|
||||
/// <summary>
|
||||
/// edit Registro Attività attivo
|
||||
/// </summary>
|
||||
editRegAtt
|
||||
get
|
||||
{
|
||||
modoCommesse answ = modoCommesse.elenco;
|
||||
try
|
||||
{
|
||||
answ = (modoCommesse)memLayer.ML.objSessionObj("activeModeComm");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("activeModeComm", value);
|
||||
}
|
||||
}
|
||||
public partial class mod_commUtLog : System.Web.UI.UserControl
|
||||
/// <summary>
|
||||
/// Avvio pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
public modoCommesse activeMode
|
||||
memLayer.ML.setSessionVal("maxErrMin", memLayer.ML.confReadInt("maxErrMin"));
|
||||
memLayer.ML.setSessionVal("maxErrPlus", memLayer.ML.confReadInt("maxErrPlus"));
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
activeMode = modoCommesse.elenco;
|
||||
intervalloDate periodo = new intervalloDate();
|
||||
periodo.fine = DateTime.Now.AddDays(1);
|
||||
periodo.inizio = periodo.fine.AddDays(-10);
|
||||
mod_periodoAnalisi1.intervalloAnalisi = periodo;
|
||||
// salvo link in HF
|
||||
hfDataFrom.Value = periodo.inizio.ToString();
|
||||
hfDataTo.Value = periodo.fine.ToString();
|
||||
// imposto modo tag cloud
|
||||
string modoTC = memLayer.ML.confReadString("TagCloudMode");
|
||||
switch (modoTC)
|
||||
{
|
||||
get
|
||||
{
|
||||
modoCommesse answ = modoCommesse.elenco;
|
||||
try
|
||||
{
|
||||
answ = (modoCommesse)memLayer.ML.objSessionObj("activeModeComm");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("activeModeComm", value);
|
||||
}
|
||||
case "elenco":
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.elenco;
|
||||
break;
|
||||
case "elencoCPF":
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.elencoCPF;
|
||||
break;
|
||||
case "piramide":
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.piramide;
|
||||
break;
|
||||
case "standard":
|
||||
default:
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.standard;
|
||||
break;
|
||||
}
|
||||
/// <summary>
|
||||
/// Avvio pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
memLayer.ML.setSessionVal("maxErrMin", memLayer.ML.confReadInt("maxErrMin"));
|
||||
memLayer.ML.setSessionVal("maxErrPlus", memLayer.ML.confReadInt("maxErrPlus"));
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
activeMode = modoCommesse.elenco;
|
||||
intervalloDate periodo = new intervalloDate();
|
||||
periodo.fine = DateTime.Now.AddDays(1);
|
||||
periodo.inizio = periodo.fine.AddDays(-10);
|
||||
mod_periodoAnalisi1.intervalloAnalisi = periodo;
|
||||
// salvo link in HF
|
||||
hfDataFrom.Value = periodo.inizio.ToString();
|
||||
hfDataTo.Value = periodo.fine.ToString();
|
||||
// imposto modo tag cloud
|
||||
string modoTC = memLayer.ML.confReadString("TagCloudMode");
|
||||
switch (modoTC)
|
||||
{
|
||||
case "elenco":
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.elenco;
|
||||
break;
|
||||
case "elencoCPF":
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.elencoCPF;
|
||||
break;
|
||||
case "piramide":
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.piramide;
|
||||
break;
|
||||
case "standard":
|
||||
default:
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.standard;
|
||||
break;
|
||||
}
|
||||
}
|
||||
showPanels();
|
||||
grView.DataBind();
|
||||
mod_commUtMancTimbr1.eh_nuovoValore += new EventHandler(mod_commUtMancTimbr1_eh_nuovoValore);
|
||||
mod_commAttivitaDesk1.eh_nuovoValore += new EventHandler(mod_commAttivitaDesk1_eh_nuovoValore);
|
||||
mod_TagCloudProgetti1.eh_newVal += new EventHandler(mod_TagCloudProgetti1_eh_newVal);
|
||||
mod_TagCloudProgetti1.eh_refresh += mod_TagCloudProgetti1_eh_refresh;
|
||||
mod_periodoAnalisi1.eh_doUpdate += mod_periodoAnalisi1_eh_doUpdate;
|
||||
}
|
||||
|
||||
void mod_TagCloudProgetti1_eh_refresh(object sender, EventArgs e)
|
||||
{
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_periodoAnalisi1_eh_doUpdate(object sender, EventArgs e)
|
||||
{
|
||||
// 2016.04.07: salvo intervallo nei 2 hidden field
|
||||
hfDataFrom.Value = mod_periodoAnalisi1.intervalloAnalisi.inizio.ToString();
|
||||
hfDataTo.Value= mod_periodoAnalisi1.intervalloAnalisi.fine.ToString();
|
||||
// update
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_TagCloudProgetti1_eh_newVal(object sender, EventArgs e)
|
||||
{
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_commAttivitaDesk1_eh_nuovoValore(object sender, EventArgs e)
|
||||
{
|
||||
mod_TagCloudProgetti1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_commUtMancTimbr1_eh_nuovoValore(object sender, EventArgs e)
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// inverte valore booleano
|
||||
/// </summary>
|
||||
/// <param name="isEnt"></param>
|
||||
/// <returns></returns>
|
||||
public bool invBool(object valore)
|
||||
{
|
||||
bool answ = true;
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(valore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// idxDipendente insessione
|
||||
/// </summary>
|
||||
protected int idxDip
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxDipBCode");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxDipBCode", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta edit timbrature
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgEditTimbr_Click(object sender, EventArgs e)
|
||||
{
|
||||
string dataRif = ((ImageButton)sender).CommandArgument;
|
||||
editTimbr(dataRif);
|
||||
}
|
||||
|
||||
private void editTimbr(string dataRif)
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
CultureInfo ita = new CultureInfo("it-IT");
|
||||
mod_commUtMancTimbr1.valoreDateTime = Convert.ToDateTime(dataRif, ita).AddHours(adesso.Hour).AddMinutes(adesso.Minute - adesso.Minute % 5);
|
||||
//salvo in sessione dati x detail timbrature
|
||||
memLayer.ML.setSessionVal("inizioDet", Convert.ToDateTime(dataRif, ita).Date);
|
||||
memLayer.ML.setSessionVal("fineDet", Convert.ToDateTime(dataRif, ita).Date.AddDays(1));
|
||||
memLayer.ML.setSessionVal("idxDip_det", DataProxy.idxDipendente);
|
||||
// imposto modalità
|
||||
activeMode = modoCommesse.editTimb;
|
||||
showPanels();
|
||||
}
|
||||
|
||||
protected void lnkEditTimbr_Click(object sender, EventArgs e)
|
||||
{
|
||||
string dataRif = ((LinkButton)sender).CommandArgument;
|
||||
editTimbr(dataRif);
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta edit commesse
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgEditComm_Click(object sender, EventArgs e)
|
||||
{
|
||||
string dataRif = ((ImageButton)sender).CommandArgument;
|
||||
editCommDay(dataRif);
|
||||
}
|
||||
|
||||
private void editCommDay(string dataRif)
|
||||
{
|
||||
CultureInfo ita = new CultureInfo("it-IT");
|
||||
mod_commAttivitaDesk1.idxDipCurr = DataProxy.idxDipendente;
|
||||
mod_commAttivitaDesk1.valoreDateTime = Convert.ToDateTime(dataRif, ita);
|
||||
mod_TagCloudProgetti1.dataRif = Convert.ToDateTime(dataRif, ita);
|
||||
activeMode = modoCommesse.editRegAtt;
|
||||
showPanels();
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
}
|
||||
|
||||
protected void lnkEditComm_Click(object sender, EventArgs e)
|
||||
{
|
||||
string dataRif = ((LinkButton)sender).CommandArgument;
|
||||
editCommDay(dataRif);
|
||||
}
|
||||
/// <summary>
|
||||
/// indica se sia abilitato l'editing delle attività legate alle commesse
|
||||
/// </summary>
|
||||
public bool regAttEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.confReadBool("regAttEnabled");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="minPerm"></param>
|
||||
/// <returns></returns>
|
||||
public string classByPerm(object minPerm)
|
||||
{
|
||||
string answ = "";
|
||||
if (Convert.ToDouble(minPerm) > 0)
|
||||
{
|
||||
answ = "lblWarning";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// prepara tooltip permessi/straordinarie
|
||||
/// </summary>
|
||||
/// <param name="minStra"></param>
|
||||
/// <param name="minPerm"></param>
|
||||
/// <returns></returns>
|
||||
public string tooltipPermStra(object minStra, object minPerm)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
answ = string.Format("Straordinarie: {0} - Permessi: {1} (h:mm)", utils.formOreMin(Convert.ToDecimal(minStra) / 60), utils.formOreMin(Convert.ToDecimal(minPerm) / 60));
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = string.Format("Straordinarie: {0:0.##} h - Permessi: {1:0.##} h", Convert.ToDouble(minStra) / 60, Convert.ToDouble(minPerm) / 60);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta visualizzazione dei pannelli opzionali laterali a seocnda del modo attivo
|
||||
/// </summary>
|
||||
protected void showPanels()
|
||||
{
|
||||
// imposto valori default
|
||||
bool timbr = false;
|
||||
bool commesse = false;
|
||||
divDx.Attributes.Remove("class");
|
||||
divCn.Attributes.Remove("class");
|
||||
divSx.Attributes.Remove("class");
|
||||
switch (activeMode)
|
||||
{
|
||||
case modoCommesse.editTimb:
|
||||
timbr = true;
|
||||
divCn.Attributes.Add("class", "col-sm-7 col-md-8 col-lg-9");
|
||||
divSx.Attributes.Add("class", "col-sm-5 col-md-4 col-lg-3");
|
||||
divDx.Visible = false;
|
||||
divSx.Visible = true;
|
||||
break;
|
||||
case modoCommesse.editRegAtt:
|
||||
commesse = true;
|
||||
divCn.Attributes.Add("class", "col-sm-6 col-md-7 col-lg-8");
|
||||
divDx.Attributes.Add("class", "col-sm-6 col-md-5 col-lg-4");
|
||||
divDx.Visible = true;
|
||||
divSx.Visible = false;
|
||||
break;
|
||||
case modoCommesse.elenco:
|
||||
default:
|
||||
divCn.Attributes.Add("class", "col-xs-12");
|
||||
divDx.Visible = false;
|
||||
divSx.Visible = false;
|
||||
break;
|
||||
}
|
||||
pnlEditCom.Visible = commesse;
|
||||
pnlEditOre.Visible = timbr;
|
||||
mod_commUtMancTimbr1.Visible = timbr;
|
||||
mod_commAttivitaDesk1.Visible = commesse;
|
||||
}
|
||||
/// <summary>
|
||||
/// chiamata del button close (entrambi)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
activeMode = modoCommesse.elenco;
|
||||
showPanels();
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// fornisce img x check coerenza ore timbrate e commesse
|
||||
/// </summary>
|
||||
/// <param name="okLavCom"></param>
|
||||
/// <returns></returns>
|
||||
public string imgChk(object okLavCom)
|
||||
{
|
||||
string answ = "~/images/statoKo_m.png";
|
||||
try
|
||||
{
|
||||
if (Convert.ToBoolean(okLavCom))
|
||||
{
|
||||
answ = "~/images/statoOk_m.png";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// formatta stringa giustificativi
|
||||
/// </summary>
|
||||
/// <param name="_minPerm">permessi</param>
|
||||
/// <param name="_minFer">ferie</param>
|
||||
/// <param name="_minMal">malattia</param>
|
||||
/// <param name="_minFest">festività</param>
|
||||
/// <param name="_minMPP">MPP</param>
|
||||
/// <returns></returns>
|
||||
public string txtGiust(object _minPerm, object _minFer, object _minMal, object _minFest, object _minMPP)
|
||||
{
|
||||
string answ = "";
|
||||
double minPerm = Convert.ToInt32(_minPerm);
|
||||
double minFer = Convert.ToInt32(_minFer);
|
||||
double minMal = Convert.ToInt32(_minMal);
|
||||
double minFest = Convert.ToInt32(_minFest);
|
||||
double minMpp = Convert.ToInt32(_minMPP);
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0} Pe ", utils.formOreMin(Convert.ToDecimal(minPerm / 60)));
|
||||
if (minFer > 0) answ += string.Format("{0} Fe ", utils.formOreMin(Convert.ToDecimal(minFer / 60)));
|
||||
if (minMal > 0) answ += string.Format("{0} Ma ", utils.formOreMin(Convert.ToDecimal(minMal / 60)));
|
||||
if (minFest > 0) answ += string.Format("{0} Fs ", utils.formOreMin(Convert.ToDecimal(minFest / 60)));
|
||||
if (minMpp > 0) answ += string.Format("{0} Mpp ", utils.formOreMin(Convert.ToDecimal(minMpp / 60)));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0:0.00} Pe ", minPerm / 60);
|
||||
if (minFer > 0) answ += string.Format("{0:0.00} Fe ", minFer / 60);
|
||||
if (minMal > 0) answ += string.Format("{0:0.00} Ma ", minMal / 60);
|
||||
if (minFest > 0) answ += string.Format("{0:0.00} Fs ", minFest / 60);
|
||||
if (minMpp > 0) answ += string.Format("{0:0.00} Mpp ", minMpp / 60);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// formatta stringa tooltip giustificativi
|
||||
/// </summary>
|
||||
/// <param name="_minPerm">permessi</param>
|
||||
/// <param name="_minFer">ferie</param>
|
||||
/// <param name="_minMal">malattia</param>
|
||||
/// <param name="_minFest">festività</param>
|
||||
/// <param name="_minMPP">MPP</param>
|
||||
/// <returns></returns>
|
||||
public string tooltipGiust(object _minPerm, object _minFer, object _minMal, object _minFest, object _minMPP)
|
||||
{
|
||||
string answ = "";
|
||||
double minPerm = Convert.ToInt32(_minPerm);
|
||||
double minFer = Convert.ToInt32(_minFer);
|
||||
double minMal = Convert.ToInt32(_minMal);
|
||||
double minFest = Convert.ToInt32(_minFest);
|
||||
double minMpp = Convert.ToInt32(_minMPP);
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0} Permesso ", utils.formOreMin(Convert.ToDecimal(minPerm / 60)));
|
||||
if (minFer > 0) answ += string.Format("{0} Ferie ", utils.formOreMin(Convert.ToDecimal(minFer / 60)));
|
||||
if (minMal > 0) answ += string.Format("{0} Malattia ", utils.formOreMin(Convert.ToDecimal(minMal / 60)));
|
||||
if (minFest > 0) answ += string.Format("{0} Festività ", utils.formOreMin(Convert.ToDecimal(minFest / 60)));
|
||||
if (minMpp > 0) answ += string.Format("{0} Manc.Pausa Pranzo ", utils.formOreMin(Convert.ToDecimal(minMpp / 60)));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0:0.00}h Permesso ", minPerm / 60);
|
||||
if (minFer > 0) answ += string.Format("{0:0.00}h Ferie ", minFer / 60);
|
||||
if (minMal > 0) answ += string.Format("{0:0.00}h Malattia ", minMal / 60);
|
||||
if (minFest > 0) answ += string.Format("{0:0.00}h Festività ", minFest / 60);
|
||||
if (minMpp > 0) answ += string.Format("{0:0.00}h Manc.Pausa Pranzo ", minMpp / 60);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// formatta la durata in ore secondo web.config (centesimale/ore:min)
|
||||
/// </summary>
|
||||
/// <param name="oreCent"></param>
|
||||
/// <returns></returns>
|
||||
public string formatDurata(object oreCent)
|
||||
{
|
||||
decimal ore = 0;
|
||||
try
|
||||
{
|
||||
ore = Convert.ToDecimal(oreCent);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
string answ = "";
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
answ = utils.formOreMin(ore);
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = ore.ToString("0.00");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
}
|
||||
showPanels();
|
||||
grView.DataBind();
|
||||
mod_commUtMancTimbr1.eh_nuovoValore += new EventHandler(mod_commUtMancTimbr1_eh_nuovoValore);
|
||||
mod_commAttivitaDesk1.eh_nuovoValore += new EventHandler(mod_commAttivitaDesk1_eh_nuovoValore);
|
||||
mod_TagCloudProgetti1.eh_newVal += new EventHandler(mod_TagCloudProgetti1_eh_newVal);
|
||||
mod_TagCloudProgetti1.eh_refresh += mod_TagCloudProgetti1_eh_refresh;
|
||||
mod_periodoAnalisi1.eh_doUpdate += mod_periodoAnalisi1_eh_doUpdate;
|
||||
}
|
||||
|
||||
void mod_TagCloudProgetti1_eh_refresh(object sender, EventArgs e)
|
||||
{
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_periodoAnalisi1_eh_doUpdate(object sender, EventArgs e)
|
||||
{
|
||||
// 2016.04.07: salvo intervallo nei 2 hidden field
|
||||
hfDataFrom.Value = mod_periodoAnalisi1.intervalloAnalisi.inizio.ToString();
|
||||
hfDataTo.Value = mod_periodoAnalisi1.intervalloAnalisi.fine.ToString();
|
||||
// update
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_TagCloudProgetti1_eh_newVal(object sender, EventArgs e)
|
||||
{
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_commAttivitaDesk1_eh_nuovoValore(object sender, EventArgs e)
|
||||
{
|
||||
mod_TagCloudProgetti1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_commUtMancTimbr1_eh_nuovoValore(object sender, EventArgs e)
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// inverte valore booleano
|
||||
/// </summary>
|
||||
/// <param name="isEnt"></param>
|
||||
/// <returns></returns>
|
||||
public bool invBool(object valore)
|
||||
{
|
||||
bool answ = true;
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(valore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// idxDipendente in sessione
|
||||
/// </summary>
|
||||
protected int idxDip
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxDipBCode");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxDipBCode", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta edit timbrature
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgEditTimbr_Click(object sender, EventArgs e)
|
||||
{
|
||||
string dataRif = ((ImageButton)sender).CommandArgument;
|
||||
editTimbr(dataRif);
|
||||
}
|
||||
|
||||
private void editTimbr(string dataRif)
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
CultureInfo ita = new CultureInfo("it-IT");
|
||||
mod_commUtMancTimbr1.valoreDateTime = Convert.ToDateTime(dataRif, ita).AddHours(adesso.Hour).AddMinutes(adesso.Minute - adesso.Minute % 5);
|
||||
//salvo in sessione dati x detail timbrature
|
||||
memLayer.ML.setSessionVal("inizioDet", Convert.ToDateTime(dataRif, ita).Date);
|
||||
memLayer.ML.setSessionVal("fineDet", Convert.ToDateTime(dataRif, ita).Date.AddDays(1));
|
||||
memLayer.ML.setSessionVal("idxDip_det", DataProxy.idxDipendente);
|
||||
// imposto modalità
|
||||
activeMode = modoCommesse.editTimb;
|
||||
showPanels();
|
||||
}
|
||||
|
||||
protected void lnkEditTimbr_Click(object sender, EventArgs e)
|
||||
{
|
||||
string dataRif = ((LinkButton)sender).CommandArgument;
|
||||
// verifico se dip sia attivo...
|
||||
if (DataProxy.currDipIsActive)
|
||||
{
|
||||
editTimbr(dataRif);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta edit commesse
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgEditComm_Click(object sender, EventArgs e)
|
||||
{
|
||||
string dataRif = ((ImageButton)sender).CommandArgument;
|
||||
editCommDay(dataRif);
|
||||
}
|
||||
|
||||
private void editCommDay(string dataRif)
|
||||
{
|
||||
CultureInfo ita = new CultureInfo("it-IT");
|
||||
mod_commAttivitaDesk1.idxDipCurr = DataProxy.idxDipendente;
|
||||
mod_commAttivitaDesk1.valoreDateTime = Convert.ToDateTime(dataRif, ita);
|
||||
mod_TagCloudProgetti1.dataRif = Convert.ToDateTime(dataRif, ita);
|
||||
activeMode = modoCommesse.editRegAtt;
|
||||
showPanels();
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
}
|
||||
|
||||
protected void lnkEditComm_Click(object sender, EventArgs e)
|
||||
{
|
||||
string dataRif = ((LinkButton)sender).CommandArgument;
|
||||
// verifico se dip sia attivo...
|
||||
if (DataProxy.currDipIsActive)
|
||||
{
|
||||
editCommDay(dataRif);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// indica se sia abilitato l'editing delle attività legate alle commesse e l'utente sia attivo!!!
|
||||
/// </summary>
|
||||
public bool regAttEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.confReadBool("regAttEnabled") && DataProxy.currDipIsActive;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="minPerm"></param>
|
||||
/// <returns></returns>
|
||||
public string classByPerm(object minPerm)
|
||||
{
|
||||
string answ = "";
|
||||
if (Convert.ToDouble(minPerm) > 0)
|
||||
{
|
||||
answ = "lblWarning";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// prepara tooltip permessi/straordinarie
|
||||
/// </summary>
|
||||
/// <param name="minStra"></param>
|
||||
/// <param name="minPerm"></param>
|
||||
/// <returns></returns>
|
||||
public string tooltipPermStra(object minStra, object minPerm)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
answ = string.Format("Straordinarie: {0} - Permessi: {1} (h:mm)", utils.formOreMin(Convert.ToDecimal(minStra) / 60), utils.formOreMin(Convert.ToDecimal(minPerm) / 60));
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = string.Format("Straordinarie: {0:0.##} h - Permessi: {1:0.##} h", Convert.ToDouble(minStra) / 60, Convert.ToDouble(minPerm) / 60);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta visualizzazione dei pannelli opzionali laterali a seocnda del modo attivo
|
||||
/// </summary>
|
||||
protected void showPanels()
|
||||
{
|
||||
// imposto valori default
|
||||
bool timbr = false;
|
||||
bool commesse = false;
|
||||
divDx.Attributes.Remove("class");
|
||||
divCn.Attributes.Remove("class");
|
||||
divSx.Attributes.Remove("class");
|
||||
switch (activeMode)
|
||||
{
|
||||
case modoCommesse.editTimb:
|
||||
timbr = true;
|
||||
divCn.Attributes.Add("class", "col-sm-7 col-md-8 col-lg-9");
|
||||
divSx.Attributes.Add("class", "col-sm-5 col-md-4 col-lg-3");
|
||||
divDx.Visible = false;
|
||||
divSx.Visible = true;
|
||||
break;
|
||||
case modoCommesse.editRegAtt:
|
||||
commesse = true;
|
||||
divCn.Attributes.Add("class", "col-sm-6 col-md-7 col-lg-8");
|
||||
divDx.Attributes.Add("class", "col-sm-6 col-md-5 col-lg-4");
|
||||
divDx.Visible = true;
|
||||
divSx.Visible = false;
|
||||
break;
|
||||
case modoCommesse.elenco:
|
||||
default:
|
||||
divCn.Attributes.Add("class", "col-xs-12");
|
||||
divDx.Visible = false;
|
||||
divSx.Visible = false;
|
||||
break;
|
||||
}
|
||||
pnlEditCom.Visible = commesse;
|
||||
pnlEditOre.Visible = timbr;
|
||||
mod_commUtMancTimbr1.Visible = timbr;
|
||||
mod_commAttivitaDesk1.Visible = commesse;
|
||||
}
|
||||
/// <summary>
|
||||
/// chiamata del button close (entrambi)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
activeMode = modoCommesse.elenco;
|
||||
showPanels();
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// fornisce img x check coerenza ore timbrate e commesse
|
||||
/// </summary>
|
||||
/// <param name="okLavCom"></param>
|
||||
/// <returns></returns>
|
||||
public string imgChk(object okLavCom)
|
||||
{
|
||||
string answ = "~/images/statoKo_m.png";
|
||||
try
|
||||
{
|
||||
if (Convert.ToBoolean(okLavCom))
|
||||
{
|
||||
answ = "~/images/statoOk_m.png";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// formatta stringa giustificativi
|
||||
/// </summary>
|
||||
/// <param name="_minPerm">permessi</param>
|
||||
/// <param name="_minFer">ferie</param>
|
||||
/// <param name="_minMal">malattia</param>
|
||||
/// <param name="_minFest">festività</param>
|
||||
/// <param name="_minMPP">MPP</param>
|
||||
/// <returns></returns>
|
||||
public string txtGiust(object _minPerm, object _minFer, object _minMal, object _minFest, object _minMPP)
|
||||
{
|
||||
string answ = "";
|
||||
double minPerm = Convert.ToInt32(_minPerm);
|
||||
double minFer = Convert.ToInt32(_minFer);
|
||||
double minMal = Convert.ToInt32(_minMal);
|
||||
double minFest = Convert.ToInt32(_minFest);
|
||||
double minMpp = Convert.ToInt32(_minMPP);
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0} Pe ", utils.formOreMin(Convert.ToDecimal(minPerm / 60)));
|
||||
if (minFer > 0) answ += string.Format("{0} Fe ", utils.formOreMin(Convert.ToDecimal(minFer / 60)));
|
||||
if (minMal > 0) answ += string.Format("{0} Ma ", utils.formOreMin(Convert.ToDecimal(minMal / 60)));
|
||||
if (minFest > 0) answ += string.Format("{0} Fs ", utils.formOreMin(Convert.ToDecimal(minFest / 60)));
|
||||
if (minMpp > 0) answ += string.Format("{0} Mpp ", utils.formOreMin(Convert.ToDecimal(minMpp / 60)));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0:0.00} Pe ", minPerm / 60);
|
||||
if (minFer > 0) answ += string.Format("{0:0.00} Fe ", minFer / 60);
|
||||
if (minMal > 0) answ += string.Format("{0:0.00} Ma ", minMal / 60);
|
||||
if (minFest > 0) answ += string.Format("{0:0.00} Fs ", minFest / 60);
|
||||
if (minMpp > 0) answ += string.Format("{0:0.00} Mpp ", minMpp / 60);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// formatta stringa tooltip giustificativi
|
||||
/// </summary>
|
||||
/// <param name="_minPerm">permessi</param>
|
||||
/// <param name="_minFer">ferie</param>
|
||||
/// <param name="_minMal">malattia</param>
|
||||
/// <param name="_minFest">festività</param>
|
||||
/// <param name="_minMPP">MPP</param>
|
||||
/// <returns></returns>
|
||||
public string tooltipGiust(object _minPerm, object _minFer, object _minMal, object _minFest, object _minMPP)
|
||||
{
|
||||
string answ = "";
|
||||
double minPerm = Convert.ToInt32(_minPerm);
|
||||
double minFer = Convert.ToInt32(_minFer);
|
||||
double minMal = Convert.ToInt32(_minMal);
|
||||
double minFest = Convert.ToInt32(_minFest);
|
||||
double minMpp = Convert.ToInt32(_minMPP);
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0} Permesso ", utils.formOreMin(Convert.ToDecimal(minPerm / 60)));
|
||||
if (minFer > 0) answ += string.Format("{0} Ferie ", utils.formOreMin(Convert.ToDecimal(minFer / 60)));
|
||||
if (minMal > 0) answ += string.Format("{0} Malattia ", utils.formOreMin(Convert.ToDecimal(minMal / 60)));
|
||||
if (minFest > 0) answ += string.Format("{0} Festività ", utils.formOreMin(Convert.ToDecimal(minFest / 60)));
|
||||
if (minMpp > 0) answ += string.Format("{0} Manc.Pausa Pranzo ", utils.formOreMin(Convert.ToDecimal(minMpp / 60)));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0:0.00}h Permesso ", minPerm / 60);
|
||||
if (minFer > 0) answ += string.Format("{0:0.00}h Ferie ", minFer / 60);
|
||||
if (minMal > 0) answ += string.Format("{0:0.00}h Malattia ", minMal / 60);
|
||||
if (minFest > 0) answ += string.Format("{0:0.00}h Festività ", minFest / 60);
|
||||
if (minMpp > 0) answ += string.Format("{0:0.00}h Manc.Pausa Pranzo ", minMpp / 60);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// formatta la durata in ore secondo web.config (centesimale/ore:min)
|
||||
/// </summary>
|
||||
/// <param name="oreCent"></param>
|
||||
/// <returns></returns>
|
||||
public string formatDurata(object oreCent)
|
||||
{
|
||||
decimal ore = 0;
|
||||
try
|
||||
{
|
||||
ore = Convert.ToDecimal(oreCent);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
string answ = "";
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
answ = utils.formOreMin(ore);
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = ore.ToString("0.00");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user