diff --git a/ETS_Data/DS_utilsProjEts.Designer.cs b/ETS_Data/DS_utilsProjEts.Designer.cs index 0ac16e0..0a6c5cd 100644 --- a/ETS_Data/DS_utilsProjEts.Designer.cs +++ b/ETS_Data/DS_utilsProjEts.Designer.cs @@ -2287,7 +2287,7 @@ namespace ETS_Data.DS_utilsProjEtsTableAdapters { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT value, label, conditio, Attivo FROM dbo.v_selProgetti"; @@ -2301,10 +2301,16 @@ namespace ETS_Data.DS_utilsProjEtsTableAdapters { this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@soloAttivi", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[2].Connection = this.Connection; - this._commandCollection[2].CommandText = "dbo.stp_VSPrj"; + this._commandCollection[2].CommandText = "dbo.stp_VSPrj_byValue"; this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@soloAttivi", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@value", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[3].Connection = this.Connection; + this._commandCollection[3].CommandText = "dbo.stp_VSPrj"; + this._commandCollection[3].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@soloAttivi", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -2358,8 +2364,25 @@ namespace ETS_Data.DS_utilsProjEtsTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_utilsProjEts.v_selProgettiDataTable getGrouped(global::System.Nullable soloAttivi) { + public virtual DS_utilsProjEts.v_selProgettiDataTable getByValue(global::System.Nullable value) { this.Adapter.SelectCommand = this.CommandCollection[2]; + if ((value.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[1].Value = ((int)(value.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + DS_utilsProjEts.v_selProgettiDataTable dataTable = new DS_utilsProjEts.v_selProgettiDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_utilsProjEts.v_selProgettiDataTable getGrouped(global::System.Nullable soloAttivi) { + this.Adapter.SelectCommand = this.CommandCollection[3]; if ((soloAttivi.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((bool)(soloAttivi.Value)); } diff --git a/ETS_Data/DS_utilsProjEts.xsd b/ETS_Data/DS_utilsProjEts.xsd index b5e78c1..30b0c60 100644 --- a/ETS_Data/DS_utilsProjEts.xsd +++ b/ETS_Data/DS_utilsProjEts.xsd @@ -77,6 +77,17 @@ + + + + dbo.stp_VSPrj_byValue + + + + + + + @@ -145,7 +156,7 @@ - + @@ -159,7 +170,7 @@ - + @@ -175,7 +186,7 @@ - + @@ -190,7 +201,7 @@ - + diff --git a/ETS_Data/DS_utilsProjEts.xss b/ETS_Data/DS_utilsProjEts.xss index 32d68fa..2c034e4 100644 --- a/ETS_Data/DS_utilsProjEts.xss +++ b/ETS_Data/DS_utilsProjEts.xss @@ -7,7 +7,7 @@ - + diff --git a/ETS_Data/DataProxy_ProjEts.cs b/ETS_Data/DataProxy_ProjEts.cs index 72631f3..5051b61 100644 --- a/ETS_Data/DataProxy_ProjEts.cs +++ b/ETS_Data/DataProxy_ProjEts.cs @@ -20,6 +20,7 @@ namespace ETS_Data public Ds_ProjEtsTableAdapters.DatiCommIntegTableAdapter taDCI; /* DS_utilsProjEts */ public DS_utilsProjEtsTableAdapters.v_selClientiTableAdapter taSelCli; + public DS_utilsProjEtsTableAdapters.v_selProgettiTableAdapter taSelPro; /// /// init dei table adapters @@ -32,6 +33,7 @@ namespace ETS_Data taDCF = new Ds_ProjEtsTableAdapters.DatiCommFornTableAdapter(); taDCI = new Ds_ProjEtsTableAdapters.DatiCommIntegTableAdapter(); taSelCli = new DS_utilsProjEtsTableAdapters.v_selClientiTableAdapter(); + taSelPro = new DS_utilsProjEtsTableAdapters.v_selProgettiTableAdapter(); } /// /// effettua setup dei connection strings da web.config delal singola applicazione @@ -45,6 +47,7 @@ namespace ETS_Data taDCF.Connection.ConnectionString = utils.obj.confReadString("ETS_PROJConnectionString"); taDCI.Connection.ConnectionString = utils.obj.confReadString("ETS_PROJConnectionString"); taSelCli.Connection.ConnectionString = utils.obj.confReadString("ETS_PROJConnectionString"); + taSelPro.Connection.ConnectionString = utils.obj.confReadString("ETS_PROJConnectionString"); } #endregion diff --git a/PROJ-ETS/PROJ-ETS/Commesse.aspx b/PROJ-ETS/PROJ-ETS/Commesse.aspx new file mode 100644 index 0000000..424e2b1 --- /dev/null +++ b/PROJ-ETS/PROJ-ETS/Commesse.aspx @@ -0,0 +1,6 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/Progetti.master" AutoEventWireup="true" CodeBehind="Commesse.aspx.cs" Inherits="PROJ_ETS.Commesse" %> + +<%@ Register Src="WebUserControls/mod_commesse.ascx" TagName="mod_commesse" TagPrefix="uc1" %> + + + diff --git a/PROJ-ETS/PROJ-ETS/Commesse.aspx.cs b/PROJ-ETS/PROJ-ETS/Commesse.aspx.cs new file mode 100644 index 0000000..68c3b6a --- /dev/null +++ b/PROJ-ETS/PROJ-ETS/Commesse.aspx.cs @@ -0,0 +1,18 @@ +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 +{ + public partial class Commesse : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + utils.obj.setSessionVal("idxProgetto_sel", 0); + } + } +} \ No newline at end of file diff --git a/PROJ-ETS/PROJ-ETS/Commesse.aspx.designer.cs b/PROJ-ETS/PROJ-ETS/Commesse.aspx.designer.cs new file mode 100644 index 0000000..6e7144c --- /dev/null +++ b/PROJ-ETS/PROJ-ETS/Commesse.aspx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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 { + + + public partial class Commesse { + + /// + /// mod_commesse1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::PROJ_ETS.WebUserControls.mod_commesse mod_commesse1; + } +} diff --git a/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj b/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj index b68bfc7..76c2349 100644 --- a/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj +++ b/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj @@ -113,6 +113,7 @@ + @@ -367,6 +368,13 @@ Bazaar.aspx + + Commesse.aspx + ASPXCodeBehind + + + Commesse.aspx + Contact.aspx ASPXCodeBehind diff --git a/PROJ-ETS/PROJ-ETS/Progetti.aspx b/PROJ-ETS/PROJ-ETS/Progetti.aspx index 143e899..3cb9d9a 100644 --- a/PROJ-ETS/PROJ-ETS/Progetti.aspx +++ b/PROJ-ETS/PROJ-ETS/Progetti.aspx @@ -9,8 +9,8 @@
-
-
+
+
diff --git a/PROJ-ETS/PROJ-ETS/Progetti.sitemap b/PROJ-ETS/PROJ-ETS/Progetti.sitemap index d9fb948..806fc02 100644 --- a/PROJ-ETS/PROJ-ETS/Progetti.sitemap +++ b/PROJ-ETS/PROJ-ETS/Progetti.sitemap @@ -1,12 +1,13 @@  - + + - + - - - + + + diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx index 3e39d1a..df8861b 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx @@ -2,7 +2,7 @@
+ OnSelectedIndexChanged="grView_SelectedIndexChanged" PageSize="20" OnRowUpdating="grView_RowUpdating" Width="100%"> @@ -48,11 +48,11 @@
-
+
+ Font-Bold="true" ToolTip='<%# condShowProj(Eval("idxProgetto")) %>' />
-
+
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.cs index 3c24d95..d4fe0b3 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.cs +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_commesse.ascx.cs @@ -9,330 +9,330 @@ using ETS_Data; namespace PROJ_ETS.WebUserControls { - public partial class mod_commesse : System.Web.UI.UserControl - { + public partial class mod_commesse : System.Web.UI.UserControl + { - #region area standard (non modificare) + #region area standard (non modificare) - #region gestione eventi + #region gestione eventi - public event EventHandler eh_resetSelezione; - public event EventHandler eh_nuovoValore; + public event EventHandler eh_resetSelezione; + public event EventHandler eh_nuovoValore; - #endregion + #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 = ""; - } - } + /// + /// 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 + #endregion - #region area CUSTOM (da modificare) + #region area CUSTOM (da modificare) - #region gestione eventi + #region gestione eventi - public event EventHandler eh_faseSel; + public event EventHandler eh_faseSel; - #endregion + #endregion - /// - /// uid base - /// - protected string sessionUid - { - get - { - return this.UniqueID.Replace("$", "-"); - } - } + /// + /// 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); + /// + /// 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); - // svuoto select parameters - ods.SelectParameters.Clear(); - // imposto i parametri... - ods.SelectParameters.Add("idxProgetto", DbType.Int32, value.ToString()); - ods.DataBind(); - } - } - /// - /// 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); - } + // svuoto select parameters + ods.SelectParameters.Clear(); + // imposto i parametri... + ods.SelectParameters.Add("idxProgetto", DbType.Int32, value.ToString()); + ods.DataBind(); + } + } + /// + /// 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 = ""; - } - } - /// - /// gestione evento richiesta nuova commessa - /// - /// - /// - protected void btnNewComm_Click(object sender, EventArgs e) - { - // creo direttamente record con valori "standard" - DataProxy_ProjEts.DP.taAF.InsertCommessa(DateTime.Now.Year, utils.obj.IntSessionObj("idxProgetto_sel"), string.Format("Nuova Commessa del {0:dd/MM/yyyy} creata da {1}", DateTime.Now, utils.obj.currUserCognomeNome), false); - // forzo pagina zero... - grView.PageIndex = 0; - // forzo editing nuova commessa... - grView.EditIndex = 0; - grView.DataBind(); - } - /// - /// 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) - { - DataProxy_ProjEts.DP.taAF.InsertCommessa(DateTime.Now.Year, utils.obj.IntSessionObj("idxProgetto_sel"), string.Format("Nuova Commessa del {0:dd/MM/yyyy} creata da {1}", DateTime.Now, utils.obj.currUserCognomeNome), false); - grView.DataBind(); - // 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 btnNewEmptyZero_Click(object sender, EventArgs e) - { - DataProxy_ProjEts.DP.taAF.InsertCommessa(DateTime.Now.Year, utils.obj.IntSessionObj("idxProgetto_sel"), string.Format("Nuova Commessa '0000' del {0:dd/MM/yyyy} creata da {1}", DateTime.Now, utils.obj.currUserCognomeNome), true); - 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) - { - // la cancellazione è SEMPRE logica, x cui controllo che si veda solo se è attivo... - try - { - answ = DataProxy_ProjEts.DP.taAF.getByIdx(Convert.ToInt32(idxObj))[0].Attivo; - } - catch - { } + /// + /// 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 = ""; + } + } + /// + /// gestione evento richiesta nuova commessa + /// + /// + /// + protected void btnNewComm_Click(object sender, EventArgs e) + { + // creo direttamente record con valori "standard" + DataProxy_ProjEts.DP.taAF.InsertCommessa(DateTime.Now.Year, utils.obj.IntSessionObj("idxProgetto_sel"), string.Format("Nuova Commessa del {0:dd/MM/yyyy} creata da {1}", DateTime.Now, utils.obj.currUserCognomeNome), false); + // forzo pagina zero... + grView.PageIndex = 0; + // forzo editing nuova commessa... + grView.EditIndex = 0; + grView.DataBind(); + } + /// + /// 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) + { + DataProxy_ProjEts.DP.taAF.InsertCommessa(DateTime.Now.Year, utils.obj.IntSessionObj("idxProgetto_sel"), string.Format("Nuova Commessa del {0:dd/MM/yyyy} creata da {1}", DateTime.Now, utils.obj.currUserCognomeNome), false); + grView.DataBind(); + // 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 btnNewEmptyZero_Click(object sender, EventArgs e) + { + DataProxy_ProjEts.DP.taAF.InsertCommessa(DateTime.Now.Year, utils.obj.IntSessionObj("idxProgetto_sel"), string.Format("Nuova Commessa '0000' del {0:dd/MM/yyyy} creata da {1}", DateTime.Now, utils.obj.currUserCognomeNome), true); + 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) + { + // la cancellazione è SEMPRE logica, x cui controllo che si veda solo se è attivo... + try + { + answ = DataProxy_ProjEts.DP.taAF.getByIdx(Convert.ToInt32(idxObj))[0].Attivo; + } + catch + { } #if false int trovati = 0; // controllo se sia una fase "ancestor" e in tal caso NON deve avere fasi child @@ -343,288 +343,309 @@ namespace PROJ_ETS.WebUserControls answ = false; } #endif - } - 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; - } - } - /// - /// possibilità creazioen nuovo - /// - public bool _enableNewFromEmpty { get; set; } - /// - /// determina se sia visibile creazione nuova commessa da selezione progetto empty - /// - public bool enableNewFromEmpty - { - get - { - return _enableNewFromEmpty; - } - set - { - _enableNewFromEmpty = value; - } - } - /// - /// restituisce true se sia possibile creare la commessa generica "0000-anno" - /// - public bool zeroIsAvailable - { - get - { - bool answ = false; - try - { - answ = DataProxy_ProjEts.DP.taDC.getZeroByYear(DateTime.Now.Year).Rows.Count == 0; - } - catch - { } - return answ; - } - } - /// - /// 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) - { + } + 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; + } + } + /// + /// possibilità creazioen nuovo + /// + public bool _enableNewFromEmpty { get; set; } + /// + /// determina se sia visibile creazione nuova commessa da selezione progetto empty + /// + public bool enableNewFromEmpty + { + get + { + return _enableNewFromEmpty; + } + set + { + _enableNewFromEmpty = value; + } + } + /// + /// restituisce true se sia possibile creare la commessa generica "0000-anno" + /// + public bool zeroIsAvailable + { + get + { + bool answ = false; + try + { + answ = DataProxy_ProjEts.DP.taDC.getZeroByYear(DateTime.Now.Year).Rows.Count == 0; + } + catch + { } + return answ; + } + } + /// + /// 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) + { - } - /// - /// salvo in session che il prox comando è ettaglio commesse... - /// - /// - /// - protected void imgDettComm_Click(object sender, ImageClickEventArgs e) - { - utils.obj.setSessionVal("nextObjCommand", "dettComm"); - } - /// - /// intercetto eventuale update fittizio x rimandare a pagina dett fasi - /// - /// - /// - protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e) - { - // salvo progetto sel - utils.obj.setSessionVal("idxFase_sel", e.Keys["idxFase"]); - // quale comando? - string _comando = ""; - if (utils.obj.isInSessionObject("nextObjCommand")) - { - _comando = utils.obj.StringSessionObj("nextObjCommand"); - utils.obj.emptySessionVal("nextObjCommand"); - } - // verifico il tipo di richiesta (clona o update normale) - switch (_comando) - { - case "dettComm": - // salvo idxCli... - int idxCli = 0; - string nomeCli = ""; - try - { - idxCli = DataProxy_ProjEts.DP.taAP.getByIdxPrj(utils.obj.IntSessionObj("idxProgetto_sel"))[0].idxCliente; - } - catch - { } - // cerco di recuperare nome cliente... - try - { - nomeCli = DataProxy_ProjEts.DP.taSelCli.getByValue(idxCli)[0].label; - } - catch - { } - utils.obj.setSessionVal("idxCli_sel", idxCli); - utils.obj.setSessionVal("nomeCli_sel", nomeCli); - Response.Redirect("DatiCommessa"); - // blocco update! - e.Cancel = true; - break; - default: - // faccio update! - break; - } - } + } + /// + /// salvo in session che il prox comando è ettaglio commesse... + /// + /// + /// + protected void imgDettComm_Click(object sender, ImageClickEventArgs e) + { + utils.obj.setSessionVal("nextObjCommand", "dettComm"); + } + /// + /// intercetto eventuale update fittizio x rimandare a pagina dett fasi + /// + /// + /// + protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e) + { + // salvo progetto sel + utils.obj.setSessionVal("idxFase_sel", e.Keys["idxFase"]); + // quale comando? + string _comando = ""; + if (utils.obj.isInSessionObject("nextObjCommand")) + { + _comando = utils.obj.StringSessionObj("nextObjCommand"); + utils.obj.emptySessionVal("nextObjCommand"); + } + // verifico il tipo di richiesta (clona o update normale) + switch (_comando) + { + case "dettComm": + // salvo idxCli... + int idxCli = 0; + string nomeCli = ""; + try + { + idxCli = DataProxy_ProjEts.DP.taAP.getByIdxPrj(utils.obj.IntSessionObj("idxProgetto_sel"))[0].idxCliente; + } + catch + { } + // cerco di recuperare nome cliente... + try + { + nomeCli = DataProxy_ProjEts.DP.taSelCli.getByValue(idxCli)[0].label; + } + catch + { } + utils.obj.setSessionVal("idxCli_sel", idxCli); + utils.obj.setSessionVal("nomeCli_sel", nomeCli); + Response.Redirect("DatiCommessa"); + // blocco update! + e.Cancel = true; + break; + default: + // faccio update! + break; + } + } + /// + /// se in modalità "solo commesse" mostra in tooltip cliente/progetto + /// + /// + /// + public string condShowProj(object _idxProgetto) + { + string answ = ""; + if (utils.obj.IntSessionObj("IdxProgetto") != 0) + { + try + { + int idxProgetto = Convert.ToInt16(_idxProgetto); + answ = DataProxy_ProjEts.DP.taSelPro.getByValue(idxProgetto)[0].label; - #endregion + } + catch + { } + } + return answ; + } - } + #endregion + + } } \ No newline at end of file diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuProj.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuProj.ascx index 9cca4dd..cce1348 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuProj.ascx +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_menuProj.ascx @@ -1,5 +1,5 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_menuProj.ascx.cs" Inherits="PROJ_ETS.WebUserControls.mod_menuProj" %> - + diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navDettComm.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navDettComm.ascx index 56ebc46..ed7f985 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navDettComm.ascx +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_navDettComm.ascx @@ -4,16 +4,25 @@ -
+ +
+
-
+ +
+
-
+ +
+
-
\ No newline at end of file + + +
+
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_periodoAnalisi.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_periodoAnalisi.ascx.cs index 31b4f62..192e782 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_periodoAnalisi.ascx.cs +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_periodoAnalisi.ascx.cs @@ -12,7 +12,7 @@ namespace PROJ_ETS.WebUserControls { #region area protected - + protected string _periodo = "Periodo"; protected intervalloDate _intervallo; /// @@ -178,7 +178,10 @@ namespace PROJ_ETS.WebUserControls } protected void Page_Load(object sender, EventArgs e) { - lblPeriodo.Text = "Periodo"; + if (!Page.IsPostBack) + { + lblPeriodo.Text = _periodo; + } txtInizio.ToolTip = "inizio periodo di riferimento per i dati mostrati"; txtFine.ToolTip = "fine periodo di riferimento per i dati mostrati"; lblDurataMin.Text = "Visualizza eventi con durata superiore a"; @@ -328,6 +331,20 @@ namespace PROJ_ETS.WebUserControls return true; } + public string labelPeriodo + { + get + { + return _periodo; + //return lblPeriodo.Text; + } + set + { + _periodo = value; + lblPeriodo.Text = value; + } + } + #region gestione eventi public event EventHandler eh_doUpdate; diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_progetti.ascx b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_progetti.ascx index c2c8af7..783b84f 100644 --- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_progetti.ascx +++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_progetti.ascx @@ -13,7 +13,7 @@
- +
diff --git a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll index 182b17a..12a2c3c 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 3d4e791..dabfa6c 100644 Binary files a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll and b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll differ