+
@@ -73,8 +73,7 @@
- con checkbox x selezione multipla
-
+
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs
index 7f80e33..b0210fd 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs
@@ -293,7 +293,8 @@ namespace PROJ_ETS.WebUserControls
else
{
rigaDip = (Ds_ProjEts.DipendentiRow)tabDip.Select(string.Format("idxDipendente={0}", tabD2ATR[pos_x].idxDipendente))[0];
- cell.Text = rigaDip.SIGLA;
+ //cell.Text = rigaDip.SIGLA;
+ cell.Text = rigaDip.Nome.Substring(0, 1) + rigaDip.Cognome.Substring(0, 1) + rigaDip.Cognome.Substring(1, 2).ToLower();
cell.ToolTip = string.Format("{0} {1}", rigaDip.Nome, rigaDip.Cognome);
}
riga.Cells.Add(cell);
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx
new file mode 100644
index 0000000..4fe9abc
--- /dev/null
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx
@@ -0,0 +1,33 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_weekRA.ascx.cs" Inherits="PROJ_ETS.WebUserControls.mod_weekRA" %>
+
+
+
+
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.cs
new file mode 100644
index 0000000..3e72eab
--- /dev/null
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.cs
@@ -0,0 +1,422 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using ETS_Data;
+
+namespace PROJ_ETS.WebUserControls
+{
+ public partial class mod_weekRA : System.Web.UI.UserControl
+ {
+ ///
+ /// evento nuovi valori caricati
+ ///
+ public event EventHandler eh_newVal;
+ protected int numDip = 0;
+ protected int numComm = 0;
+ protected int IdxDipSel
+ {
+ get
+ {
+ int answ = 0;
+ try
+ {
+ answ = utils.obj.IntSessionObj("IdxDipSel");
+ }
+ catch
+ { }
+ return answ;
+ }
+ set
+ {
+ utils.obj.setSessionVal("IdxDipSel", value);
+ }
+ }
+ protected int IdxFaseSel
+ {
+ get
+ {
+ int answ = 0;
+ try
+ {
+ answ = utils.obj.IntSessionObj("IdxFaseSel");
+ }
+ catch
+ { }
+ return answ;
+ }
+ set
+ {
+ utils.obj.setSessionVal("IdxFaseSel", value);
+ }
+ }
+ protected ETS_Data.Type.BazaarRes[,] TabellaRisorse;
+ protected int[] oreTotDip;
+ protected int[] oreTotComm;
+ protected Ds_ProjEts.DipendentiDataTable tabDip = new Ds_ProjEts.DipendentiDataTable();
+ protected Ds_ProjEts.Dip2ATRDataTable tabD2ATR = new Ds_ProjEts.Dip2ATRDataTable();
+ protected Ds_ProjEts.BazaarRisorseDataTable tabBaz = new Ds_ProjEts.BazaarRisorseDataTable();
+ protected Ds_ProjEts.BazaarRisorseDataTable tabBazSingle = new Ds_ProjEts.BazaarRisorseDataTable();
+ protected DS_utilsProjEts.v_selCommesseDataTable tabComm = new DS_utilsProjEts.v_selCommesseDataTable();
+ protected Ds_ProjEts.BazaarRisorseRow rigaBaz;
+ protected Ds_ProjEts.DipendentiRow rigaDip;
+ protected DS_utilsProjEts.v_selCommesseRow rigaComm;
+ ///
+ /// istante corrente
+ ///
+ protected DateTime adesso
+ {
+ set
+ {
+ utils.obj.setSessionVal("timeBazaar", value);
+ }
+ get
+ {
+ DateTime answ = DateTime.Now;
+ try
+ {
+ answ = (DateTime)utils.obj.objSessionObj("timeBazaar");
+ }
+ catch
+ { }
+ return answ;
+ }
+ }
+ ///
+ /// caricamento pagina
+ ///
+ ///
+ ///
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ setDdlPeriodo();
+ //importo sett corrente
+ lnkW.Text = string.Format("W{0:0#}", datario.WeekOfYearISO8601(DateTime.Now));
+ }
+ // carico tabelle: elenco dipendenti (raggruppato x tipo) ed elenco dip in bazaar...
+ tabDip = DataProxy_ProjEts.DP.taDip.GetData();
+ tabD2ATR = DataProxy_ProjEts.DP.taD2ATR.getBazOrd();
+ // faccio udpate!
+ doUpdate();
+ }
+ ///
+ /// imposta DDL del periodo
+ ///
+ private void setDdlPeriodo()
+ {
+ ddlAnno.SelectedValue = adesso.Year.ToString();
+ ddlWeek.SelectedValue = (datario.WeekOfYearISO8601(adesso)).ToString();
+ }
+ ///
+ /// esegue update controllo
+ ///
+ public void doUpdate()
+ {
+ caricaDatiBlocco();
+ disegnaTabella();
+ }
+ ///
+ /// anno selezionato
+ ///
+ protected int anno
+ {
+ get
+ {
+ int answ = adesso.Year;
+ try
+ {
+ answ = Convert.ToInt32(ddlAnno.SelectedValue);
+ }
+ catch
+ { }
+ return answ;
+ }
+ }
+ ///
+ /// settimana selezionato
+ ///
+ protected int settimana
+ {
+ get
+ {
+ int answ = datario.WeekOfYearISO8601(adesso);
+ try
+ {
+ answ = Convert.ToInt32(ddlWeek.SelectedValue);
+ }
+ catch
+ { }
+ return answ;
+ }
+ }
+
+ ///
+ /// carica i dati del blocco in un oggetto BlockMap (compreso attive/inattive)
+ ///
+ private void caricaDatiBlocco()
+ {
+ int totCelle = 0;
+ int idxDip = 0;
+ // recupero il numero di TUTTE le celle
+ string css = "";
+ string tooltip = "";
+ try
+ {
+ // carico TUTTE le celle del bazaar...
+ tabBaz = DataProxy_ProjEts.DP.taBaz.getByAnnoSett(anno, settimana);
+ tabComm = DataProxy_ProjEts.DP.taSelCom.getAttiveBySearchLike("%"); // leggo tutte commesse attive...
+ // calcolo il primo dip
+ idxDip = tabBaz[0].idxDipendente;
+ // calcolo num celel totali
+ totCelle = tabBaz.Rows.Count;
+ // calcolo numero commesse!
+ tabBazSingle = DataProxy_ProjEts.DP.taBaz.getByAnnoSettDip(anno, settimana, idxDip);
+ numComm = tabBazSingle.Rows.Count;
+ // calcolo num commesse!
+ numDip = totCelle / numComm;
+ }
+ catch
+ {
+ numDip = 0;
+ numComm = 0;
+ }
+ if (numDip > 0 && numComm > 0)
+ {
+ // inizializzo i miei array...
+ TabellaRisorse = new ETS_Data.Type.BazaarRes[numDip, numComm];
+ oreTotDip = new int[numDip];
+ oreTotComm = new int[numComm];
+ // carico i dati nell'array: di default tutto VUOTO, con posizione attiva...
+ for (int pos_y = 0; pos_y < numComm; pos_y++)
+ {
+ for (int pos_x = 0; pos_x < numDip; pos_x++)
+ {
+ // carico valori x la singola cella
+ rigaBaz = (Ds_ProjEts.BazaarRisorseRow)tabBaz.Select(string.Format("idxDipendente={0} AND idxFase={1}", tabD2ATR[pos_x].idxDipendente, tabBazSingle[pos_y].idxFase))[0];
+ rigaDip = (Ds_ProjEts.DipendentiRow)tabDip.Select(string.Format("idxDipendente={0}", tabD2ATR[pos_x].idxDipendente))[0];
+ rigaComm = (DS_utilsProjEts.v_selCommesseRow)tabComm.Select(string.Format("value = {0}", tabBazSingle[pos_y].idxFase))[0];
+ if (rigaBaz.OreTot == 0)
+ {
+ css = "cTab cEmp";
+ }
+ else if (rigaBaz.OreTot < utils.obj.confReadInt("soglia1"))
+ {
+ css = "cTab cS01";
+ }
+ else if (rigaBaz.OreTot < utils.obj.confReadInt("soglia2"))
+ {
+ css = "cTab cS02";
+ }
+ else if (rigaBaz.OreTot < utils.obj.confReadInt("soglia3"))
+ {
+ css = "cTab cS03";
+ }
+ else if (rigaBaz.OreTot < utils.obj.confReadInt("soglia4"))
+ {
+ css = "cTab cS04";
+ }
+ else
+ {
+ css = "cTab cOvr";
+ }
+ tooltip = string.Format("{2} / {0} {1}", rigaDip.Nome, rigaDip.Cognome, rigaComm.label.Substring(0, 9));
+ TabellaRisorse[pos_x, pos_y] = new ETS_Data.Type.BazaarRes(rigaBaz.SchemaWeek, tooltip, css, rigaBaz.idxDipendente, string.Format("{0} {1}", rigaDip.Nome, rigaDip.Cognome), rigaDip.SIGLA, rigaBaz.idxFase, rigaBaz.SchemaWeek, rigaBaz.OreTot);
+ // aggiorno totali righe/colonne (comemsse/dip)
+ oreTotDip[pos_x] += rigaBaz.OreTot;
+ oreTotComm[pos_y] += rigaBaz.OreTot;
+ }
+ }
+ }
+ }
+ ///
+ /// disegna la riga di intestazione/chiusura x dipendenti
+ ///
+ ///
true = mostra totale ore / false = mostra sigla dip + nome/cognome tooltip
+ private void setupRigaDip(bool showOre)
+ {
+ TableRow riga = new TableRow();
+ TableCell cell;
+ // cella vuota iniziale
+ cell = new TableCell();
+ riga.Cells.Add(cell);
+ // variabili accessorie x dip
+ Ds_ProjEts.DipendentiRow rigaDip;
+ // preparo celle!
+ for (int pos_x = 0; pos_x < numDip; pos_x++)
+ {
+ cell = new TableCell();
+ cell.CssClass = "cBia";
+ if (showOre)
+ {
+ cell.Text = string.Format("{0:0#} h", oreTotDip[pos_x]);
+ cell.ToolTip = "";
+ // SE sono oltre 40h coloro di rosso!!!
+ if (oreTotDip[pos_x] > 40)
+ {
+ cell.CssClass = "cBia lblErrore";
+ }
+ }
+ else
+ {
+ rigaDip = (Ds_ProjEts.DipendentiRow)tabDip.Select(string.Format("idxDipendente={0}", tabD2ATR[pos_x].idxDipendente))[0];
+ //cell.Text = rigaDip.SIGLA;
+ cell.Text = rigaDip.Nome.Substring(0, 1) + rigaDip.Cognome.Substring(0, 1) + rigaDip.Cognome.Substring(1, 2).ToLower();
+ cell.ToolTip = string.Format("{0} {1}", rigaDip.Nome, rigaDip.Cognome);
+ }
+ riga.Cells.Add(cell);
+ }
+ // cella vuota finale
+ cell = new TableCell();
+ riga.Cells.Add(cell);
+ // aggiungo riga!
+ tblBlocco.Rows.Add(riga);
+ }
+ ///
+ /// crea una cella per il numero dei livelli
+ ///
+ ///
+ ///
+ ///
indica se mostrare le ore totali di resoconto al posto del nome commessa
+ ///
+ private TableCell setupCellaComm(int pos_y, TableRow riga, bool showOre)
+ {
+ // variabili accessorie x dip
+ DS_utilsProjEts.v_selCommesseRow rigaComm;
+ //cella!
+ TableCell cell;
+ cell = new TableCell();
+ cell.CssClass = "cBia";
+ rigaComm = (DS_utilsProjEts.v_selCommesseRow)tabComm.Select(string.Format("value = {0}", tabBazSingle[pos_y].idxFase))[0];
+ if (showOre)
+ {
+ // aggiungo button x fare elemento cliccabile
+ LinkButton lnkbDel = new LinkButton();
+ // controllo se CUD è abilitato
+ lnkbDel.Text = string.Format("{0:0##} h", oreTotComm[pos_y]);
+ lnkbDel.ToolTip = string.Format("Commessa {0} (non modificabile)", rigaComm.label.Substring(0, 9));
+ lnkbDel.Enabled = false;
+ cell.Controls.Add(lnkbDel);
+ }
+ else
+ {
+ cell.Text = rigaComm.label.Substring(0, 9);
+ cell.ToolTip = rigaComm.label;
+ }
+ riga.Cells.Add(cell);
+ return cell;
+ }
+ ///
+ /// esegue il vero plotting della tabella
+ ///
+ private void disegnaTabella()
+ {
+ bool tabPresente = tblBlocco.Rows.Count > 0;
+ if (tabPresente)
+ {
+ tblBlocco.Rows.Clear();
+ }
+ // metto prima riga con indicazione valori NUMERICI delle colonne
+ setupRigaDip(false);
+ // ciclo nel mio array e creo di conseguenza le celle di tabella
+ for (int pos_y = numComm - 1; pos_y >= 0; pos_y--)
+ {
+ TableRow riga = new TableRow();
+ TableCell cell;
+ // cella con numero livello
+ cell = setupCellaComm(pos_y, riga, false);
+ for (int pos_x = 0; pos_x < numDip; pos_x++)
+ {
+ cell = new TableCell();
+ cell.CssClass = TabellaRisorse[pos_x, pos_y].Css;
+ // aggiungo button x fare elemento cliccabile
+ LinkButton lnkb = new LinkButton();
+ lnkb.ToolTip = TabellaRisorse[pos_x, pos_y].ToolTip;
+ lnkb.Text = TabellaRisorse[pos_x, pos_y].Label;
+#if false
+ lnkb.CssClass = "openDiag"; // server x far si ceh apra il dialog modale...
+ // controllo se CUD è abilitato
+ if (cudEnabled)
+ {
+ lnkb.Click += new EventHandler(lnkb_Click);
+ lnkb.CommandArgument = string.Format("{0}#{1}", TabellaRisorse[pos_x, pos_y].IdxDipendente, TabellaRisorse[pos_x, pos_y].IdxFase);
+ }
+ lnkb.Enabled = cudEnabled;
+#endif
+ // controllo se la cella è selezionata, nel caso BOLD!
+ if (TabellaRisorse[pos_x, pos_y].IdxDipendente == IdxDipSel && TabellaRisorse[pos_x, pos_y].IdxFase == IdxFaseSel)
+ {
+ cell.CssClass = "selCel";
+ }
+ cell.Controls.Add(lnkb);
+ // carico in cella di tabella il linkButton
+ riga.Cells.Add(cell);
+ }
+ cell = setupCellaComm(pos_y, riga, true);
+ tblBlocco.Rows.Add(riga);
+ }
+ // metto ultima riga con indicazione valori NUMERICI del totale ore x dipendente
+ setupRigaDip(true);
+ }
+
+ ///
+ /// trimma una stringa per il num max di caratteri richiesti
+ ///
+ ///
+ ///
+ public string trimChar(object stringaIn, object maxChar)
+ {
+ string answ = "";
+ int maxNum = 0;
+ try
+ {
+ answ = stringaIn.ToString();
+ maxNum = Convert.ToInt32(maxChar);
+ }
+ catch
+ { }
+ if (maxNum < answ.Length)
+ {
+ answ = answ.Substring(0, maxNum) + "...";
+ }
+ return answ;
+ }
+
+ protected void ddlAnno_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ doUpdate();
+ }
+
+ protected void ddlWeek_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ doUpdate();
+ }
+ ///
+ /// effettua selezione periodo rapida: 0 = corrente (ovvero la PROSSIMA), +1 = successiva (a seleizonata), -1 = precedente (a selezionata)
+ ///
+ ///
+ ///
+ protected void lnkW_Click(object sender, EventArgs e)
+ {
+ // sposto!
+ LinkButton lnk = (LinkButton)sender;
+ if (lnk.CommandArgument == "Curr")
+ {
+ adesso = DateTime.Now;
+ }
+ else if (lnk.CommandArgument == "Prev")
+ {
+ adesso = adesso.AddDays(-7);
+ }
+ else if (lnk.CommandArgument == "Next")
+ {
+ adesso = adesso.AddDays(7);
+ }
+ setDdlPeriodo();
+ doUpdate();
+ }
+ }
+}
\ No newline at end of file
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.designer.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.designer.cs
new file mode 100644
index 0000000..039b39c
--- /dev/null
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekRA.ascx.designer.cs
@@ -0,0 +1,87 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// 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_weekRA {
+
+ ///
+ /// ddlAnno control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddlAnno;
+
+ ///
+ /// odsYear control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.ObjectDataSource odsYear;
+
+ ///
+ /// ddlWeek control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddlWeek;
+
+ ///
+ /// odsWeek control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.ObjectDataSource odsWeek;
+
+ ///
+ /// lnkWPrev control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton lnkWPrev;
+
+ ///
+ /// lnkW control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton lnkW;
+
+ ///
+ /// lnkWNext control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton lnkWNext;
+
+ ///
+ /// tblBlocco control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Table tblBlocco;
+ }
+}
diff --git a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll
index 00ee4b5..14d045f 100644
Binary files a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll and b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll differ
diff --git a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll
index 0c7ef31..f74ecc6 100644
Binary files a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll and b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll differ