bozza gestione sostituzioen test in docx x mettere numero protocollo...
This commit is contained in:
@@ -182,7 +182,7 @@ namespace ETS_WS
|
||||
/// </summary>
|
||||
/// <param name="idxFile"></param>
|
||||
/// <returns></returns>
|
||||
public string nomeFileFromIdxFile(int idxFile)
|
||||
public static string nomeFileFromIdxFile(int idxFile)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
@@ -193,6 +193,22 @@ namespace ETS_WS
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// nome del file da idx DB
|
||||
/// </summary>
|
||||
/// <param name="idxFile"></param>
|
||||
/// <returns></returns>
|
||||
public static string nomeFileFullFromIdxFile(int idxFile)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = utils.obj.taDoc.getByIdxFile(idxFile)[0].Nome;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua operazione di archiviazione file
|
||||
@@ -235,10 +251,38 @@ namespace ETS_WS
|
||||
}
|
||||
}
|
||||
}
|
||||
// sposto il file!
|
||||
fileMover.obj.muoviFile(pathOrig, pathDest, nomeFile);
|
||||
// ricalcolo nome file
|
||||
string newFileName = WebShipUtils.nomeFileFullFromIdxFile((int)newIdxFile);
|
||||
// sposto file
|
||||
fileMover.obj.muoviFile(pathOrig, pathDest, nomeFile, newFileName, true);
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna file archiviato (prendendo da temp utente!)
|
||||
/// </summary>
|
||||
/// <param name="nomeFile"></param>
|
||||
public void aggiornaFileArchiviato(string nomeFile)
|
||||
{
|
||||
lg.Info("Caricato file {0} per sostituzione", nomeFile);
|
||||
int idxFile = WebShipUtils.mng.idxFileEdit;
|
||||
// effettuo operazioni sostituzione file!
|
||||
docMetaDataSet docsData = WebShipUtils.mng.docMetaFromIdxFile(idxFile);
|
||||
string path = docsData.path;
|
||||
if (path != "")
|
||||
{
|
||||
// calcolo path
|
||||
path = string.Format("{0}{1}", utils.obj.confReadString("archiveDir"), docsData.path);
|
||||
// elimino file vecchio
|
||||
fileMover.obj.eliminaFile(path, WebShipUtils.nomeFileFullFromIdxFile(idxFile));
|
||||
// aggiorno su DB
|
||||
utils.obj.taDoc.updateFile(idxFile, utils.obj.currUserAD, nomeFile, path);
|
||||
lg.Info("Aggiornato in db nome file {0} per sostituzione", nomeFile);
|
||||
// ricalcolo nome file
|
||||
string newFileName = WebShipUtils.nomeFileFullFromIdxFile(idxFile);
|
||||
// sposto file
|
||||
fileMover.obj.muoviFile(WebShipUtils.mng.UserTempPath, path, nomeFile, newFileName, true);
|
||||
lg.Info("Spostato file {0} per sostituzione", nomeFile);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -244,26 +244,11 @@ namespace ETS_WS.WebUserControls
|
||||
grView.SelectedIndex = grView.EditIndex;
|
||||
WebShipUtils.mng.idxFileEdit = Convert.ToInt32(grView.SelectedDataKey["idxFile"]);
|
||||
string nomeFile = mod_singleFileUpload1.newFileName;
|
||||
lg.Info("Caricato file {0} per sostituzione", nomeFile);
|
||||
int idxFile = WebShipUtils.mng.idxFileEdit;
|
||||
// effettuo operazioni sostituzione file!
|
||||
docMetaDataSet docsData = WebShipUtils.mng.docMetaFromIdxFile(idxFile);
|
||||
string path = docsData.path;
|
||||
if (path != "")
|
||||
{
|
||||
// calcolo path
|
||||
path = string.Format("{0}{1}", utils.obj.confReadString("archiveDir"), docsData.path);
|
||||
// elimino file vecchio
|
||||
fileMover.obj.eliminaFile(path, WebShipUtils.mng.nomeFileFromIdxFile(idxFile));
|
||||
// sposto file
|
||||
fileMover.obj.muoviFile(WebShipUtils.mng.UserTempPath, path, nomeFile);
|
||||
lg.Info("Spostato file {0} per sostituzione", nomeFile);
|
||||
// aggiorno su DB
|
||||
utils.obj.taDoc.updateFile(WebShipUtils.mng.idxFileEdit, utils.obj.currUserAD, nomeFile, path);
|
||||
lg.Info("Aggiornato in db nome file {0} per sostituzione", nomeFile);
|
||||
// update gridview!
|
||||
grView.DataBind();
|
||||
}
|
||||
WebShipUtils.mng.aggiornaFileArchiviato(nomeFile);
|
||||
// update gridview!
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ namespace ETS_WS.WebUserControls
|
||||
// verifico attivazione button submin (ovvero ci sono tutti i valori...)
|
||||
btnSubmit.Visible = WebShipUtils.mng.metaPresent;
|
||||
// mostro gen protocolli SE ho richiesta di generare protocollo
|
||||
pnlGenDocs.Visible = WebShipUtils.mng.currMetaData.reqProto;
|
||||
pnlGenDocs.Visible = (WebShipUtils.mng.metaPresent && WebShipUtils.mng.currMetaData.reqProto);
|
||||
}
|
||||
/// <summary>
|
||||
/// richiesta update
|
||||
@@ -80,8 +80,15 @@ namespace ETS_WS.WebUserControls
|
||||
string pathDest = docsData.path;
|
||||
if (pathDest != "")
|
||||
{
|
||||
pathDest = string.Format("{0}{1}", utils.obj.confReadString("archiveDir"), docsData.path);
|
||||
string redattore = utils.obj.currUserCognomeNome; // usa utente corrente
|
||||
WebShipUtils.archiviaFile(docsData, WebShipUtils.mng.UserTempPath, pathDest, nomeFile, redattore);
|
||||
|
||||
// recupero full path del documento
|
||||
string fullPath="";
|
||||
string protocollo="1234";
|
||||
// prendo il nuovo file generato e sostituisco parte del nome con il codice protocollo
|
||||
//officeXmlMan.replaceDocxText(fullPath, "Protocollo", protocollo); // !!!FARE!!!
|
||||
}
|
||||
Response.Redirect("~/GestioneDocumenti.aspx");
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -47,6 +47,7 @@
|
||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DocumentFormat.OpenXml, Version=2.0.5022.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="NLog">
|
||||
<HintPath>..\ETS-WS\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -76,6 +77,7 @@
|
||||
<DependentUpon>DS_WebScip.xsd</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="fileMover.cs" />
|
||||
<Compile Include="officeXmlMan.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
|
||||
Reference in New Issue
Block a user