update 20260308

This commit is contained in:
Stefan Hutter
2026-03-08 14:08:06 +01:00
parent 67a60e1f43
commit 49ecd6624a
228 changed files with 8323 additions and 1332 deletions

View File

@@ -1099,14 +1099,16 @@ namespace API_NetFramework.Controllers
int i = 0;
if (archivdoc.DokumentID != "")
{
int id = 0;
if (!archivdoc.Dokument.Contains("OFFEDK"))
{
string savedokumentid = archivdoc.DokumentID;
DB db = new DB(connectionstring);
try
{
db.Get_Tabledata("Select dokumentid from OnDoc_CLM_Dokumente where clmdokumentid='" + archivdoc.DokumentID + "'", false, true);
archivdoc.DokumentID = db.dsdaten.Tables[0].Rows[0][0].ToString(); ;
db.Get_Tabledata("Select id, dokumentid from OnDoc_CLM_Dokumente where aktiv=1 and clmdokumentid='" + archivdoc.DokumentID + "'", false, true);
id = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0][0]);
archivdoc.DokumentID = db.dsdaten.Tables[0].Rows[0][1].ToString(); ;
}
catch
{
@@ -1133,6 +1135,9 @@ namespace API_NetFramework.Controllers
apiok.code = "OK";
apiok.status = "200";
apiok.documentid = archivdoc.DokumentID;
DB db = new DB(connectionstring);
db.Exec_SQL("Update ondoc_clm_dokumente set archiviert=1, archiviert_am = getdate() where id = " + id.ToString());
db = null;
return Content(HttpStatusCode.OK, apiok);
}
else

View File

@@ -1251,7 +1251,7 @@ namespace API_NetFramework.Controllers
clsdok dok = new clsdok("", "", "", "");
Logging.APIDocLog.Debug("Start GenDocCLM", "CreateCLM", guid, "");
gendocCLM(ref dokumentdaten, ref dataj, ref dok, key, clmdokumentid,archivstatus);
gendocCLM(ref dokumentdaten, ref dataj, ref dok, key, clmdokumentid,archivstatus, result);
Logging.APIDocLog.Info("Dokument abgeschlossen", "CreateDok", guid, clmdokumentid);
apiok.code = "200";
@@ -1774,7 +1774,7 @@ namespace API_NetFramework.Controllers
}
private void gendocCLM(ref List<CLMDocItem> clmdocitemlist, ref dynamic dataj, ref clsdok dok, string key, string clmdokumentid, string archivstatus = "Aktiv")
private void gendocCLM(ref List<CLMDocItem> clmdocitemlist, ref dynamic dataj, ref clsdok dok, string key, string clmdokumentid, string archivstatus = "Aktiv",string json="")
{
string OwnHost = System.Configuration.ConfigurationManager.AppSettings["OwnHost"].ToString();
string imagepath = System.Configuration.ConfigurationManager.AppSettings["VSImagePath"].ToString();
@@ -1947,7 +1947,7 @@ namespace API_NetFramework.Controllers
db.Exec_SQL("update dokument set dokumentname = dokumentname + '.pdf' where dokumentid = '" + dokumentid + "'");
}
// db.Save_To_DB(dokumentid, "", dok.dokument);
// dok = dget.GetDocAsPDF(dokumentid);
dok.extension = "pdf";
@@ -1955,11 +1955,25 @@ namespace API_NetFramework.Controllers
if (System.Configuration.ConfigurationManager.AppSettings["CLMSaveOnDoc"].ToString() == "True" || clmdokumentid != "")
{
db.Save_To_DB(dokumentid, "", dok.dokument);
string sql = "delete from ondoc_clm_dokumente where clmdokumentid ='" + dataj.Id + "'";
db.Exec_SQL(sql);
sql = "Insert OnDoc_CLM_Dokumente (dokumentid,clmdokumentid,erstellt_am,aktiv,archivstatus) values(";
sql=sql+"'"+dokumentid+"','"+dataj.Id+"',getdate(),1,'"+archivstatus+"')";
string sql = "Update ondoc_clm_dokumente set aktiv=0 where clmdokumentid = '" + dataj.Id + "'";
db.Exec_SQL(sql);
db.Get_Tabledata_for_Update("Select top 1 * from ondoc_clm_dokumente where id=-1", false, true);
DataRow dr1 = db.daten.Tables[0].NewRow();
dr1[1] = dokumentid;
dr1[2] = dataj.Id;
dr1[3] = DateTime.Now.ToString();
dr1[4] = true;
dr1[5] = archivstatus;
dr1[6] = 0;
dr1[7] = json;
dr1[8] = guid;
db.daten.Tables[0].Rows.Add(dr1);
db.Update_Data();
dr1 = null;
//sql = "Insert OnDoc_CLM_Dokumente (dokumentid,clmdokumentid,erstellt_am,aktiv,archivstatus) values(";
//sql=sql+"'"+dokumentid+"','"+dataj.Id+"',getdate(),1,'"+archivstatus+"')";
//db.Exec_SQL(sql);
//string sql = "Insert OnDoc_CLM_DocReference ";
//sql = sql + "(ondocdokumentid, clmdokumentid, erstellt_am,aktiv) ";
//sql = sql + "values('"+ dokdata.Dokumentid+","