diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx index 4f89973..4ce47a1 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx @@ -9,15 +9,12 @@ - -
-

Legenda

- Ore Effettive / Ore programmate - <%--

- indice rendimento: +
+

Legenda Ore

+ [Effettive / Programmate]
- --%> + (Timbrate)
@@ -27,4 +24,4 @@
-
+
\ No newline at end of file diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx.cs index abe19ff..dbcb6e5 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx.cs +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx.cs @@ -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]}]
({oreTotTimbDip[pos_x]})"; cell.ToolTip = ""; // SE sono 40h coloro di verde!!! if (oreTotDip[pos_x] == 40) diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx.designer.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx.designer.cs index ca91d0a..111c321 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx.designer.cs +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekVerify.ascx.designer.cs @@ -1,41 +1,43 @@ //------------------------------------------------------------------------------ -// -// Codice generato da uno strumento. +// +// 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. -// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// //------------------------------------------------------------------------------ -namespace PROJ_ETS.WebUserControls { - - - public partial class mod_weekVerify { - +namespace PROJ_ETS.WebUserControls +{ + + + public partial class mod_weekVerify + { + /// - /// Controllo mod_navigaWeek1. + /// mod_navigaWeek1 control. /// /// - /// 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. /// protected global::PROJ_ETS.WebUserControls.mod_navigaWeek mod_navigaWeek1; - + /// - /// Controllo tblBlocco. + /// tblBlocco control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.Table tblBlocco; - + /// - /// Controllo lblRatioProgEff. + /// lblRatioProgEff control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.Label lblRatioProgEff; } diff --git a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll index 4147354..63ce2d4 100644 Binary files a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll and b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll differ