fix errore creazioen nuovi tempalte metadati
This commit is contained in:
@@ -688,7 +688,9 @@
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="DocTemplates\ETS-Fax.docx" />
|
||||
<None Include="DocTemplates\ETS-Fax_noPrj.docx" />
|
||||
<None Include="DocTemplates\ETS-Lettera.docx" />
|
||||
<None Include="DocTemplates\ETS-Lettera_noPrj.docx" />
|
||||
<None Include="DocTemplates\ETS-Proto.docx" />
|
||||
<None Include="DocTemplates\PlaceHolder.file" />
|
||||
<Content Include="logs\PlaceHolder.file" />
|
||||
|
||||
@@ -219,6 +219,54 @@ namespace ETS_WS
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// commessa del file da idx DB
|
||||
/// </summary>
|
||||
/// <param name="idxFile"></param>
|
||||
/// <returns></returns>
|
||||
public static string commessaFromIdxFile(int idxFile)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = string.Format("{0}", utils.obj.taDoc.getByIdxFile(idxFile)[0].Commessa);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// oggetto del file da idx DB
|
||||
/// </summary>
|
||||
/// <param name="idxFile"></param>
|
||||
/// <returns></returns>
|
||||
public static string oggettoFromIdxFile(int idxFile)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = string.Format("{0}", utils.obj.taDoc.getByIdxFile(idxFile)[0].Oggetto);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// fonte del file da idx DB
|
||||
/// </summary>
|
||||
/// <param name="idxFile"></param>
|
||||
/// <returns></returns>
|
||||
public static string fonteFromIdxFile(int idxFile)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = string.Format("{0}", utils.obj.taDoc.getByIdxFile(idxFile)[0].Fonte);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// statored/pubblico da idx DB
|
||||
/// </summary>
|
||||
/// <param name="idxFile"></param>
|
||||
@@ -603,12 +651,19 @@ namespace ETS_WS
|
||||
// recupero full path del documento
|
||||
string fullPath = HttpContext.Current.Server.MapPath(string.Format("{0}{1}", pathDest, WebShipUtils.nomeFileFullFromIdxFile(idxFile)));
|
||||
string protocollo = WebShipUtils.protocolloFromIdxFile(idxFile);
|
||||
string commessa = WebShipUtils.commessaFromIdxFile(idxFile);
|
||||
string oggetto = WebShipUtils.oggettoFromIdxFile(idxFile);
|
||||
string fonte = WebShipUtils.fonteFromIdxFile(idxFile);
|
||||
// se il nome contiene "docx" faccio sostituzioni...
|
||||
if (nomeTemplate.IndexOf("docx") >= 0)
|
||||
{
|
||||
// prendo il nuovo file generato e sostituisco parte del nome con il codice protocollo // link: msdn.microsoft.com/en-us/library/bb508261.aspx
|
||||
officeXmlMan.replaceDocxText(fullPath, "{{Protocollo}}", protocollo);
|
||||
officeXmlMan.replaceDocxText(fullPath, "{{DataDoc}}", docsData.dataDoc.ToShortDateString());
|
||||
officeXmlMan.replaceDocxText(fullPath, "{{Anno}}", docsData.dataDoc.Year.ToString());
|
||||
officeXmlMan.replaceDocxText(fullPath, "{{Commessa}}", commessa);
|
||||
officeXmlMan.replaceDocxText(fullPath, "{{Oggetto}}", oggetto);
|
||||
officeXmlMan.replaceDocxText(fullPath, "{{Fonte}}", fonte);
|
||||
officeXmlMan.replaceDocxText(fullPath, "{{Redattore}}", utils.obj.currUserCognomeNome);
|
||||
}
|
||||
else if (nomeTemplate.IndexOf("eml") >= 0)
|
||||
|
||||
@@ -308,8 +308,11 @@ namespace ETS_WS.WebUserControls
|
||||
string setName = txtNomeTMD.Text.Trim();
|
||||
if (setName != "")
|
||||
{
|
||||
// elimino eventuale velore vecchio!
|
||||
WebShipUtils.mng.eliminaTemplateMedatati(utils.obj.currUserId, dlElencoTemplate.SelectedValue);
|
||||
// elimino eventuale velore vecchio SE nuovo = selected!
|
||||
if (dlElencoTemplate.SelectedValue == setName)
|
||||
{
|
||||
WebShipUtils.mng.eliminaTemplateMedatati(utils.obj.currUserId, dlElencoTemplate.SelectedValue);
|
||||
}
|
||||
// salvo!
|
||||
WebShipUtils.mng.salvaTemplateMedatati(utils.obj.currUserId, setName, metaDatiDoc);
|
||||
}
|
||||
|
||||
@@ -55,11 +55,12 @@ namespace ETS_WS.WebUserControls
|
||||
{
|
||||
// aggiorno
|
||||
updateVisual();
|
||||
// indico evento di richeista spostamento
|
||||
// indico evento di richiesta spostamento
|
||||
if (eh_reqSalva != null)
|
||||
{
|
||||
eh_reqSalva(this, new EventArgs());
|
||||
}
|
||||
Response.Redirect("~/GestioneDocumenti.aspx");
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
@@ -145,8 +146,14 @@ namespace ETS_WS.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void btnGenLettera_Click(object sender, EventArgs e)
|
||||
{
|
||||
// effettua upload del documento "dummy" lettera
|
||||
// nome standard con commessa...
|
||||
string nomeFile = "ETS-Lettera.docx";
|
||||
// controllo se NON c'è una commessa/progetto...
|
||||
if (WebShipUtils.mng.currMetaData.commessa.IndexOf("0000") < 0)
|
||||
{
|
||||
nomeFile = "ETS-Lettera_noPrj.docx";
|
||||
}
|
||||
// effettua upload del documento "dummy" lettera
|
||||
WebShipUtils.mng.generaDocDaTemplate(nomeFile, WebShipUtils.mng.currMetaData);
|
||||
WebShipUtils.dateIsOk(DateTime.Now);
|
||||
Response.Redirect("~/GestioneDocumenti.aspx");
|
||||
@@ -158,8 +165,14 @@ namespace ETS_WS.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void btnGenFax_Click(object sender, EventArgs e)
|
||||
{
|
||||
// effettua upload del documento "dummy" fax
|
||||
// nome standard con commessa...
|
||||
string nomeFile = "ETS-Fax.docx";
|
||||
// controllo se NON c'è una commessa/progetto...
|
||||
if (WebShipUtils.mng.currMetaData.commessa.IndexOf("0000") < 0)
|
||||
{
|
||||
nomeFile = "ETS-Fax_noPrj.docx";
|
||||
}
|
||||
// effettua upload del documento "dummy" fax
|
||||
WebShipUtils.mng.generaDocDaTemplate(nomeFile, WebShipUtils.mng.currMetaData);
|
||||
WebShipUtils.dateIsOk(DateTime.Now);
|
||||
Response.Redirect("~/GestioneDocumenti.aspx");
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user