diff --git a/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs b/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs index 69d8f5b..b90f7b4 100644 --- a/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs +++ b/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs @@ -20959,12 +20959,37 @@ ORDER BY numIntMtz DESC"; [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[1]; + 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 idxImpiego, CodRisorsa, numIntMtz, QtaRisorsa, CostoUnit, TotImport FROM d" + "bo.ImpiegoRisorse"; this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; + this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[1].Connection = this.Connection; + this._commandCollection[1].CommandText = "dbo.stp_ImpRis_delete"; + this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[1].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[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_idxImpiego", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 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_ImpRis_insert"; + 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("@CodRisorsa", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@numIntMtz", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@QtaRisorsa", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 6, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CostoUnit", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 6, 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_ImpRis_update"; + 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("@Original_idxImpiego", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodRisorsa", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@numIntMtz", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@QtaRisorsa", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 6, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CostoUnit", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 18, 6, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -21132,6 +21157,132 @@ ORDER BY numIntMtz DESC"; public virtual int Update(string CodRisorsa, int numIntMtz, global::System.Nullable QtaRisorsa, global::System.Nullable CostoUnit, int Original_idxImpiego) { return this.Update(Original_idxImpiego, CodRisorsa, numIntMtz, QtaRisorsa, CostoUnit, Original_idxImpiego); } + + [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")] + public virtual int deleteQuery(global::System.Nullable Original_idxImpiego) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1]; + if ((Original_idxImpiego.HasValue == true)) { + command.Parameters[1].Value = ((int)(Original_idxImpiego.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } + + [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")] + public virtual int insertQuery(string CodRisorsa, global::System.Nullable numIntMtz, global::System.Nullable QtaRisorsa, global::System.Nullable CostoUnit) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; + if ((CodRisorsa == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(CodRisorsa)); + } + if ((numIntMtz.HasValue == true)) { + command.Parameters[2].Value = ((int)(numIntMtz.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((QtaRisorsa.HasValue == true)) { + command.Parameters[3].Value = ((decimal)(QtaRisorsa.Value)); + } + else { + command.Parameters[3].Value = global::System.DBNull.Value; + } + if ((CostoUnit.HasValue == true)) { + command.Parameters[4].Value = ((decimal)(CostoUnit.Value)); + } + else { + command.Parameters[4].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } + + [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")] + public virtual int updateQuery(global::System.Nullable Original_idxImpiego, string CodRisorsa, global::System.Nullable numIntMtz, global::System.Nullable QtaRisorsa, global::System.Nullable CostoUnit) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; + if ((Original_idxImpiego.HasValue == true)) { + command.Parameters[1].Value = ((int)(Original_idxImpiego.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((CodRisorsa == null)) { + command.Parameters[2].Value = global::System.DBNull.Value; + } + else { + command.Parameters[2].Value = ((string)(CodRisorsa)); + } + if ((numIntMtz.HasValue == true)) { + command.Parameters[3].Value = ((int)(numIntMtz.Value)); + } + else { + command.Parameters[3].Value = global::System.DBNull.Value; + } + if ((QtaRisorsa.HasValue == true)) { + command.Parameters[4].Value = ((decimal)(QtaRisorsa.Value)); + } + else { + command.Parameters[4].Value = global::System.DBNull.Value; + } + if ((CostoUnit.HasValue == true)) { + command.Parameters[5].Value = ((decimal)(CostoUnit.Value)); + } + else { + command.Parameters[5].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } } /// diff --git a/Projects/WebGIM/GIM_data/DS_applicazione.xsd b/Projects/WebGIM/GIM_data/DS_applicazione.xsd index 90970d7..fc9d437 100644 --- a/Projects/WebGIM/GIM_data/DS_applicazione.xsd +++ b/Projects/WebGIM/GIM_data/DS_applicazione.xsd @@ -1629,7 +1629,48 @@ WHERE (idxCausale = @Original_idxCausale) - + + + + + dbo.stp_ImpRis_delete + + + + + + + + + + + dbo.stp_ImpRis_insert + + + + + + + + + + + + + + dbo.stp_ImpRis_update + + + + + + + + + + + + diff --git a/Projects/WebGIM/GIM_data/DS_applicazione.xss b/Projects/WebGIM/GIM_data/DS_applicazione.xss index ef5bbce..ea643f1 100644 --- a/Projects/WebGIM/GIM_data/DS_applicazione.xss +++ b/Projects/WebGIM/GIM_data/DS_applicazione.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + @@ -20,14 +20,14 @@ - + - + @@ -219,11 +219,11 @@ 141 - 681 + 690 - 249 - 681 + 248 + 690 @@ -235,11 +235,11 @@ 569 - 642 + 651 - 460 - 642 + 470 + 651 diff --git a/Projects/WebGIM/GIM_data/bin/GIM_data.dll b/Projects/WebGIM/GIM_data/bin/GIM_data.dll index e1b19b8..27f9046 100644 Binary files a/Projects/WebGIM/GIM_data/bin/GIM_data.dll and b/Projects/WebGIM/GIM_data/bin/GIM_data.dll differ diff --git a/Projects/WebGIM/GIM_data/bin/SteamWare.dll b/Projects/WebGIM/GIM_data/bin/SteamWare.dll index e339769..47fa5e8 100644 Binary files a/Projects/WebGIM/GIM_data/bin/SteamWare.dll and b/Projects/WebGIM/GIM_data/bin/SteamWare.dll differ diff --git a/Projects/WebGIM/GIM_site/GIM_site.csproj b/Projects/WebGIM/GIM_site/GIM_site.csproj index decf757..817b7f0 100644 --- a/Projects/WebGIM/GIM_site/GIM_site.csproj +++ b/Projects/WebGIM/GIM_site/GIM_site.csproj @@ -1069,6 +1069,13 @@ mod_impianti.ascx + + mod_impiegoRisorse.ascx + ASPXCodeBehind + + + mod_impiegoRisorse.ascx + mod_insertRichiesta.ascx ASPXCodeBehind @@ -1367,6 +1374,7 @@ + diff --git a/Projects/WebGIM/GIM_site/WebUserControls/mod_dettaglioIntervento.ascx b/Projects/WebGIM/GIM_site/WebUserControls/mod_dettaglioIntervento.ascx index b0e7fd0..704bc05 100644 --- a/Projects/WebGIM/GIM_site/WebUserControls/mod_dettaglioIntervento.ascx +++ b/Projects/WebGIM/GIM_site/WebUserControls/mod_dettaglioIntervento.ascx @@ -1,9 +1,10 @@ <%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_dettaglioIntervento" CodeBehind="mod_dettaglioIntervento.ascx.cs" %> -<%@ Register Src="~/WebUserControls/mod_interventoOpMtz.ascx" TagName="mod_interventoOpMtz" - TagPrefix="uc1" %> +<%@ Register Src="~/WebUserControls/mod_interventoOpMtz.ascx" TagName="mod_interventoOpMtz" TagPrefix="uc1" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <%@ Register Src="~/WebUserControls/mod_dataOra.ascx" TagName="mod_dataOra" TagPrefix="uc2" %> +<%@ Register Src="~/WebUserControls/mod_impiegoRisorse.ascx" TagPrefix="uc3" TagName="mod_impiegoRisorse" %> +
@@ -210,7 +211,10 @@ SelectMethod="GetData" TypeName="GIM_data.DS_utilityTableAdapters.v_selStatoTableAdapter"> - + + + + @@ -431,7 +435,10 @@ SelectMethod="GetData" TypeName="GIM_data.DS_utilityTableAdapters.v_selStatoTableAdapter"> - + + + + @@ -681,7 +688,10 @@ SelectMethod="GetData" TypeName="GIM_data.DS_utilityTableAdapters.v_selStatoTableAdapter"> - + + + + diff --git a/Projects/WebGIM/GIM_site/WebUserControls/mod_impiegoRisorse.ascx b/Projects/WebGIM/GIM_site/WebUserControls/mod_impiegoRisorse.ascx new file mode 100644 index 0000000..b8e40cd --- /dev/null +++ b/Projects/WebGIM/GIM_site/WebUserControls/mod_impiegoRisorse.ascx @@ -0,0 +1,111 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_impiegoRisorse.ascx.cs" Inherits="GIM_site.WebUserControls.mod_impiegoRisorse" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/WebGIM/GIM_site/WebUserControls/mod_impiegoRisorse.ascx.cs b/Projects/WebGIM/GIM_site/WebUserControls/mod_impiegoRisorse.ascx.cs new file mode 100644 index 0000000..b3aa944 --- /dev/null +++ b/Projects/WebGIM/GIM_site/WebUserControls/mod_impiegoRisorse.ascx.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using SteamWare; + +namespace GIM_site.WebUserControls +{ + public partial class mod_impiegoRisorse : ApplicationUserControl + { + public event EventHandler eh_resetSelezione; + /// + /// evento dati associati a controllo + /// + /// + /// + protected void grView_DataBound(object sender, EventArgs e) + { + if (grView.Rows.Count > 0) + { + LinkButton lb; + // aggiorno gli headers + foreach (TableCell cella in grView.HeaderRow.Cells) + { + try + { + lb = (LinkButton)cella.Controls[0]; + lb.Text = traduci(lb.Text); + } + catch + { } + } + 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 delle selezioni + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } + /// + /// resetta la selezione dei valori in caso di modifiche su altri controlli + /// + public void resetSelezione() + { + grView.SelectedIndex = -1; + grView.DataBind(); + if (eh_resetSelezione != null) + { + eh_resetSelezione(this, new EventArgs()); + } + } + /// + /// seleziono valore in editing... + /// + /// + /// + protected void grView_RowEditing(object sender, GridViewEditEventArgs e) + { + // seleziono la riga corrente... + grView.SelectedIndex = e.NewEditIndex; + } + /// + /// gestione evento inserimento nuovo record standard (se ZERO presenti) + /// + /// + /// + protected void btnNewFromEmpty_Click(object sender, EventArgs e) + { + // reset selezione... + resetSelezione(); + int numIntMtz = memLayer.ML.IntSessionObj("numIntMtz_sel"); + string matr = memLayer.ML.confReadString("defaultMatr"); + TA_app.obj.taIntOpMtz.Insert(numIntMtz, matr, 0); + grView.DataBind(); + } + /// + /// restituisce un booleano se sia abilitato inserimento nuovi valori (solo se NON C'E' GIA' un operatore con amtricola di default...) + /// + /// + public bool canInsertNew() + { + bool answ = false; + int numIntMtz = memLayer.ML.IntSessionObj("numIntMtz_sel"); + string matr = memLayer.ML.confReadString("defaultMatr"); + try + { + answ = (TA_app.obj.taIntOpMtz.getByMatrNumIntMtz(numIntMtz, matr).Rows.Count == 0); + } + catch + { } + return (answ && isOnEdit); + } + /// + /// restituisce true se il controllo è in modalità editing (e non selezione...) + /// + public bool isOnEdit + { + get + { + return _vistaModulo == tipoVistaMod.editing; + } + } + /// + /// traduce matricola in matr + cognome + nome + /// + /// + /// + public string traduciMatrOp(object matr) + { + string answ = ""; + try + { + answ = TA_app.obj.taSelMatrOp.getByValue(matr.ToString())[0].label; + } + catch + { } + return answ; + } + } +} diff --git a/Projects/WebGIM/GIM_site/WebUserControls/mod_impiegoRisorse.ascx.designer.cs b/Projects/WebGIM/GIM_site/WebUserControls/mod_impiegoRisorse.ascx.designer.cs new file mode 100644 index 0000000..63e3658 --- /dev/null +++ b/Projects/WebGIM/GIM_site/WebUserControls/mod_impiegoRisorse.ascx.designer.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// 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 GIM_site.WebUserControls { + + + public partial class mod_impiegoRisorse { + + /// + /// 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; + + /// + /// 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; + + /// + /// 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; + } +} diff --git a/Projects/WebGIM/GIM_site/bin/GIM_data.dll b/Projects/WebGIM/GIM_site/bin/GIM_data.dll index e1b19b8..27f9046 100644 Binary files a/Projects/WebGIM/GIM_site/bin/GIM_data.dll and b/Projects/WebGIM/GIM_site/bin/GIM_data.dll differ diff --git a/Projects/WebGIM/GIM_site/bin/GIM_site.dll b/Projects/WebGIM/GIM_site/bin/GIM_site.dll index 080eed5..4a2897c 100644 Binary files a/Projects/WebGIM/GIM_site/bin/GIM_site.dll and b/Projects/WebGIM/GIM_site/bin/GIM_site.dll differ diff --git a/Projects/WebGIM/GIM_site/bin/SteamWare.dll b/Projects/WebGIM/GIM_site/bin/SteamWare.dll index e339769..47fa5e8 100644 Binary files a/Projects/WebGIM/GIM_site/bin/SteamWare.dll and b/Projects/WebGIM/GIM_site/bin/SteamWare.dll differ