Merge branch 'develop'

This commit is contained in:
Samuele Locatelli
2013-02-22 18:01:22 +01:00
31 changed files with 555 additions and 31 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
+5 -1
View File
@@ -30,7 +30,7 @@
<add key="appName" value="ETS-WS" />
<add key="SiteName" value="ETS" />
<add key="mainRev" value="1.1" />
<add key="minRev" value="123" />
<add key="minRev" value="125" />
<add key="copyRight" value="SteamWare, ETS © 2012-2013" />
<add key="tempUplDir" value="~/TempUploads" />
<add key="archiveDir" value="~/ArchivioDocs" />
@@ -45,6 +45,10 @@
<add key="srcPageSize" value="15" />
<!--update pagina-->
<add key="intUpdatePagina_ms" value="120000" />
<!--gestione trim caratteri-->
<add key ="maxFullPathLenght" value="240"/>
<add key ="maxPathLenght" value="220"/>
<add key ="separatoreTrim" value="..."/>
<!--config x WebServices autocompletamento-->
<add key="MinCharAutocomplete" value="2" />
<add key="MaxRowToDisplay" value="20" />
+28 -5
View File
@@ -36,15 +36,22 @@ namespace ETS_WS
string answ = "";
try
{
// calcolo valori data e red
// calcolo valori data e maxPathLenght
string aammgg = metaDati.dataDoc.ToString("yyMMdd");
// calcolo
answ = string.Format("/{0}/{1}/{2}/{3}/{4}_{5}/", utils.cleanPathName(metaDati.commessa), utils.cleanPathName(metaDati.fase), metaDati.InOut, utils.cleanPathName(metaDati.fonte), aammgg, utils.shrinkString(utils.cleanPathName(metaDati.oggetto), 200));
int maxPathLenght = utils.obj.confReadInt("maxPathLenght");
// calcolo il path, ipotizzando di lasciare ad oggetto max 200 char - con pulizia eventuali doppie barre
answ = string.Format("/{0}/{1}/{2}/{3}/{4}_{5}/", utils.cleanPathName(metaDati.commessa), utils.cleanPathName(metaDati.fase), metaDati.InOut, utils.cleanPathName(metaDati.fonte), aammgg, utils.shrinkString(utils.cleanPathName(metaDati.oggetto), maxPathLenght)).Replace("//", "/").Replace("//", "/").Replace("//", "/");
// se la lungh totale è > maxPathLenght (restano 260-maxPathLenght char x nome file...) trimmo oggetto!
if (answ.Length > maxPathLenght)
{
// ricalcolo riducendo oggetto: maxPathLenght - (answ.Length - maxPathLenght) - con pulizia eventuali doppie barre
answ = string.Format("/{0}/{1}/{2}/{3}/{4}_{5}/", utils.cleanPathName(metaDati.commessa), utils.cleanPathName(metaDati.fase), metaDati.InOut, utils.cleanPathName(metaDati.fonte), aammgg, utils.shrinkString(utils.cleanPathName(metaDati.oggetto), maxPathLenght - (answ.Length - maxPathLenght))).Replace("//", "/").Replace("//", "/").Replace("//", "/");
}
}
catch
{ }
// return! con pulizia eventuali doppie barre
return answ.Replace("//", "/").Replace("//", "/").Replace("//", "/"); ;
// return!
return answ;
}
/// <summary>
/// path caricamento temporaneo utente
@@ -299,6 +306,22 @@ namespace ETS_WS
return answ;
}
/// <summary>
/// path da idx DB
/// </summary>
/// <param name="idxFile"></param>
/// <returns></returns>
public static string pathFromIdxFile(int idxFile)
{
string answ = "";
try
{
answ = utils.obj.taDoc.getByIdxFile(idxFile)[0].fullPath;
}
catch
{ }
return answ;
}
/// <summary>
/// fornisce email dato codice fornitore
/// </summary>
/// <param name="codForn"></param>
@@ -134,7 +134,7 @@
<asp:Label ID="Label2" runat="server" Text='<%# shortMe(Eval("Fase"),20,10) %>' ToolTip='<%# Eval("Fase") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fonte" SortExpression="Fonte" ItemStyle-CssClass="valignMiddle padSxDx">
<asp:TemplateField HeaderText="Da/A" SortExpression="Fonte" ItemStyle-CssClass="valignMiddle padSxDx">
<EditItemTemplate>
<asp:TextBox ID="txtFonte" runat="server" Text='<%# Bind("Fonte") %>' Width="12em" TextMode="MultiLine" Rows="5" />
<asp:AutoCompleteExtender ID="aceFonte" runat="server" TargetControlID="txtFonte" ServicePath="~/WS/AutoCompletamento.asmx"
@@ -176,7 +176,7 @@
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getBySearch_paged" TypeName="ETS_Data.DS_WebScipTableAdapters.tbDocumentiTableAdapter"
OldValuesParameterFormatString="Original_{0}" EnablePaging="True" SelectCountMethod="getBySearch_count" SortParameterName="SortExpression"
OnUpdating="ods_Updating" UpdateMethod="updateQuery">
OnUpdating="ods_Updating" UpdateMethod="updateQuery" onupdated="ods_Updated">
<%--EnableCaching="true" CacheDuration="5" SortParameterName="SortExpression" --%>
<SelectParameters>
<asp:SessionParameter DefaultValue="*" Name="inizio" SessionField="_inizio" Type="DateTime" />
@@ -200,6 +200,8 @@ namespace ETS_WS.WebUserControls
{
lg.Info("Errore recupero stato red old/new", exc);
}
#if false
// sposto file in area temp utente...
if (isRed != isRed_Original)
{
// dati del file originale..
@@ -218,8 +220,11 @@ namespace ETS_WS.WebUserControls
destPath = string.Format("{0}{1}", utils.obj.confReadString("archiveDir"), docsData.path);
}
// sposto file a nuova dest...
fileMover.obj.muoviFile(fromPath, destPath, WebShipUtils.nomeFileFullFromIdxFile(WebShipUtils.mng.idxFileEdit));
}
fileMover.obj.muoviFile(fromPath, destPath, WebShipUtils.nomeFileFullFromIdxFile(WebShipUtils.mng.idxFileEdit), WebShipUtils.nomeFileFromIdxFile(WebShipUtils.mng.idxFileEdit), true);
}
#endif
// sposto file a nuova dest...
fileMover.obj.muoviFile(WebShipUtils.pathFromIdxFile(WebShipUtils.mng.idxFileEdit), WebShipUtils.mng.UserTempPath, WebShipUtils.nomeFileFullFromIdxFile(WebShipUtils.mng.idxFileEdit), WebShipUtils.nomeFileFromIdxFile(WebShipUtils.mng.idxFileEdit), true);
}
/// <summary>
/// mostro button x sostituzione file
@@ -337,7 +342,7 @@ namespace ETS_WS.WebUserControls
if (idxFile > 0)
{
// controllo condizioni: in primis è lui che ha creato record
if (WebShipUtils.redattoreFromIdxFile(idxFile)==utils.obj.currUserNomeCognome)
if (WebShipUtils.redattoreFromIdxFile(idxFile) == utils.obj.currUserNomeCognome)
{
answ = true;
}
@@ -392,5 +397,11 @@ namespace ETS_WS.WebUserControls
grView.EditIndex = -1;
grView.DataBind();
}
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
// risposto file da area temp ad area corretta
fileMover.obj.muoviFile(WebShipUtils.mng.UserTempPath, WebShipUtils.pathFromIdxFile(WebShipUtils.mng.idxFileEdit), WebShipUtils.nomeFileFromIdxFile(WebShipUtils.mng.idxFileEdit), WebShipUtils.nomeFileFullFromIdxFile(WebShipUtils.mng.idxFileEdit), true);
}
}
}
@@ -41,29 +41,27 @@
<uc2:mod_periodoAnalisi ID="mod_periodoAnalisi1" runat="server" realtimeUpdate="true" />
</div>
<div class="divSx" style="margin-top: -2px; width: 160px;">
<asp:CheckBox runat="server" ID="chkCommessa" Text="Filtra Commessa" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkCommessa_CheckedChanged" /><br />
<asp:CheckBox runat="server" ID="chkCommessa" Text="Filtra Commessa" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkCommessa_CheckedChanged" />
<uc1:mod_textAutocomplete ID="tacCommesse" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoCommesseByDoc" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char" Visible="false" />
</div>
<div class="divSx" style="margin-top: -2px; width: 140px;">
<asp:CheckBox runat="server" ID="chkFase" Text="Filtra per Fase" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkFase_CheckedChanged" /><br />
<asp:CheckBox runat="server" ID="chkFase" Text="Filtra per Fase" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkFase_CheckedChanged" />
<uc1:mod_textAutocomplete ID="tacFasi" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoFasiByDoc" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char" Visible="false" />
</div>
<div class="divSx" style="margin-top: -2px; width: 140px;">
<asp:CheckBox runat="server" ID="chkFonte" Text="Filtra per Fonte" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkFonte_CheckedChanged" />
<br />
<asp:CheckBox runat="server" ID="chkFonte" Text="Filtra Da/A" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkFonte_CheckedChanged" />
<uc1:mod_textAutocomplete ID="tacFonti" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoFontiByDoc" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char" Visible="false" />
</div>
<div class="divSx" style="margin-top: -2px; width: 140px;">
<asp:CheckBox runat="server" ID="chkInOut" Text="Filtra In/Out" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkInOut_CheckedChanged" />
<br />
<asp:RadioButtonList ID="rblInOut" runat="server" AutoPostBack="true" RepeatDirection="Horizontal" RepeatLayout="Flow" OnSelectedIndexChanged="rblInOut_SelectedIndexChanged" Visible="false">
<asp:ListItem Value="In" Text=" In " />
<asp:ListItem Value="Out" Text="Out" Selected="True" />
</asp:RadioButtonList>
</div>
<div class="divSx" style="margin-top: -2px; width: 140px;">
<div class="divSx" style="margin-top: -2px; width: 150px;">
<asp:CheckBox runat="server" ID="chkRedattore" Text="Filtra Redattore" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkRedattore_CheckedChanged" />
<br />
<uc1:mod_textAutocomplete ID="tacRedattore" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoRedattoriByDoc" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char" Visible="false" />
</div>
<div class="divSx" style="margin-top: 2px; width: 175px;">
@@ -216,12 +216,12 @@ namespace ETS_WS.WebUserControls
if (chkFonte.Checked)
{
tacFonti.contextKey = string.Format("{0}#{1}", utils.obj.StringSessionObj("_inizio"), utils.obj.StringSessionObj("_fine"));
chkFonte.Text = "Elim. Fonte";
chkFonte.Text = "Elim. Da/A";
tacFonti.setFocus();
}
else
{
chkFonte.Text = "Filtra Fonte";
chkFonte.Text = "Filtra Da/A";
}
tacFonti.Visible = chkFonte.Checked;
updateVisual();
@@ -85,7 +85,7 @@
<uc1:mod_textAutocomplete ID="tacFasi" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoFasi" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char" TabIndex="4" />
</div>
<div class="clearDiv">
<asp:Label runat="server" ID="lblFonte" Text="Fonte" CssClass="labelInput" />
<asp:Label runat="server" ID="lblFonte" Text="Da/A" CssClass="labelInput" />
<br />
<uc1:mod_textAutocomplete ID="tacFonti" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoFonti" minCharAutocomplete="3" showKey="false" toolTip="Digitare per iniziare ricerca, min 3 char" TabIndex="5" />
</div>
Binary file not shown.
Binary file not shown.
@@ -30,7 +30,7 @@
<add key="appName" value="ETS-WS" />
<add key="SiteName" value="ETS" />
<add key="mainRev" value="1.1" />
<add key="minRev" value="123" />
<add key="minRev" value="125" />
<add key="copyRight" value="SteamWare, ETS © 2012-2013" />
<add key="tempUplDir" value="~/TempUploads" />
<add key="archiveDir" value="~/ArchivioDocs" />
@@ -45,6 +45,10 @@
<add key="srcPageSize" value="15" />
<!--update pagina-->
<add key="intUpdatePagina_ms" value="120000" />
<!--gestione trim caratteri-->
<add key="maxFullPathLenght" value="240"/>
<add key="maxPathLenght" value="220"/>
<add key="separatoreTrim" value="..."/>
<!--config x WebServices autocompletamento-->
<add key="MinCharAutocomplete" value="2" />
<add key="MaxRowToDisplay" value="20" />
@@ -30,7 +30,7 @@
<add key="appName" value="ETS-WS" />
<add key="SiteName" value="ETS" />
<add key="mainRev" value="1.1" />
<add key="minRev" value="123" />
<add key="minRev" value="125" />
<add key="copyRight" value="SteamWare, ETS © 2012-2013" />
<add key="tempUplDir" value="~/TempUploads" />
<add key="archiveDir" value="~/ArchivioDocs" />
@@ -45,6 +45,10 @@
<add key="srcPageSize" value="15" />
<!--update pagina-->
<add key="intUpdatePagina_ms" value="120000" />
<!--gestione trim caratteri-->
<add key="maxFullPathLenght" value="240"/>
<add key="maxPathLenght" value="220"/>
<add key="separatoreTrim" value="..."/>
<!--config x WebServices autocompletamento-->
<add key="MinCharAutocomplete" value="2" />
<add key="MaxRowToDisplay" value="20" />
Binary file not shown.
Binary file not shown.
@@ -30,7 +30,7 @@
<add key="appName" value="ETS-WS" />
<add key="SiteName" value="ETS" />
<add key="mainRev" value="1.1" />
<add key="minRev" value="123" />
<add key="minRev" value="125" />
<add key="copyRight" value="SteamWare, ETS © 2012-2013" />
<add key="tempUplDir" value="~/TempUploads" />
<add key="archiveDir" value="~/ArchivioDocs" />
@@ -45,6 +45,10 @@
<add key="srcPageSize" value="15" />
<!--update pagina-->
<add key="intUpdatePagina_ms" value="120000" />
<!--gestione trim caratteri-->
<add key ="maxFullPathLenght" value="240"/>
<add key ="maxPathLenght" value="220"/>
<add key ="separatoreTrim" value="..."/>
<!--config x WebServices autocompletamento-->
<add key="MinCharAutocomplete" value="2" />
<add key="MaxRowToDisplay" value="20" />
@@ -30,7 +30,7 @@
<add key="appName" value="ETS-WS" />
<add key="SiteName" value="ETS" />
<add key="mainRev" value="1.1" />
<add key="minRev" value="123" />
<add key="minRev" value="125" />
<add key="copyRight" value="SteamWare, ETS © 2012-2013" />
<add key="tempUplDir" value="~/TempUploads" />
<add key="archiveDir" value="~/ArchivioDocs" />
@@ -45,6 +45,10 @@
<add key="srcPageSize" value="15" />
<!--update pagina-->
<add key="intUpdatePagina_ms" value="120000" />
<!--gestione trim caratteri-->
<add key="maxFullPathLenght" value="240"/>
<add key="maxPathLenght" value="220"/>
<add key="separatoreTrim" value="..."/>
<!--config x WebServices autocompletamento-->
<add key="MinCharAutocomplete" value="2" />
<add key="MaxRowToDisplay" value="20" />
+1
View File
@@ -107,6 +107,7 @@
<Compile Include="utils.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="SQL\ETS_WS\ETS_WS_00125.sql" />
<Content Include="SQL\ETS_WS\ETS_WS_00121.sql" />
<Content Include="SQL\ETS_WS\ETS_WS_00120.sql" />
<Content Include="SQL\ETS_WS\ETS_WS_00119.sql" />
+471
View File
@@ -0,0 +1,471 @@
set xact_abort on;
go
begin transaction;
go
alter table Tags2Doc drop
constraint FK_Tags2Doc_tbDocumenti ;
go
alter table tbDocumenti drop
constraint DF_tbDocumenti_isRed ,
constraint DF_tbDocumenti_Spunta ,
constraint DF_tbDocumenti_Autore ,
constraint DF_tbDocumenti_SA ,
constraint DF_tbDocumenti_Redattore ,
constraint DF_tbDocumenti_SR ;
go
exec sp_rename 'PK_tbDocumenti', 'tmp__PK_tbDocumenti', 'OBJECT';
go
exec sp_rename 'tbDocumenti', 'tmp__tbDocumenti_0', 'OBJECT';
go
create table tbDocumenti(
idxFile int not null identity constraint PK_tbDocumenti primary key,
NomeFile nvarchar(250) not null,
Nome as ('-'),
fullPath nvarchar(500) not null,
userId nvarchar(50) not null,
isRed bit constraint DF_tbDocumenti_isRed default ((0)),
NrProtocollo int,
Numero int,
Anno int,
DataRic datetime,
DataDoc datetime,
Commessa as ((right(replicate('0',(4))+[NumeroCommessa],(4))+'-')+right(replicate('0',(4))+[AnnoCommessa],(4))),
NumeroCommessa nvarchar(4),
AnnoCommessa nvarchar(4),
Fase nvarchar(250),
Fonte nvarchar(100),
Oggetto nvarchar(250),
InOut nvarchar(3),
Tipologia nvarchar(100),
Riferimenti nvarchar(100),
Attivita nvarchar(100),
Autore nvarchar(50) constraint DF_tbDocumenti_Autore default ('-'),
SA nvarchar(4) constraint DF_tbDocumenti_SA default ('-'),
Redattore nvarchar(50) constraint DF_tbDocumenti_Redattore default ('-'),
SR nvarchar(4) constraint DF_tbDocumenti_SR default ('-'),
Annotazioni ntext,
LegUtente nvarchar(25),
NoteSystemManager ntext,
Spunta int constraint DF_tbDocumenti_Spunta default ((0)),
Num_Fattura nvarchar(50)
);
go
set NUMERIC_ROUNDABORT off
set ANSI_NULLS on
set ANSI_PADDING on
set ANSI_WARNINGS on
set CONCAT_NULL_YIELDS_NULL on
set QUOTED_IDENTIFIER on
set ARITHABORT on;
go
create index ix_tbDocumenti_Commessa on tbDocumenti(Commessa desc);
go
create index i_commessa on tbDocumenti(Commessa);
go
create index i_fase on tbDocumenti(Fase);
go
create index i_fonte on tbDocumenti(Fonte);
go
create index i_InOut on tbDocumenti(InOut);
go
create index ix_dataRic on tbDocumenti(DataRic);
go
exec sp_addextendedproperty 'MS_Description', '([dbo].[f_shortFileName]([Numero],[Anno],[DataDoc],[InOut],[Oggetto],substring([NomeFile],(0),len([NomeFile])-(3)),substring([NomeFile],len([NomeFile])-(3),(4))))', 'SCHEMA', 'dbo', 'TABLE', 'tbDocumenti', 'COLUMN', 'Nome';
go
set identity_insert tbDocumenti on;
go
insert into tbDocumenti(idxFile,NomeFile,fullPath,userId,isRed,NrProtocollo,Numero,Anno,DataRic,DataDoc,NumeroCommessa,AnnoCommessa,Fase,Fonte,Oggetto,InOut,Tipologia,Riferimenti,Attivita,Autore,SA,Redattore,SR,Annotazioni,LegUtente,NoteSystemManager,Spunta,Num_Fattura) select idxFile,NomeFile,fullPath,userId,isRed,NrProtocollo,Numero,Anno,DataRic,DataDoc,NumeroCommessa,AnnoCommessa,Fase,Fonte,Oggetto,InOut,Tipologia,Riferimenti,Attivita,Autore,SA,Redattore,SR,Annotazioni,LegUtente,NoteSystemManager,Spunta,Num_Fattura from tmp__tbDocumenti_0;
go
set identity_insert tbDocumenti off;
go
drop table tmp__tbDocumenti_0;
go
alter table Tags2Doc add
constraint FK_Tags2Doc_tbDocumenti foreign key(idxFile) references tbDocumenti(idxFile) on update cascade;
go
commit;
go
set xact_abort on;
go
begin transaction;
go
set ANSI_NULLS on;
go
create VIEW v_selFonti_expl
AS
SELECT Codice AS value, Descrizione AS label, ISNULL(Telefono, '') AS Telefono, ISNULL(Fax, '') AS Fax, ISNULL(Email, '') AS Email
FROM SciP_2000.dbo.fornitori
go
exec sp_addextendedproperty 'MS_DiagramPane1', '[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties =
Begin PaneConfigurations =
Begin PaneConfiguration = 0
NumPanes = 4
Configuration = "(H (1[40] 4[20] 2[20] 3) )"
End
Begin PaneConfiguration = 1
NumPanes = 3
Configuration = "(H (1 [50] 4 [25] 3))"
End
Begin PaneConfiguration = 2
NumPanes = 3
Configuration = "(H (1 [50] 2 [25] 3))"
End
Begin PaneConfiguration = 3
NumPanes = 3
Configuration = "(H (4 [30] 2 [40] 3))"
End
Begin PaneConfiguration = 4
NumPanes = 2
Configuration = "(H (1 [56] 3))"
End
Begin PaneConfiguration = 5
NumPanes = 2
Configuration = "(H (2 [66] 3))"
End
Begin PaneConfiguration = 6
NumPanes = 2
Configuration = "(H (4 [50] 3))"
End
Begin PaneConfiguration = 7
NumPanes = 1
Configuration = "(V (3))"
End
Begin PaneConfiguration = 8
NumPanes = 3
Configuration = "(H (1[56] 4[18] 2) )"
End
Begin PaneConfiguration = 9
NumPanes = 2
Configuration = "(H (1 [75] 4))"
End
Begin PaneConfiguration = 10
NumPanes = 2
Configuration = "(H (1[66] 2) )"
End
Begin PaneConfiguration = 11
NumPanes = 2
Configuration = "(H (4 [60] 2))"
End
Begin PaneConfiguration = 12
NumPanes = 1
Configuration = "(H (1) )"
End
Begin PaneConfiguration = 13
NumPanes = 1
Configuration = "(V (4))"
End
Begin PaneConfiguration = 14
NumPanes = 1
Configuration = "(V (2))"
End
ActivePaneConfig = 0
End
Begin DiagramPane =
Begin Origin =
Top = 0
Left = 0
End
Begin Tables =
Begin Table = "fornitori (SciP_2000.dbo)"
Begin Extent =
Top = 6
Left = 38
Bottom = 353
Right = 223
End
DisplayFlags = 280
TopColumn = 0
End
End
End
Begin SQLPane =
End
Begin DataPane =
Begin ParameterDefaults = ""
End
Begin ColumnWidths = 9
Width = 284
Width = 1500
Width = 1500
Width = 1500
Width = 1500
Width = 1500
Width = 1500
Width = 1500
Width = 1500
End
End
Begin CriteriaPane =
Begin ColumnWidths = 11
Column = 1440
Alias = 900
Table = 1170
Output = 720
Append = 1400
NewValue = 1170
SortType = 1350
SortOrder = 1410
GroupBy = 1350
Filter = 1350
Or = 1350
Or = 1350
Or = 1350
End
End
End
', 'SCHEMA', 'dbo', 'VIEW', 'v_selFonti_expl';
go
exec sp_addextendedproperty 'MS_DiagramPaneCount', 1, 'SCHEMA', 'dbo', 'VIEW', 'v_selFonti_expl';
go
commit;
go
set xact_abort on;
go
begin transaction;
go
set ANSI_NULLS on;
go
create PROCEDURE stp_VSFE_getByFonte
(
@fonte nvarchar(200)
)
AS
SET NOCOUNT ON;
SELECT value, label, Telefono, Fax, Email FROM dbo.v_selFonti_expl
WHERE label = @fonte
go
commit;
go
drop procedure stp_utility_updateNomi;
go
set xact_abort on;
go
begin transaction;
go
set ANSI_NULLS on;
go
/***************************************
* FUNCTION f_shortFileName
*
* calcola nome breve del file da regola
* nnnn-aaaa_BB_Descrizione breve troncata_nomefile.estensione
*
* Steamware, S.E.L.
* mod: 2013.02.22
*
****************************************/
alter FUNCTION f_shortFileName(@numero INT, @anno INT, @dataDoc DATETIME, @inOut NVARCHAR(3), @oggetto NVARCHAR(250), @nome NVARCHAR(250), @tipoDoc NVARCHAR(4), @fullPath NVARCHAR(250))
RETURNS NVARCHAR(250) AS
BEGIN
----------------------------------------
-- dichiaro le componenti del nome
----------------------------------------
DECLARE @AA NVARCHAR(10), @BB NVARCHAR(2), @CC NVARCHAR(150), @DD NVARCHAR(130), @nomeFin NVARCHAR(MAX);
----------------------------------------
-- dichiaro variabili x gestione limite LEN
----------------------------------------
DECLARE @maxFullPathLenght INT = 225 -- 250 - @aa(14) - 4 (.txt) x la parte finale del nome ".xxx"
DECLARE @fullPathLenght INT
DECLARE @nomeLen INT = 0
DECLARE @extraLen INT = 0
DECLARE @sxPart INT = 15 -- lungh minima a sx...
----------------------------------------
-- calcolo le varie componenti
----------------------------------------
-- protocollo!
SET @AA = dbo.f_padLeft(CAST(CAST(@numero AS INT) AS NVARCHAR(10)), 5,'0') + '-' + CAST(@Anno AS NVARCHAR(4));
-- check digit
SET @BB = dbo.f_checkDigit(@numero, @anno, @dataDoc, @inOut, @nome);
-- nome trimmato @fullPath + @nome <= @maxFullPathLenght, trimmo nome prendendo left/right)
SET @fullPathLenght = LEN(@fullPath + @nome)
IF (@fullPathLenght > @maxFullPathLenght)
BEGIN
-- calcolo LEN del nome, es 202
SET @nomeLen = LEN(@nome)
-- calcolo "sforamento", es 301-225=76
SET @extraLen = @fullPathLenght - @maxFullPathLenght
-- 4 char "bloccati" a dx
SET @sxPart = (@nomeLen - @extraLen)
SET @DD = LEFT(@nome, @sxPart)
END
ELSE
BEGIN
SET @DD = @nome;
END
----------------------------------------
-- nome completo finale
----------------------------------------
--SET @nomeFin = @AA + '_' + @BB + '_' + @CC + '_' + @DD -- versione vecchia: oggetto eliminato perchè in path! 2012.10.22
SET @nomeFin = @AA + '_' + @BB + '_' + @DD
-- ulteriore pulizia...
SET @nomeFin = REPLACE(REPLACE(@nomeFin,'/','-'),'\','-')
RETURN REPLACE(@nomeFin + '.','..','.') + REPLACE(@tipoDoc,'.','')
END
go
commit;
go
set xact_abort on;
go
begin transaction;
go
alter table Tags2Doc drop
constraint FK_Tags2Doc_tbDocumenti ;
go
alter table tbDocumenti drop
constraint DF_tbDocumenti_isRed ,
constraint DF_tbDocumenti_Autore ,
constraint DF_tbDocumenti_SA ,
constraint DF_tbDocumenti_Redattore ,
constraint DF_tbDocumenti_SR ,
constraint DF_tbDocumenti_Spunta ;
go
exec sp_rename 'PK_tbDocumenti', 'tmp__PK_tbDocumenti', 'OBJECT';
go
exec sp_rename 'tbDocumenti', 'tmp__tbDocumenti_1', 'OBJECT';
go
create table tbDocumenti(
idxFile int not null identity constraint PK_tbDocumenti primary key,
NomeFile nvarchar(250) not null,
Nome as ([dbo].[f_shortFileName]([Numero],[Anno],[DataDoc],[InOut],[Oggetto],substring([NomeFile],(0),len([NomeFile])-(3)),substring([NomeFile],len([NomeFile])-(3),(4)),[fullPath])),
fullPath nvarchar(500) not null,
userId nvarchar(50) not null,
isRed bit constraint DF_tbDocumenti_isRed default ((0)),
NrProtocollo int,
Numero int,
Anno int,
DataRic datetime,
DataDoc datetime,
Commessa as ((right(replicate('0',(4))+[NumeroCommessa],(4))+'-')+right(replicate('0',(4))+[AnnoCommessa],(4))),
NumeroCommessa nvarchar(4),
AnnoCommessa nvarchar(4),
Fase nvarchar(250),
Fonte nvarchar(100),
Oggetto nvarchar(250),
InOut nvarchar(3),
Tipologia nvarchar(100),
Riferimenti nvarchar(100),
Attivita nvarchar(100),
Autore nvarchar(50) constraint DF_tbDocumenti_Autore default ('-'),
SA nvarchar(4) constraint DF_tbDocumenti_SA default ('-'),
Redattore nvarchar(50) constraint DF_tbDocumenti_Redattore default ('-'),
SR nvarchar(4) constraint DF_tbDocumenti_SR default ('-'),
Annotazioni ntext,
LegUtente nvarchar(25),
NoteSystemManager ntext,
Spunta int constraint DF_tbDocumenti_Spunta default ((0)),
Num_Fattura nvarchar(50)
);
go
set NUMERIC_ROUNDABORT off
set ANSI_NULLS on
set ANSI_PADDING on
set ANSI_WARNINGS on
set CONCAT_NULL_YIELDS_NULL on
set QUOTED_IDENTIFIER on
set ARITHABORT on;
go
create index ix_tbDocumenti_Commessa on tbDocumenti(Commessa desc);
go
create index i_commessa on tbDocumenti(Commessa);
go
create index i_fase on tbDocumenti(Fase);
go
create index i_fonte on tbDocumenti(Fonte);
go
create index i_InOut on tbDocumenti(InOut);
go
create index ix_dataRic on tbDocumenti(DataRic);
go
exec sp_addextendedproperty 'MS_Description', 'dbo.f_shortFileName([Numero],[Anno],[DataDoc],[InOut],[Oggetto],substring([NomeFile],(0),len([NomeFile])-(3)),substring([NomeFile],len([NomeFile])-(3),(4)),fullPath)', 'SCHEMA', 'dbo', 'TABLE', 'tbDocumenti', 'COLUMN', 'Nome';
go
set identity_insert tbDocumenti on;
go
insert into tbDocumenti(idxFile,NomeFile,fullPath,userId,isRed,NrProtocollo,Numero,Anno,DataRic,DataDoc,NumeroCommessa,AnnoCommessa,Fase,Fonte,Oggetto,InOut,Tipologia,Riferimenti,Attivita,Autore,SA,Redattore,SR,Annotazioni,LegUtente,NoteSystemManager,Spunta,Num_Fattura) select idxFile,NomeFile,fullPath,userId,isRed,NrProtocollo,Numero,Anno,DataRic,DataDoc,NumeroCommessa,AnnoCommessa,Fase,Fonte,Oggetto,InOut,Tipologia,Riferimenti,Attivita,Autore,SA,Redattore,SR,Annotazioni,LegUtente,NoteSystemManager,Spunta,Num_Fattura from tmp__tbDocumenti_1;
go
set identity_insert tbDocumenti off;
go
drop table tmp__tbDocumenti_1;
go
alter table Tags2Doc add
constraint FK_Tags2Doc_tbDocumenti foreign key(idxFile) references tbDocumenti(idxFile) on update cascade;
go
commit;
go
-- registro versione...
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(125, GETDATE())
GO
SELECT TOP 10 * FROM LogUpdateDb ORDER BY Versione DESC
GO
Binary file not shown.
Binary file not shown.
@@ -8,8 +8,6 @@ C:\Users\samuele\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\obj\ETS\ETS_
C:\Users\samuele\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\obj\ETS\ETS_Data.dll
C:\Users\samuele\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\obj\ETS\ETS_Data.pdb
C:\Users\samuele\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\bin\ETS\DocumentFormat.OpenXml.dll
C:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\obj\ETS\ETS_Data.csprojResolveAssemblyReference.cache
C:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\obj\ETS\ETS_Data.dll
C:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\bin\ETS\NLog.config
C:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\bin\ETS\ETS_Data.dll.config
C:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\bin\ETS\ETS_Data.dll
@@ -17,4 +15,5 @@ C:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2010\Projects\ETS\ETS_Data
C:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\bin\ETS\DocumentFormat.OpenXml.dll
C:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\bin\ETS\NLog.dll
C:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\bin\ETS\NLog.xml
C:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\obj\ETS\ETS_Data.dll
C:\Users\samuele.STEAMWAREWIN\Documents\Visual Studio 2010\Projects\ETS\ETS_Data\obj\ETS\ETS_Data.pdb
Binary file not shown.
Binary file not shown.
+4 -3
View File
@@ -260,7 +260,7 @@ namespace ETS_Data
}
#endregion
#region area Session
/// <summary>
@@ -502,8 +502,9 @@ namespace ETS_Data
string answ = originalString;
if (answ.Length > maxLenght)
{
int numChar = (maxLenght - 3) / 2;
answ = string.Format("{0}...{1}", answ.Substring(0, numChar), answ.Substring(answ.Length - (maxLenght - 3 - numChar)));
string sep = utils.obj.confReadString("separatoreTrim");
int numChar = (maxLenght - sep.Length) / 2;
answ = string.Format("{0}{1}{2}", answ.Substring(0, numChar), sep, answ.Substring(answ.Length - (maxLenght - 3 - numChar)));
}
return answ;
}