Completato gestioen verifica ORE

This commit is contained in:
Samuele Locatelli
2021-10-19 18:22:47 +02:00
parent c1d92b2872
commit a5c3d68041
4 changed files with 72 additions and 45 deletions
@@ -9,15 +9,12 @@
<asp:Table runat="server" ID="tblBlocco" Width="100%" CellPadding="0" CellSpacing="0">
</asp:Table>
</div>
<div class="divSx ui-corner-all shadowBox"" style="white-space: nowrap; padding: 4px; margin-left:4px; font-size: 7pt;">
<h3>Legenda</h3>
Ore Effettive / Ore programmate
<%--<br /><br />
indice rendimento:
<div class="divSx ui-corner-all shadowBox" style="white-space: nowrap; padding: 4px; margin-left: 4px; font-size: 7pt;">
<h3>Legenda Ore</h3>
[Effettive / Programmate]
<br />
<img src="Images/FormulaCorr.png" width="120" height="30" />--%>
(Timbrate)
</div>
</div>
<div class="clearDiv">
@@ -27,4 +24,4 @@
</div>
</div>
<div class="clearDiv"></div>
<div class="clearDiv"></div>
@@ -22,6 +22,7 @@ namespace PROJ_ETS.WebUserControls
protected int oreTotBgt;
protected int[] oreTotComm;
protected int[] oreTotDip;
protected int[] oreTotTimbDip;
protected Ds_ProjEts.BazaarRisorseRow rigaBaz;
protected DS_utilsProjEts.v_selCommesseRow rigaComm;
protected DS_utilsProjEts.v_selCommesseRow rigaCommShort;
@@ -35,6 +36,7 @@ namespace PROJ_ETS.WebUserControls
protected ETS_Data.Type.ImpiegoRes[,] TabellaRisorse;
protected Ds_ProjEts.ImpiegoRisorseDataTable tabIR = new Ds_ProjEts.ImpiegoRisorseDataTable();
protected Ds_ProjEts.ImpiegoRisorseDataTable tabIRPareto = new Ds_ProjEts.ImpiegoRisorseDataTable();
protected Ds_ProjEts.TimbratureExplDataTable tabTE = new Ds_ProjEts.TimbratureExplDataTable();
#endregion Protected Fields
@@ -116,6 +118,7 @@ namespace PROJ_ETS.WebUserControls
int idxDip = 0;
int idxFase = 0;
int oreTotIR = 0;
int oreTotTE = 0;
int oreTotBaz = 0;
string nomeComm = "";
// recupero il numero di TUTTE le celle
@@ -129,6 +132,7 @@ namespace PROJ_ETS.WebUserControls
tabBaz = DataProxy_ProjEts.DP.taBaz.getByAnnoSett(anno, settimana, mod_navigaWeek1.showAllDip);
tabComm = DataProxy_ProjEts.DP.taSelCom.GetData(); // leggo tutte commesse...
tabCommShort = DataProxy_ProjEts.DP.taSelCom.getCommShort(anno, settimana); // leggo tutte commesse formato short (nickname...)
tabTE = DataProxy_ProjEts.DP.taTE.getByAnnoSett(anno, settimana, mod_navigaWeek1.showAllDip); // leggo timbrature settimanali
// calcolo il primo dip
idxDip = tabIR[0].idxDipendente;
// calcolo num celle totali
@@ -148,11 +152,12 @@ namespace PROJ_ETS.WebUserControls
}
catch (Exception exc)
{
lg.ErrorException("Errore in fase recupero dati: {0}", exc);
lg.Error($"Errore in fase recupero dati{Environment.NewLine}{exc}");
numDip = 0;
numComm = 0;
}
oreTotDip = new int[numDip];
oreTotTimbDip = new int[numDip];
oreTotComm = new int[numComm];
oreBgtTotDip = new int[numDip];
oreBgtTotComm = new int[numComm];
@@ -161,6 +166,7 @@ namespace PROJ_ETS.WebUserControls
for (int ii = 0; ii < numDip; ii++)
{
oreTotDip[ii] = 0;
oreTotTimbDip[ii] = 0;
oreBgtTotDip[ii] = 0;
}
for (int ii = 0; ii < numComm; ii++)
@@ -172,6 +178,27 @@ namespace PROJ_ETS.WebUserControls
{
// inizializzo i miei array...
TabellaRisorse = new ETS_Data.Type.ImpiegoRes[numDip, numComm];
// calcolo preliminarmente i dati timbrature x dipendente...
for (int pos_x = 0; pos_x < numDip; pos_x++)
{
try
{
idxDip = tabD2ATR[pos_x].idxDipendente;
//var righeDip= tabTE.Select($"idxDipendente={idxDip}").ToList();
var totOre = tabTE
.Where(x => x.idxDipendente == idxDip)
.Sum(x => x.h_lav);
oreTotTE = (int)totOre;
}
catch (Exception exc)
{
lg.Error($"Errore lettura dati TimbrExpl{Environment.NewLine}{exc}");
oreTotTE = 0;
}
oreTotTimbDip[pos_x] = oreTotTE;
}
// carico i dati nell'array: di default tutto VUOTO, con posizione attiva...
for (int pos_y = 0; pos_y < numComm; pos_y++)
{
@@ -183,39 +210,39 @@ namespace PROJ_ETS.WebUserControls
// carico valori x la singola cella
try
{
rigaDip = (Ds_ProjEts.DipendentiRow)tabDip.Select(string.Format("idxDipendente={0}", idxDip))[0];
rigaDip = (Ds_ProjEts.DipendentiRow)tabDip.Select($"idxDipendente={idxDip}")[0];
}
catch (Exception exc)
{
lg.ErrorException("Errore lettura dati Dip", exc);
lg.Error($"Errore lettura dati Dip {Environment.NewLine}{exc}");
}
try
{
rigaComm = (DS_utilsProjEts.v_selCommesseRow)tabComm.Select(string.Format("value = {0}", idxFase))[0];
rigaCommShort = (DS_utilsProjEts.v_selCommesseRow)tabCommShort.Select(string.Format("value = {0}", idxFase))[0];
rigaComm = (DS_utilsProjEts.v_selCommesseRow)tabComm.Select($"value = {idxFase}")[0];
rigaCommShort = (DS_utilsProjEts.v_selCommesseRow)tabCommShort.Select($"value = {idxFase}")[0];
}
catch (Exception exc)
{
lg.ErrorException("Errore lettura dati Comm", exc);
lg.Error($"Errore lettura dati Comm {Environment.NewLine}{exc}");
}
try
{
rigaIR = (Ds_ProjEts.ImpiegoRisorseRow)tabIR.Select(string.Format("idxDipendente={0} AND idxFase={1}", idxDip, idxFase))[0];
rigaIR = (Ds_ProjEts.ImpiegoRisorseRow)tabIR.Select($"idxDipendente={idxDip} AND idxFase={idxFase}")[0];
}
catch (Exception exc)
{
rigaIR = null;
// troppi falsi allarmi...
if (false) lg.ErrorException("Errore lettura dati IR", exc);
if (false) lg.Error($"Errore lettura dati IR {Environment.NewLine}{exc}");
}
try
{
rigaBaz = (Ds_ProjEts.BazaarRisorseRow)tabBaz.Select(string.Format("idxDipendente={0} AND idxFase={1}", idxDip, idxFase))[0];
rigaBaz = (Ds_ProjEts.BazaarRisorseRow)tabBaz.Select($"idxDipendente={idxDip} AND idxFase={idxFase}")[0];
}
catch (Exception exc)
{
rigaBaz = null;
lg.ErrorException("Errore lettura dati BAZ", exc);
lg.Error($"Errore lettura dati BAZ {Environment.NewLine}{exc}");
}
if (rigaBaz == null)
{
@@ -225,6 +252,7 @@ namespace PROJ_ETS.WebUserControls
{
oreTotBaz = rigaBaz.OreTot;
}
if (rigaIR == null)
{
css = "cTab cREmp";
@@ -254,7 +282,7 @@ namespace PROJ_ETS.WebUserControls
{
if (oreTotIR > 0)
{
label = string.Format("{0}/-", oreTotIR);
label = $"{oreTotIR}/-";
}
else
{
@@ -265,7 +293,7 @@ namespace PROJ_ETS.WebUserControls
{
if (oreTotIR + oreTotBaz > 0)
{
label = string.Format("{0}/{1}", oreTotIR, oreTotBaz);
label = $"{oreTotIR}/{oreTotBaz}";
}
else
{
@@ -280,9 +308,9 @@ namespace PROJ_ETS.WebUserControls
{
nomeComm = rigaCommShort.label.Substring(0, 9);
}
tooltip = string.Format("{2} / {0} {1}", rigaDip.Nome, rigaDip.Cognome, nomeComm);
TabellaRisorse[pos_x, pos_y] = new ETS_Data.Type.ImpiegoRes(label, tooltip, css, idxDip, string.Format("{0} {1}", rigaDip.Nome, rigaDip.Cognome), rigaDip.SIGLA, idxFase, oreTotIR, 0);
// aggiorno totali righe/colonne (comemsse/dip)
tooltip = $"{nomeComm} / {rigaDip.Nome} {rigaDip.Cognome}";
TabellaRisorse[pos_x, pos_y] = new ETS_Data.Type.ImpiegoRes(label, tooltip, css, idxDip, $"{ rigaDip.Nome} {rigaDip.Cognome}", rigaDip.SIGLA, idxFase, oreTotIR, 0);
// aggiorno totali righe/colonne (commesse/dip)
oreTotDip[pos_x] += oreTotIR;
oreTotComm[pos_y] += oreTotIR;
oreBgtTotDip[pos_x] += oreTotBaz;
@@ -422,7 +450,7 @@ namespace PROJ_ETS.WebUserControls
cell.CssClass = "cBia cCent";
if (showOre && numDip > 0 && numComm > 0)
{
cell.Text = string.Format("{0}/{1}", oreTotDip[pos_x], oreBgtTotDip[pos_x]);
cell.Text = $"[{oreTotDip[pos_x]}/{oreBgtTotDip[pos_x]}]<br/>({oreTotTimbDip[pos_x]})";
cell.ToolTip = "";
// SE sono 40h coloro di verde!!!
if (oreTotDip[pos_x] == 40)
@@ -1,41 +1,43 @@
//------------------------------------------------------------------------------
// <generato automaticamente>
// Codice generato da uno strumento.
// <auto-generated>
// This code was generated by a tool.
//
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
// il codice viene rigenerato.
// </generato automaticamente>
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace PROJ_ETS.WebUserControls {
public partial class mod_weekVerify {
namespace PROJ_ETS.WebUserControls
{
public partial class mod_weekVerify
{
/// <summary>
/// Controllo mod_navigaWeek1.
/// mod_navigaWeek1 control.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::PROJ_ETS.WebUserControls.mod_navigaWeek mod_navigaWeek1;
/// <summary>
/// Controllo tblBlocco.
/// tblBlocco control.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Table tblBlocco;
/// <summary>
/// Controllo lblRatioProgEff.
/// lblRatioProgEff control.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblRatioProgEff;
}
Binary file not shown.