diff --git a/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs b/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs index 3e66ee2..38b818b 100644 --- a/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs +++ b/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4927 +// Runtime Version:2.0.50727.4961 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -16428,7 +16428,7 @@ WHERE (MtzProgPending.idxPending IS NULL)"; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 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 giorno, descrGiorno, apertura FROM dbo.OreAperturaSett"; @@ -16439,11 +16439,19 @@ WHERE (MtzProgPending.idxPending IS NULL)"; this._commandCollection[1].CommandType = global::System.Data.CommandType.Text; this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[2].Connection = this.Connection; - this._commandCollection[2].CommandText = "UPDATE [dbo].[OreAperturaSett] SET [apertura] = @apertura WHERE (([giorno] = @Ori" + + this._commandCollection[2].CommandText = "dbo.stp_oreEquivalenti"; + 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("@dataFrom", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dataTo", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxMacchina", 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 = "UPDATE [dbo].[OreAperturaSett] SET [apertura] = @apertura WHERE (([giorno] = @Ori" + "ginal_giorno))"; - this._commandCollection[2].CommandType = global::System.Data.CommandType.Text; - this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@apertura", global::System.Data.SqlDbType.Decimal, 5, global::System.Data.ParameterDirection.Input, 4, 2, "apertura", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_giorno", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "giorno", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._commandCollection[3].CommandType = global::System.Data.CommandType.Text; + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@apertura", global::System.Data.SqlDbType.Decimal, 5, global::System.Data.ParameterDirection.Input, 4, 2, "apertura", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_giorno", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "giorno", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -16615,11 +16623,56 @@ WHERE (MtzProgPending.idxPending IS NULL)"; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual object oreLavoratePeriodo(global::System.Nullable dataFrom, global::System.Nullable dataTo, global::System.Nullable idxMacchina) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; + if ((dataFrom.HasValue == true)) { + command.Parameters[1].Value = ((System.DateTime)(dataFrom.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((dataTo.HasValue == true)) { + command.Parameters[2].Value = ((System.DateTime)(dataTo.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((idxMacchina.HasValue == true)) { + command.Parameters[3].Value = ((int)(idxMacchina.Value)); + } + else { + command.Parameters[3].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(); + } + object returnValue; + try { + returnValue = command.ExecuteScalar(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + if (((returnValue == null) + || (returnValue.GetType() == typeof(global::System.DBNull)))) { + return null; + } + else { + return ((object)(returnValue)); + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, false)] public virtual int updateApertura(global::System.Nullable apertura, int Original_giorno) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; if ((apertura.HasValue == true)) { command.Parameters[0].Value = ((decimal)(apertura.Value)); } diff --git a/Projects/WebGIM/GIM_data/DS_applicazione.xsd b/Projects/WebGIM/GIM_data/DS_applicazione.xsd index e9c3622..4141326 100644 --- a/Projects/WebGIM/GIM_data/DS_applicazione.xsd +++ b/Projects/WebGIM/GIM_data/DS_applicazione.xsd @@ -50,7 +50,7 @@ - + SELECT MAX(Versione) as Versione FROM LogUpdateDb @@ -180,7 +180,7 @@ where idxPriorita=@idxPriorita - + SELECT MAX(idxPriorita) as idxPriorita FROM AnagPriorita @@ -1252,7 +1252,7 @@ WHERE (data BETWEEN @inizio AND @fine) - + SELECT SUM(apertura) AS apertura FROM OreAperturaSett @@ -1260,6 +1260,19 @@ WHERE (data BETWEEN @inizio AND @fine) + + + + dbo.stp_oreEquivalenti + + + + + + + + + @@ -1565,16 +1578,16 @@ WHERE (idxCausale = @Original_idxCausale) - - + + - - + + @@ -1587,186 +1600,7 @@ WHERE (idxCausale = @Original_idxCausale) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1774,83 +1608,6 @@ WHERE (idxCausale = @Original_idxCausale) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1861,45 +1618,41 @@ WHERE (idxCausale = @Original_idxCausale) - + - - + + - + - + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - + + @@ -1914,20 +1667,182 @@ WHERE (idxCausale = @Original_idxCausale) - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1938,27 +1853,43 @@ WHERE (idxCausale = @Original_idxCausale) - + - - - - - + + - + + + + + + + + - - - - + + + + + + + + + + + + + + + + @@ -1982,14 +1913,96 @@ WHERE (idxCausale = @Original_idxCausale) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -2002,47 +2015,19 @@ WHERE (idxCausale = @Original_idxCausale) - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2052,44 +2037,72 @@ WHERE (idxCausale = @Original_idxCausale) - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - + - + - + diff --git a/Projects/WebGIM/GIM_data/DS_applicazione.xss b/Projects/WebGIM/GIM_data/DS_applicazione.xss index e31bf37..bf7cabf 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. --> - + @@ -21,7 +21,7 @@ - + diff --git a/Projects/WebGIM/GIM_data/WebGimUtils.cs b/Projects/WebGIM/GIM_data/WebGimUtils.cs index febace3..0d40473 100644 --- a/Projects/WebGIM/GIM_data/WebGimUtils.cs +++ b/Projects/WebGIM/GIM_data/WebGimUtils.cs @@ -19,6 +19,7 @@ public class WebGimUtils public double oreEquivalenti(intervalloDate periodo) { double answ = 0; +#if false // carico valori di default double oreSett = (double)TA_app.obj.taOreApert.oreAperturaSett(); GIM_data.DS_applicazione.OreAperturaSettDataTable tabOre = TA_app.obj.taOreApert.GetData(); @@ -34,13 +35,20 @@ public class WebGimUtils for (int i = 0; i < numGgRimanenti; i++) { // il primo giorno è pari al giorno iniziale... e poi calcolo il "modulo" a 7 (con "%") - answ = answ + (double)tabOre[(i + ggSett)%7].apertura; + answ = answ + (double)tabOre[(i + ggSett) % 7].apertura; } // cerco eventuali festività che cadano nel periodo e le tolgo foreach (GIM_data.DS_applicazione.CalendFesteFerieRow riga in tabCalFF) { answ = answ - (double)tabOre[(int)riga.data.DayOfWeek].apertura; + } +#endif + try + { + answ = Convert.ToDouble(TA_app.obj.taOreApert.oreLavoratePeriodo(periodo.inizio, periodo.fine, 0));// per ora non imposto la macchina... } + catch + { } // restituisco risposta return answ; } diff --git a/Projects/WebGIM/GIM_data/bin/GIM_data.dll b/Projects/WebGIM/GIM_data/bin/GIM_data.dll index 886dfca..9fde883 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 4ad5a28..eb86706 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 4fb883e..b80aa83 100644 --- a/Projects/WebGIM/GIM_site/GIM_site.csproj +++ b/Projects/WebGIM/GIM_site/GIM_site.csproj @@ -1009,6 +1009,7 @@ + @@ -1017,7 +1018,7 @@ - + diff --git a/Projects/WebGIM/GIM_site/Reports/RichiestaIntervento.rdlc b/Projects/WebGIM/GIM_site/Reports/RichiestaIntervento.rdlc index 49a7287..b71ae2a 100644 --- a/Projects/WebGIM/GIM_site/Reports/RichiestaIntervento.rdlc +++ b/Projects/WebGIM/GIM_site/Reports/RichiestaIntervento.rdlc @@ -1588,7 +1588,7 @@ NnSm5FYXbj0U9rEw82eM2/AEepQw+nBwqUdZYVUfccyIRfdzJgvg7Yd8Bw3nNxCWu9tPWzHeevGbhHPm true 14cm 0.63492cm - Copyright SteamWare © 2006-2010 + Copyright SteamWare © 2006-2011 0.05754cm diff --git a/Projects/WebGIM/GIM_site/Web.config b/Projects/WebGIM/GIM_site/Web.config index 3b943aa..4ed4617 100644 --- a/Projects/WebGIM/GIM_site/Web.config +++ b/Projects/WebGIM/GIM_site/Web.config @@ -100,8 +100,8 @@ - - + + diff --git a/Projects/WebGIM/GIM_site/WebConfigSomaschini_AppSettings.config b/Projects/WebGIM/GIM_site/WebConfigSomaschini_AppSettings.config index dc5d501..4505426 100644 --- a/Projects/WebGIM/GIM_site/WebConfigSomaschini_AppSettings.config +++ b/Projects/WebGIM/GIM_site/WebConfigSomaschini_AppSettings.config @@ -18,8 +18,8 @@ - - + + diff --git a/Projects/WebGIM/GIM_site/bin/GIM_data.dll b/Projects/WebGIM/GIM_site/bin/GIM_data.dll index 886dfca..9fde883 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 6b0a39f..13b591c 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 4ad5a28..eb86706 100644 Binary files a/Projects/WebGIM/GIM_site/bin/SteamWare.dll and b/Projects/WebGIM/GIM_site/bin/SteamWare.dll differ diff --git a/Projects/WebGIM/GIM_site/obj/Debug/GIM_site.dll b/Projects/WebGIM/GIM_site/obj/Debug/GIM_site.dll index 6b0a39f..c328cf7 100644 Binary files a/Projects/WebGIM/GIM_site/obj/Debug/GIM_site.dll and b/Projects/WebGIM/GIM_site/obj/Debug/GIM_site.dll differ diff --git a/Projects/WebGIM/GIM_site/obj/Debug/ResolveAssemblyReference.cache b/Projects/WebGIM/GIM_site/obj/Debug/ResolveAssemblyReference.cache index 6212201..cd4831e 100644 Binary files a/Projects/WebGIM/GIM_site/obj/Debug/ResolveAssemblyReference.cache and b/Projects/WebGIM/GIM_site/obj/Debug/ResolveAssemblyReference.cache differ diff --git a/Projects/WebGIM/GIM_site/sql/GIM_0020.sql b/Projects/WebGIM/GIM_site/sql/GIM_0020.sql index 24e6a81..03743a3 100644 --- a/Projects/WebGIM/GIM_site/sql/GIM_0020.sql +++ b/Projects/WebGIM/GIM_site/sql/GIM_0020.sql @@ -260,44 +260,6 @@ AS RETURN @oreTot END - -/* - -declare @tmp_dates table (DateValue datetime, h int); -declare @dataFrom datetime -declare @dataTo datetime -set @dataFrom = '2011-04-01' -set @dataTo = '2011-07-01'; - -with mycte as -( - select cast(@dataFrom as datetime) DateValue, 16 as h--, 'sab/dom' as descrizione - union all - select DateValue + 1, 16 as h--, 'sab/dom' as descrizione - from mycte - where DateValue + 1 < @dataTo -) - -insert into @tmp_dates(DateValue, h) -select * -from mycte -where ((DATEPART(dw, DateValue) + @@DATEFIRST) % 7) IN (0, 1) -OPTION (MAXRECURSION 0); - - -insert into @tmp_dates(DateValue, h) -select data as DateValue, 24 as h--, descrizione -from CalendFesteFerie -where data between @dataFrom and @dataTo and data not in (select distinct DateValue from @tmp_dates); - -update @tmp_dates -set h=24 -where DateValue in (select data from CalendFesteFerie where data between @dataFrom and @dataTo) - -select * from @tmp_dates -order by DateValue - -*/ go commit @@ -565,6 +527,72 @@ commit go +create table OreAperturaSett( + giorno int not null constraint PK_OreAperturaSett_2 primary key, + descrGiorno nvarchar(50), + apertura int +) +go + + +set xact_abort on +go + +begin transaction +go + +INSERT INTO dbo.OreAperturaSett + VALUES (0, N'Dom', 0) +INSERT INTO dbo.OreAperturaSett + VALUES (1, N'Lun', 24) +INSERT INTO dbo.OreAperturaSett + VALUES (2, N'Mar', 24) +INSERT INTO dbo.OreAperturaSett + VALUES (3, N'Mer', 24) +INSERT INTO dbo.OreAperturaSett + VALUES (4, N'Gio', 24) +INSERT INTO dbo.OreAperturaSett + VALUES (5, N'Ven', 24) +INSERT INTO dbo.OreAperturaSett + VALUES (6, N'Sab', 8) +go + +commit transaction +go + + +set xact_abort on +go + +begin transaction +go + +set ANSI_NULLS on +go + +/************************************* +* STORED PROCEDURE stp_oreEquivalenti +* calcola le ore di apertura equivalenti x una data macchina e periodo +* +* modif.: S.E.L. - 2011.06.29 +**************************************/ +create PROCEDURE stp_oreEquivalenti +( + @dataFrom DATETIME, + @dataTo DATETIME, + @idxMacchina INT +) +AS + +SELECT dbo.f_diffOreLavorative(@dataFrom, @dataTo, @idxMacchina) AS apertura + +RETURN +go + +commit +go + + diff --git a/Projects/WebGIM/WebGIM/Release/WebGIM.msi b/Projects/WebGIM/WebGIM/Release/WebGIM.msi index 49453e7..71743dc 100644 Binary files a/Projects/WebGIM/WebGIM/Release/WebGIM.msi and b/Projects/WebGIM/WebGIM/Release/WebGIM.msi differ diff --git a/Projects/WebGIM/WebGIM/WebGIM.vdproj b/Projects/WebGIM/WebGIM/WebGIM.vdproj index 1862a43..26bcbc6 100644 --- a/Projects/WebGIM/WebGIM/WebGIM.vdproj +++ b/Projects/WebGIM/WebGIM/WebGIM.vdproj @@ -118,7 +118,7 @@ "InstallerBootstrapper" = "3:2" "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" { - "Enabled" = "11:TRUE" + "Enabled" = "11:FALSE" "PromptEnabled" = "11:TRUE" "PrerequisitesLocation" = "2:1" "Url" = "8:" @@ -200,7 +200,7 @@ { "Name" = "8:.NET Framework" "Message" = "8:[VSDNETMSG]" - "Version" = "8:3.5 SP1 Client" + "Version" = "8:2.0.50727" "AllowLaterVersions" = "11:FALSE" "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=76617" } @@ -351,14 +351,14 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:WebGIM" - "ProductCode" = "8:{0FF766FF-D8F0-4A5D-9BF9-EE01D7E61E2E}" - "PackageCode" = "8:{D1BFDB98-DB13-4C61-8DCE-8616483B24AD}" + "ProductCode" = "8:{DB6C1FF5-83F0-4160-AF99-C32A50FAB734}" + "PackageCode" = "8:{838D1675-7B14-4F48-806D-7027DEDCA093}" "UpgradeCode" = "8:{7739196B-46A3-4BC7-AC29-DB8493976F04}" "RestartWWWService" = "11:TRUE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:1.1.180" + "ProductVersion" = "8:1.1.190" "Manufacturer" = "8:SteamWare s.r.l." "ARPHELPTELEPHONE" = "8:035-460560" "ARPHELPLINK" = "8:http://www.steamware.net"