@@ -69,36 +69,21 @@
-
+
+
Pianificazione settimanale
-
-
-button "+" x aggiungere progetti (x tutti i dipendenti "marcati" da dip2ATR)
-
-
- quando creo su "+" mostro un elenco progetti ATTIVI, potrebbe venire ordianto per
-
-
- - ore erogate last week/month
-
-
- - data di creazione desc
-
-
-
-
-
- deve peremttere ricerca e con "enter" dare l'ok ad inserire = creare 1 record "0" per ogni dip x quel progetto
-
ogni progetto inserito deve poter essere anche tolto (con conferma)
-
-
-
avrò una vista che fa "pivot" dei dati della sett/anno indicati, con
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs
index 6152533..d32ea55 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs
@@ -14,6 +14,21 @@ namespace PROJ_ETS.WebUserControls
/// evento nuovi valori caricati
///
public event EventHandler eh_newVal;
+ protected int numDip = 0;
+ protected int numComm = 0;
+ protected int IdxDipSel = 0;
+ protected int IdxFaseSel = 0;
+ protected ETS_Data.Type.BazaarRes[,] TabellaRisorse;
+ ///
+ /// istante corrente
+ ///
+ protected DateTime adesso
+ {
+ get
+ {
+ return DateTime.Now;
+ }
+ }
///
/// caricamento pagina
///
@@ -23,18 +38,323 @@ namespace PROJ_ETS.WebUserControls
{
if (!Page.IsPostBack)
{
- DateTime adesso = DateTime.Now;
ddlAnno.SelectedValue = adesso.Year.ToString();
ddlWeek.SelectedValue = (datario.WeekOfYearISO8601(adesso) + 1).ToString();
showPnlAddNewComm(false);
}
+ doUpdate();
+ }
+ ///
+ /// esegue update controllo
+ ///
+ public void doUpdate()
+ {
+ caricaDatiBlocco();
+ aggiornaCelleOccupate();
+ creaLabelTooltipCelle();
+ 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) + 1;
+ 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
+ Ds_ProjEts.BazaarRisorseDataTable tabBaz = new Ds_ProjEts.BazaarRisorseDataTable();
+ Ds_ProjEts.BazaarRisorseDataTable tabBazSingle = new Ds_ProjEts.BazaarRisorseDataTable();
+ Ds_ProjEts.DipendentiDataTable tabDip = new Ds_ProjEts.DipendentiDataTable();
+ Ds_ProjEts.BazaarRisorseRow rigaBaz;
+ try
+ {
+ // carico TUTTE le celle del bazaar...
+ tabBaz = DataProxy_ProjEts.DP.taBaz.getByAnnoSett(anno, settimana);
+ // 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
+ { }
+ if (numDip > 0 && numComm > 0)
+ {
+ // inizializzo il mio array...
+ TabellaRisorse = new ETS_Data.Type.BazaarRes[numDip, numComm];
+ // carico 2 array di valori: elenco dipendenti (raggruppato x tipo) ed elenco commesse...
+ tabDip = DataProxy_ProjEts.DP.taDip.GetData();
+ // 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}", tabDip[pos_x].idxDipendente, tabBazSingle[pos_y].idxFase))[0];
+ //TabellaRisorse[pos_x, pos_y] = new ETS_Data.Type.BazaarRes(rigaBaz.SchemaWeek, "LMMGV", "cellaLibera", rigaBaz.idxDipendente, rigaBaz.idxFase, rigaBaz.SchemaWeek, rigaBaz.OreTot);
+ }
+ }
+ }
+ }
+ ///
+ /// Aggiorna la mappa con le celle occupate
+ ///
+ private void aggiornaCelleOccupate()
+ {
+#if false
+ // carico il magazzino logico da visualizzare (oppure tutti...)
+ CodMagLogico = memLayer.ML.IntSessionObj("CodMagLogico_sel");
+ // carico altri dati da sessione
+ string ParticolareSel = memLayer.ML.StringSessionObj("Particolare_sel");
+ string DescStatoSel = memLayer.ML.StringSessionObj("DescStato_sel");
+ string EsponenteSel = memLayer.ML.StringSessionObj("Esponente_sel");
+ // ottengo elenco dettaglio UDC che occupano il blocco...
+ DS_magazzino.v_UdcDetailDataTable tabUdc = MagClass.magazzino.taDettUDC.getUdcDetailByIdxBlocco(IdxBlocco);
+ // SE è filtrato x mag logico utilizza altro metodo...
+ if (CodMagLogico != -1)
+ {
+ tabUdc = MagClass.magazzino.taDettUDC.getByIdxBloccoCodMagLog(IdxBlocco, CodMagLogico);
+ }
+ // controllo se sia un magazzino mono o multicella...
+ bool multicella = MagClass.magazzino.taCelle.getByIdxBlocco(IdxBlocco).Rows.Count > 1;
+ // SE ci sono righe aggiorno il blocco...
+ if (tabUdc.Rows.Count > 0)
+ {
+ // ...sovrascrivo valori di default
+ foreach (DS_magazzino.v_UdcDetailRow riga in tabUdc)
+ {
+ // salvo che ho 1 UDC in + nella cella...
+ TabellaRisorse[riga.X - 1, riga.Y - 1].NumUdc++;
+ // controllo se nella cella ci sia il particolare selezionato...
+ if (ParticolareSel == riga.Particolare && multicella)
+ {
+ // controllo se sia anche lo specifico esponente/stato
+ if (DescStatoSel == riga.DescStato && EsponenteSel == riga.Esponente)
+ {
+ TabellaRisorse[riga.X - 1, riga.Y - 1].Css = "cellaSelezDett";
+ }
+ else
+ {
+ TabellaRisorse[riga.X - 1, riga.Y - 1].Css = "cellaSelezAll";
+ }
+ }
+ else
+ {
+ // se NON C'E' alcun particolare selezionato ... controllo il blocco!
+ if (TabellaRisorse[riga.X - 1, riga.Y - 1].Piena)
+ {
+ TabellaRisorse[riga.X - 1, riga.Y - 1].Css = "cellaPiena";
+ }
+ else
+ {
+ TabellaRisorse[riga.X - 1, riga.Y - 1].Css = "cellaOccupata";
+ }
+ }
+ TabellaRisorse[riga.X - 1, riga.Y - 1].ToolTip += string.Format("{2} - {0} {1:#}pz{3}", riga.UDC, riga.Qta, riga.Particolare, Environment.NewLine);
+ }
+ }
+#endif
+ }
+ ///
+ /// Aggiorna la mappa celle x label e tooltip
+ ///
+ private void creaLabelTooltipCelle()
+ {
+#if false
+ // ...in base al setup mostro anche il disponibile o meno...
+ string formato = "";
+ if (memLayer.ML.confReadBool("showSizeCellaInDettMag"))
+ {
+ formato = "{0}
{1}";
+ }
+ else
+ {
+ formato = "{0}";
+ }
+ // faccio ciclo x ogni oggetto blocco..
+ for (int pos_y = 0; pos_y < numY; pos_y++)
+ {
+ for (int pos_x = 0; pos_x < numX; pos_x++)
+ {
+ // calcolo la capacità della cella... e mostro secondo formato definito prima
+ TabellaRisorse[pos_x, pos_y].Label = string.Format(formato, TabellaRisorse[pos_x, pos_y].NumUdc, TabellaRisorse[pos_x, pos_y].Capacita);
+ // se è attiva = 0 aggiorno label
+ if (!TabellaRisorse[pos_x, pos_y].Attiva)
+ {
+ TabellaRisorse[pos_x, pos_y].Css = "cellaInattiva";
+ //TabellaRisorse[pos_x, pos_y].Label = string.Format("[{0}]", TabellaRisorse[pos_x, pos_y].Label);
+ // ... e tooltip
+ TabellaRisorse[pos_x, pos_y].ToolTip = string.Format("{0}{1}{2}", traduci("CellaInattiva"), Environment.NewLine, TabellaRisorse[pos_x, pos_y].ToolTip);
+ }
+ }
+ }
+#endif
+ }
+
+ ///
+ /// 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);
+ // celle con numeri
+ for (int pos_x = 0; pos_x < numDip; pos_x++)
+ {
+ cell = new TableCell();
+ cell.CssClass = "cellaBianca";
+ cell.Text = string.Format("{0:0#}", pos_x + 1);
+ cell.ToolTip = "";
+ 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
+ ///
+ ///
+ ///
+ ///
+ private static TableCell setupCellaConteggioY(int pos_y, TableRow riga)
+ {
+ TableCell cell;
+ cell = new TableCell();
+ cell.CssClass = "cellaBianca";
+ cell.Text = string.Format("{0:0#}", pos_y + 1);
+ cell.ToolTip = "";
+ riga.Cells.Add(cell);
+ return cell;
+ }
+ ///
+ /// intercetta richiesta di zoom e zoomma sull'Udc in esame...
+ ///
+ ///
+ ///
+ void lnkb_Click(object sender, EventArgs e)
+ {
+ LinkButton lnk = (LinkButton)sender;
+ // calcolo i parametri passati
+#if false
+ string[] valori = SteamWare.StringSplitter.CSplitter.Split(lnk.CommandArgument.ToString(), "#", true, 2, SteamWare.StringSplitter.ComparisonMethod.Text);
+ // setto i valori in sessione
+ IdxCella = Convert.ToInt32(valori[0]);
+ memLayer.ML.setSessionVal("IdxCellaMag", valori[0], false);
+ memLayer.ML.setSessionVal("CodCellaMag", valori[1], false);
+
+ // evento selezione che passa dati al modulo operazioniUdc
+ if (eh_selValore != null)
+ {
+ eh_selValore(this, new EventArgs());
+ }
+ Response.Redirect("~/DettaglioBlocco.aspx");
+#endif
+ }
+ ///
+ /// 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 = setupCellaConteggioY(pos_y, riga);
+ 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;
+ lnkb.Click += new EventHandler(lnkb_Click);
+ lnkb.CommandArgument = string.Format("{0}#{1}", TabellaRisorse[pos_x, pos_y].IdxDipendente, TabellaRisorse[pos_x, pos_y].IdxFase);
+ // 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 = "selectedCell";
+ btnReset.Visible = true;
+ }
+ cell.Controls.Add(lnkb);
+ // carico in cella di tabella il linkButton
+ riga.Cells.Add(cell);
+ }
+ cell = setupCellaConteggioY(pos_y, riga);
+ tblBlocco.Rows.Add(riga);
+ }
+ // metto ultima riga con indicazione valori NUMERICI del totale ore x dipendente
+ setupRigaDip(true);
+ }
+
+ ///
+ /// gestione visualizzaizone pannello elenco commesse da inserire
+ ///
+ ///
+ ///
protected void btnAddNew_Click(object sender, EventArgs e)
{
showPnlAddNewComm(!pnlAddNew.Visible);
}
-
+ ///
+ /// controllo visibilità pannello
+ ///
+ ///
private void showPnlAddNewComm(bool showPnlNew)
{
pnlAddNew.Visible = showPnlNew;
@@ -125,5 +445,19 @@ namespace PROJ_ETS.WebUserControls
eh_newVal(this, new EventArgs());
}
}
+
+ ///
+ /// resetta disegno
+ ///
+ ///
+ ///
+ protected void btnReset_Click(object sender, EventArgs e)
+ {
+#if false
+ memLayer.ML.emptySessionVal("IdxCellaMag");
+ memLayer.ML.emptySessionVal("CodCellaMag");
+ Response.Redirect("~/DettaglioBlocco.aspx");
+#endif
+ }
}
}
\ No newline at end of file
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs
index 5240eae..4cba358 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs
@@ -110,5 +110,23 @@ namespace PROJ_ETS.WebUserControls {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.Button btnAddSelected;
+
+ ///
+ /// 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;
+
+ ///
+ /// btnReset control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnReset;
}
}
diff --git a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll
index 4159a47..b09c27d 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 b578ad7..a14197d 100644
Binary files a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll and b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll differ