Aggiunta versione prototipo creazione/archiviazione da template file
This commit is contained in:
@@ -193,6 +193,52 @@ namespace ETS_WS
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua operazione di archiviazione file
|
||||
/// </summary>
|
||||
/// <param name="docsData">oggetto metadati documento</param>
|
||||
/// <param name="pathOrig">path origine del file</param>
|
||||
/// <param name="pathDest">path di destinazione del file</param>
|
||||
/// <param name="nomeFile">nome del file da archiviare</param>
|
||||
/// <param name="redattore">redattore</param>
|
||||
public static void archiviaFile(docMetaDataSet docsData, string pathOrig, string pathDest, string nomeFile, string redattore)
|
||||
{
|
||||
string autore = ""; // tolto!
|
||||
string numComm = "";
|
||||
string annoComm = "";
|
||||
// ricavo num ed anno commessa...
|
||||
try
|
||||
{
|
||||
numComm = docsData.commessa.Substring(0, docsData.commessa.IndexOf("-"));
|
||||
annoComm = docsData.commessa.Substring(docsData.commessa.IndexOf("-") + 1);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// salvo su db le info del file...
|
||||
int? newIdxFile = 0;
|
||||
utils.obj.taDoc.insertQuery(nomeFile, pathDest, utils.obj.currUserAD, docsData.reqProto, docsData.dataRic, docsData.dataDoc, numComm, annoComm, docsData.fase, docsData.fonte, docsData.oggetto, docsData.InOut, autore, redattore, docsData.isRed, ref newIdxFile);
|
||||
// salvo i tags!
|
||||
if (newIdxFile > 0)
|
||||
{
|
||||
// se ho tags...
|
||||
if (docsData.tags.Count > 0)
|
||||
{
|
||||
foreach (string tag in docsData.tags)
|
||||
{
|
||||
try
|
||||
{
|
||||
utils.obj.taTags2Doc.Insert((int)newIdxFile, Convert.ToInt32(tag));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
// sposto il file!
|
||||
fileMover.obj.muoviFile(pathOrig, pathDest, nomeFile);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -200,19 +200,16 @@ namespace ETS_WS.WebUserControls
|
||||
// recupero metadati da sessione...
|
||||
docMetaDataSet docsData = WebShipUtils.mng.currMetaData;
|
||||
//check del path
|
||||
string path = docsData.path;
|
||||
string pathDest = docsData.path;
|
||||
// verifico path presente
|
||||
if (path != "")
|
||||
if (pathDest != "")
|
||||
{
|
||||
// aggiunto al path cartella archivio...
|
||||
path = string.Format("{0}{1}", utils.obj.confReadString("archiveDir"), docsData.path);
|
||||
pathDest = string.Format("{0}{1}", utils.obj.confReadString("archiveDir"), docsData.path);
|
||||
// verifico path valido o creo...
|
||||
fileMover.checkDir(path);
|
||||
fileMover.checkDir(pathDest);
|
||||
string nomeFile = "";
|
||||
string autore = ""; // tolto!
|
||||
string redattore = utils.obj.currUserCognomeNome; // usa utente corrente
|
||||
string numComm = "";
|
||||
string annoComm = "";
|
||||
// sposto i files selezionati secondo i dati in sessione
|
||||
foreach (GridViewRow riga in grView.Rows)
|
||||
{
|
||||
@@ -220,36 +217,7 @@ namespace ETS_WS.WebUserControls
|
||||
{
|
||||
// devo salvare file con le info relative...
|
||||
nomeFile = ((HyperLink)riga.FindControl("hlNome")).Text;
|
||||
// ricavo num ed anno commessa...
|
||||
try
|
||||
{
|
||||
numComm = docsData.commessa.Substring(0, docsData.commessa.IndexOf("-"));
|
||||
annoComm = docsData.commessa.Substring(docsData.commessa.IndexOf("-") + 1);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// salvo su db le info del file...
|
||||
int? newIdxFile = 0;
|
||||
utils.obj.taDoc.insertQuery(nomeFile, path, utils.obj.currUserAD, docsData.reqProto, docsData.dataRic, docsData.dataDoc, numComm, annoComm, docsData.fase, docsData.fonte, docsData.oggetto, docsData.InOut, autore, redattore, docsData.isRed, ref newIdxFile);
|
||||
// salvo i tags!
|
||||
if (newIdxFile > 0)
|
||||
{
|
||||
// se ho tags...
|
||||
if (docsData.tags.Count > 0)
|
||||
{
|
||||
foreach (string tag in docsData.tags)
|
||||
{
|
||||
try
|
||||
{
|
||||
utils.obj.taTags2Doc.Insert((int)newIdxFile, Convert.ToInt32(tag));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
// sposto il file!
|
||||
fileMover.obj.muoviFile(WebShipUtils.mng.UserTempPath, path, nomeFile);
|
||||
WebShipUtils.archiviaFile(docsData, WebShipUtils.mng.UserTempPath, pathDest, nomeFile, redattore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,19 @@ namespace ETS_WS.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void btnStaccaProto_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
// effettua upload del documento "dummy" proto
|
||||
string nomeFile = "Proto.txt";
|
||||
fileMover.obj.muoviFile("~/DocTemplates/", WebShipUtils.mng.UserTempPath, nomeFile, false);
|
||||
// stacco un nuovo protocollo!
|
||||
docMetaDataSet docsData = WebShipUtils.mng.currMetaData;
|
||||
//check del path
|
||||
string pathDest = docsData.path;
|
||||
if (pathDest != "")
|
||||
{
|
||||
string redattore = utils.obj.currUserCognomeNome; // usa utente corrente
|
||||
WebShipUtils.archiviaFile(docsData, WebShipUtils.mng.UserTempPath, pathDest, nomeFile, redattore);
|
||||
}
|
||||
Response.Redirect("~/GestioneDocumenti.aspx");
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user