-
-
-
elenco fasi:
-
+
+
+
+
+
+
Dati Commessa:
diff --git a/PROJ-ETS/PROJ-ETS/Progetti.aspx.cs b/PROJ-ETS/PROJ-ETS/Progetti.aspx.cs
index 5b89914..2d857bf 100644
--- a/PROJ-ETS/PROJ-ETS/Progetti.aspx.cs
+++ b/PROJ-ETS/PROJ-ETS/Progetti.aspx.cs
@@ -11,7 +11,26 @@ namespace PROJ_ETS
{
protected void Page_Load(object sender, EventArgs e)
{
-
+ mod_progetti1.eh_selValore +=mod_progetti1_eh_selValore;
+ mod_progetti1.eh_resetSelezione+=mod_progetti1_eh_resetSelezione;
+ }
+ ///
+ /// reset selezione: nascondo dettaglio!
+ ///
+ ///
+ ///
+ private void mod_progetti1_eh_resetSelezione(object sender, EventArgs e)
+ {
+ mod_commesse1.Visible = false;
+ }
+ ///
+ /// selezionato progetto: mostro commesse + fasi associate!
+ ///
+ ///
+ ///
+ private void mod_progetti1_eh_selValore(object sender, EventArgs e)
+ {
+ mod_commesse1.Visible = true;
}
}
}
\ No newline at end of file
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx
index 3264b39..f49eac1 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx
@@ -1,2 +1,219 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_commesse.ascx.cs" Inherits="PROJ_ETS.WebUserControls.mod_commesse" %>
-Spostamento commesse
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%----%>
+
+
+
+ <%----%>
+
+
+
+ <%----%>
+
+
+
+
+
+ <%----%>
+
+
+
+ <%----%>
+
+
+
+ <%----%>
+
+
+
+
+
+
+
+ /
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.cs
index a232cf6..8cc15e5 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.cs
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.cs
@@ -1,17 +1,507 @@
using System;
using System.Collections.Generic;
+using System.Data;
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_commesse : System.Web.UI.UserControl
- {
- protected void Page_Load(object sender, EventArgs e)
- {
+ public partial class mod_commesse : System.Web.UI.UserControl
+ {
- }
- }
+ #region area standard (non modificare)
+
+ #region gestione eventi
+
+ public event EventHandler eh_resetSelezione;
+ public event EventHandler eh_nuovoValore;
+
+ #endregion
+
+
+ ///
+ /// reset della selezione
+ ///
+ ///
+ ///
+ protected void btnReset_Click(object sender, EventArgs e)
+ {
+ resetSelezione();
+ }
+ ///
+ /// inserisce nuovo valore da footer
+ ///
+ ///
+ ///
+ protected void lblIns_click(object sender, EventArgs e)
+ {
+ // click su inserimento, chiamo il metodo insert dell'ObjectDataSource
+ ods.Insert();
+ }
+ ///
+ /// annulla inserimento nuovo valore da footer
+ ///
+ ///
+ ///
+ protected void lblCanc_click(object sender, EventArgs e)
+ {
+ // annullo inserimento: nascondo footer, bind controlli...
+ grView.FooterRow.Visible = false;
+ }
+ ///
+ /// traduce gli header delle colonne
+ ///
+ ///
+ ///
+ protected void grView_DataBound(object sender, EventArgs e)
+ {
+ if (grView.Rows.Count > 0)
+ {
+ int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
+ lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
+ }
+ else
+ {
+ lblNumRec.Text = "";
+ }
+ }
+
+ #endregion
+
+ #region area CUSTOM (da modificare)
+
+ #region gestione eventi
+
+ public event EventHandler eh_faseSel;
+
+ #endregion
+
+ ///
+ /// uid base
+ ///
+ protected string sessionUid
+ {
+ get
+ {
+ return this.UniqueID.Replace("$", "-");
+ }
+ }
+
+ ///
+ /// idx del cliente selezionato
+ ///
+ public int idxCliente
+ {
+ get
+ {
+ return utils.obj.IntSessionObj(string.Format("idxCli_{0}", sessionUid));
+ }
+ set
+ {
+ utils.obj.setSessionVal(string.Format("idxCli_{0}", sessionUid), value);
+ }
+ }
+ ///
+ /// idx del progetto selezionato
+ ///
+ public int idxProgetto
+ {
+ get
+ {
+ return utils.obj.IntSessionObj(string.Format("idxProj_{0}", sessionUid));
+ }
+ set
+ {
+ utils.obj.setSessionVal(string.Format("idxProj_{0}", sessionUid), value);
+ }
+ }
+ ///
+ /// valore della fase selezionata
+ ///
+ public int idxFase
+ {
+ get
+ {
+ int answ = 0;
+ if (grView.SelectedIndex >= 0)
+ {
+ try
+ {
+ answ = Convert.ToInt32(grView.SelectedValue);
+ }
+ catch
+ { }
+ }
+ return answ;
+ }
+ }
+ ///
+ /// pagina corrente (URL finale)
+ ///
+ public string _paginaCorrente { get; set; }
+ ///
+ /// caricamento
+ ///
+ ///
+ ///
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ PagCorrente();
+ }
+ setDetVisibility();
+ }
+ ///
+ /// salva in variabile pagina il nome della pagina corrente
+ ///
+ protected void PagCorrente()
+ {
+ Uri MyUrl = Request.Url;
+ string delimStr = "/";
+ char[] delimiter = delimStr.ToCharArray();
+ string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
+ int n = finalUrl.Length;
+ _paginaCorrente = finalUrl[n - 1].ToString();
+ }
+ ///
+ /// sistema visibilità area dettaglio RA
+ ///
+ private void setDetVisibility()
+ {
+ pnlDetRA.Visible = enableShowRA;
+ lblDet.Visible = (grView.SelectedIndex >= 0);
+ }
+
+ ///
+ /// recupera i dati di un nuovo record contenuti nel footer di un gridView;
+ /// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
+ ///
+ ///
+ ///
+ protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
+ {
+ //recupero la riga footer...
+ DataColumnCollection colonne = colonneObj();
+ string nomeCol;
+ string tipoColonna = "";
+ foreach (DataColumn colonna in colonne)
+ {
+ nomeCol = colonna.ColumnName;
+ // cerco un textbox o quello che sia...
+ if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
+ {
+ tipoColonna = "textBox";
+ }
+ else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
+ {
+ tipoColonna = "dropDownList";
+ }
+ else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
+ {
+ tipoColonna = "checkBox";
+ }
+ // in base al tipo salvo negli inputparameters dell'ODS
+ switch (tipoColonna)
+ {
+ case "textBox":
+ e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
+ break;
+ case "dropDownList":
+ e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
+ break;
+ case "checkBox":
+ e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
+ break;
+ default:
+ break;
+ }
+ tipoColonna = "";
+ }
+ //// aggiungo fase ancestor!
+ //e.InputParameters["idxFaseAncest"] = utils.obj.IntSessionObj("idxFaseAncest");
+ // aggiungo progetto!
+ e.InputParameters["idxProgetto"] = idxProgetto;
+
+ }
+ ///
+ /// gestione evento richiesta nuovo valore (mostra footer, ...)
+ ///
+ ///
+ ///
+ protected void btnNew_Click(object sender, EventArgs e)
+ {
+ // controllo se c'è un argument x la fase...
+ string idxFaseAncest = "0";
+ try
+ {
+ idxFaseAncest = ((ImageButton)sender).CommandArgument;
+ }
+ catch
+ { }
+ utils.obj.setSessionVal("idxFaseAncest", idxFaseAncest);
+ if (idxFaseAncest == "0")
+ {
+ // reset selezione...
+ resetSelezione();
+ }
+ // mostro il footer oppure la riga dei dettagli x nuovo...
+ if (grView.FooterRow != null)
+ {
+ grView.FooterRow.Visible = true;
+ }
+ // sollevo evento nuovo valore...
+ if (eh_nuovoValore != null)
+ {
+ eh_nuovoValore(this, new EventArgs());
+ }
+ }
+ ///
+ /// gestione evento richiesta nuovo valore QUANDO NON CI SIANO RECORDS!
+ ///
+ ///
+ ///
+ protected void btnNewEmpty_Click(object sender, EventArgs e)
+ {
+ utils.obj.setSessionVal("idxFaseAncest", "0");
+#if false
+ DataProxy.DP.taAF.insertQuery(idxProgetto, 0, "NuovaFase", "DescrizioneFase", false, false, 0, 0, true);
+#endif
+ grView.DataBind();
+ // sollevo evento nuovo valore...
+ if (eh_nuovoValore != null)
+ {
+ eh_nuovoValore(this, new EventArgs());
+ }
+ }
+ ///
+ /// elenco colonne del datagrid
+ ///
+ ///
+ protected DataColumnCollection colonneObj()
+ {
+ Ds_ProjEts.AnagFasiDataTable tabella = new Ds_ProjEts.AnagFasiDataTable();
+ DataColumnCollection colonne = tabella.Columns;
+ return colonne;
+ }
+ ///
+ /// determina se sia eliminabile il record (=non usato)
+ ///
+ ///
+ ///
+ public bool delEnabled(object idxObj)
+ {
+ bool answ = isWritable();
+ // solo se ha diritti scrittura controllo
+ if (answ)
+ {
+ int trovati = 0;
+ // !!!FARE!!!
+#if false
+ // controllo se ci siano tipo celle associate
+ trovati = MagClass.magazzino.taTipoCella.getByCodMag(utils.obj.StringSessionObj("CodCS"), idxObj.ToString()).Rows.Count;
+ // controllo se ci siano blocchi associati
+ trovati = trovati + MagClass.magazzino.taBlocchi.getByCodMag(utils.obj.StringSessionObj("CodCS"), idxObj.ToString()).Rows.Count;
+#endif
+ // controllo se ci sono record correlati...
+ if (trovati > 0)
+ {
+ answ = false;
+ }
+ }
+ return answ;
+ }
+ ///
+ /// calcola classe css dato codice fase
+ ///
+ ///
+ ///
+ public string classByCod(object codFase)
+ {
+ string answ = "";
+ int livello = 0;
+ // calcolo livello come num punti "." -1...
+ try
+ {
+ string[] array = codFase.ToString().Split('.');
+ livello = array.Length;
+ }
+ catch
+ { }
+ if (livello < 4)
+ {
+ answ = "fontNormale textNero";
+ }
+ else
+ {
+ answ = "fontPiccolo textAzzurro";
+ }
+ return answ;
+ }
+ ///
+ /// determina dimensioni dell'oggetto spaziatore data la fase
+ ///
+ ///
+ ///
+ public Unit widthByCod(object codFase)
+ {
+ Unit answ = new Unit(0, UnitType.Pixel);
+ int livello = 0;
+ // calcolo livello come num punti "." -1...
+ try
+ {
+ string[] array = codFase.ToString().Split('.');
+ livello = array.Length;
+ }
+ catch
+ { }
+ if (livello >= 4)
+ {
+ answ = new Unit((livello - 3) * 10, UnitType.Pixel);
+ }
+ return answ;
+ }
+ ///
+ /// inverte valore booleano
+ ///
+ ///
+ ///
+ public bool invBool(object valore)
+ {
+ bool answ = true;
+ try
+ {
+ answ = !Convert.ToBoolean(valore);
+ }
+ catch
+ { }
+ return answ;
+ }
+ ///
+ /// resetta la selezione dei valori in caso di modifiche su altri controlli
+ ///
+ public void resetSelezione()
+ {
+ grView.SelectedIndex = -1;
+ grView.DataBind();
+ setDetVisibility();
+ if (eh_resetSelezione != null)
+ {
+ eh_resetSelezione(this, new EventArgs());
+ }
+ }
+ ///
+ /// indico cambio selezione valore...
+ ///
+ ///
+ ///
+ protected void grView_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ setDetVisibility();
+ if (eh_faseSel != null)
+ {
+ eh_faseSel(this, new EventArgs());
+ }
+ }
+ ///
+ /// restituisce una classe css a seconda dei valori passati:
+ /// green: bdgt > real
+ /// orange: real > bdgt*warning
+ /// red: real > bdgt
+ /// std: errore...
+ ///
+ ///
+ ///
+ ///
+ public string colorByVal(object real, object bdgt)
+ {
+ string answ = "badgeStd";
+ try
+ {
+ double valoreReal = Convert.ToDouble(real);
+ double valoreBdget = Convert.ToDouble(bdgt);
+ double valoreWarn = Convert.ToDouble(bdgt) * Convert.ToDouble(utils.obj.confReadString("warningRatioPerc")) / 100;
+ if (valoreReal >= valoreBdget)
+ {
+ answ = "badgeRosso";
+ }
+ else if (valoreReal >= valoreWarn)
+ {
+ answ = "badgeArancio";
+ }
+ else
+ {
+ answ = "badgeVerde";
+ }
+ }
+ catch
+ {
+ }
+ return "ui-corner-all " + answ;
+ }
+ ///
+ /// determina se sia visibile pnl dettaglio RA della fase selezionata
+ ///
+ public bool enableShowRA
+ {
+ get
+ {
+ return pnlDetRA.Visible;
+ }
+ set
+ {
+ pnlDetRA.Visible = value;
+ }
+ }
+ ///
+ /// calcola se sia ancestore la fase
+ ///
+ ///
+ ///
+ public bool isAncestor(object idxFaseAncest)
+ {
+ bool answ = isWritable();
+ if (answ)
+ {
+ int idxFase = -1;
+ try
+ {
+ idxFase = Convert.ToInt32(idxFaseAncest);
+ }
+ catch
+ { }
+ answ = (idxFase == 0);
+ }
+ return answ;
+ }
+ ///
+ /// risponde alla domanda se l'utente abbia permesso tipo writable (S) nel permessi2funzione
+ ///
+ ///
+ public bool isWritable()
+ {
+ bool answ = true;
+ if (_paginaCorrente == null)
+ {
+ PagCorrente();
+ }
+ //answ = user_std.UtSn.isPageWriteEnabled(_paginaCorrente);
+ return answ;
+ }
+ ///
+ /// check licenze in fase di update...
+ ///
+ ///
+ ///
+ protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
+ {
+
+ }
+
+
+ #endregion
+ }
}
\ No newline at end of file
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.designer.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.designer.cs
index 3432229..f5a22d2 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.designer.cs
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.designer.cs
@@ -3,15 +3,58 @@
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
+// the code is regenerated.
//
//------------------------------------------------------------------------------
-namespace PROJ_ETS.WebUserControls
-{
-
-
- public partial class mod_commesse
- {
+namespace PROJ_ETS.WebUserControls {
+
+
+ public partial class mod_commesse {
+
+ ///
+ /// grView control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.GridView grView;
+
+ ///
+ /// ods control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.ObjectDataSource ods;
+
+ ///
+ /// lblNumRec control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblNumRec;
+
+ ///
+ /// pnlDetRA control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Panel pnlDetRA;
+
+ ///
+ /// lblDet control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblDet;
}
}
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_progetti.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_progetti.ascx
index 34e777c..c7a14bb 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_progetti.ascx
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_progetti.ascx
@@ -16,9 +16,9 @@
- <%--
--%>
+