Update 20250618
This commit is contained in:
@@ -33,25 +33,6 @@
|
||||
<value>x:\ondoc_archivierung_batch_log.txt</value>
|
||||
</setting>
|
||||
</OnDoc_ArchivierungBatch.Properties.Settings>
|
||||
<OnDoc_Paketversand.Properties.Settings>
|
||||
<setting name="Connectionstring" serializeAs="String">
|
||||
<value>Data source=shu01\shu00;initial catalog=edoka_dms;;persist security info=false;workstation id=;packet size=4096;user id=sa;password=*shu29</value>
|
||||
</setting>
|
||||
<setting name="RESTURI" serializeAs="String">
|
||||
<value>https://localhost:44334/</value>
|
||||
</setting>
|
||||
<setting name="APIKey" serializeAs="String">
|
||||
<value>pZkuG6l6ORCEckqQimPK58PO1A9EnkMtL5oCgRX9WiWnD4xeH7ikGzhWnTBy/vk8J4Iiz8gCSx9uFHA4+DvITG0roO97sk82d/0BCjVlwLWINpXlJfGYEF3X96AdoCQvb3ruwv/tVqEHsSU5aNfyxBAe+EhLTHQ8t7ysgJZWh98=</value>
|
||||
</setting>
|
||||
<setting name="LogConnectionstring" serializeAs="String">
|
||||
<value>Data source=shu01\shu00;initial catalog=edoka_journale;;persist security info=false;workstation id=;packet size=4096;user id=sa;password=*shu29</value>
|
||||
</setting>
|
||||
<setting name="adminmail" serializeAs="String">
|
||||
<value>dm@tkb.ch</value>
|
||||
</setting>
|
||||
<setting name="prefix_betreff" serializeAs="String">
|
||||
<value>INT: </value>
|
||||
</setting>
|
||||
</OnDoc_Paketversand.Properties.Settings>
|
||||
|
||||
</userSettings>
|
||||
</configuration>
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace OnDoc_ArchivierungBatch
|
||||
private static int total = 0;
|
||||
private static int ok = 0;
|
||||
private static int error = 0;
|
||||
private static int docerror = 0;
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
@@ -39,7 +40,7 @@ namespace OnDoc_ArchivierungBatch
|
||||
private static void archivedoc(string documentid)
|
||||
{
|
||||
write_log(documentid);
|
||||
string URL = Properties.Settings.Default.RESTURI + "api/ /ArchiveDocFromDatabase?dokumentid=" + documentid;
|
||||
string URL = Properties.Settings.Default.RESTURI + "api/ArchiveDocFromDatabase?dokumentid=" + documentid;
|
||||
|
||||
HttpWebRequest webRequest = HttpWebRequest.Create(URL) as HttpWebRequest;
|
||||
webRequest.Method = WebRequestMethods.Http.Get;
|
||||
@@ -56,14 +57,17 @@ namespace OnDoc_ArchivierungBatch
|
||||
{
|
||||
write_log("Die Archivierung des Dokumentes " + documentid + " wurde nicht durchgeführt:" + Environment.NewLine + responseContent);
|
||||
error = error + 1;
|
||||
docerror = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
ok = ok + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
write_log("Die Archivierung des Dokumentes " + documentid + " wurde abgebrochen." + Environment.NewLine + "Fehler: " + response.StatusDescription);
|
||||
error = error + 1;
|
||||
docerror = 1;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -72,17 +76,37 @@ namespace OnDoc_ArchivierungBatch
|
||||
{
|
||||
write_log("Die Archivierung des Dokumentes " + documentid + " konnte nicht durchgeführt werden." + Environment.NewLine + "Fehler: " + ex.Message);
|
||||
error = error + 1;
|
||||
docerror = 1;
|
||||
|
||||
}
|
||||
}
|
||||
public static void Exec_SQL(string sql)
|
||||
{
|
||||
SqlConnection sqlconnect = new SqlConnection();
|
||||
SqlCommand sqlcmd = new SqlCommand();
|
||||
sqlcmd.Connection = sqlconnect;
|
||||
sqlconnect.ConnectionString = Properties.Settings.Default.Connectionstring;
|
||||
sqlcmd.CommandType = CommandType.Text;
|
||||
sqlcmd.CommandText = sql;
|
||||
sqlcmd.Connection.Open();
|
||||
sqlcmd.ExecuteNonQuery();
|
||||
sqlcmd.Connection.Close();
|
||||
|
||||
}
|
||||
private static void run()
|
||||
{
|
||||
|
||||
connectionstring = Properties.Settings.Default.Connectionstring;
|
||||
Get_Tabledata("Select dokumentid from dokument where automatischearchivierung=1 and isnull(utomatischarchiviertam,0)=0");
|
||||
Get_Tabledata("Select dokumentid from dokument where automatischearchivierung=1 and dbo.fnkt_check_archived(dokumentid)=0 and dokumentid not in (select dokumentid from dokinbearbeitung where dokumentid=dokument.dokumentid) ",false,true);
|
||||
|
||||
foreach (System.Data.DataRow dr in dsdaten.Tables[0].Rows)
|
||||
{
|
||||
docerror = 0;
|
||||
archivedoc(dr[0].ToString());
|
||||
if (docerror == 0)
|
||||
{
|
||||
Exec_SQL("Update dokument set automatischarchiviertam=getdate() where dokumentid='" + dr[0].ToString() + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -33,25 +33,6 @@
|
||||
<value>x:\ondoc_archivierung_batch_log.txt</value>
|
||||
</setting>
|
||||
</OnDoc_ArchivierungBatch.Properties.Settings>
|
||||
<OnDoc_Paketversand.Properties.Settings>
|
||||
<setting name="Connectionstring" serializeAs="String">
|
||||
<value>Data source=shu01\shu00;initial catalog=edoka_dms;;persist security info=false;workstation id=;packet size=4096;user id=sa;password=*shu29</value>
|
||||
</setting>
|
||||
<setting name="RESTURI" serializeAs="String">
|
||||
<value>https://localhost:44334/</value>
|
||||
</setting>
|
||||
<setting name="APIKey" serializeAs="String">
|
||||
<value>pZkuG6l6ORCEckqQimPK58PO1A9EnkMtL5oCgRX9WiWnD4xeH7ikGzhWnTBy/vk8J4Iiz8gCSx9uFHA4+DvITG0roO97sk82d/0BCjVlwLWINpXlJfGYEF3X96AdoCQvb3ruwv/tVqEHsSU5aNfyxBAe+EhLTHQ8t7ysgJZWh98=</value>
|
||||
</setting>
|
||||
<setting name="LogConnectionstring" serializeAs="String">
|
||||
<value>Data source=shu01\shu00;initial catalog=edoka_journale;;persist security info=false;workstation id=;packet size=4096;user id=sa;password=*shu29</value>
|
||||
</setting>
|
||||
<setting name="adminmail" serializeAs="String">
|
||||
<value>dm@tkb.ch</value>
|
||||
</setting>
|
||||
<setting name="prefix_betreff" serializeAs="String">
|
||||
<value>INT: </value>
|
||||
</setting>
|
||||
</OnDoc_Paketversand.Properties.Settings>
|
||||
|
||||
</userSettings>
|
||||
</configuration>
|
||||
|
||||
Binary file not shown.
BIN
OnDoc_ArchivierungBatch/bin/Debug/OnDoc_Archivierung_Batch.zip
Normal file
BIN
OnDoc_ArchivierungBatch/bin/Debug/OnDoc_Archivierung_Batch.zip
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user