update 20241113
This commit is contained in:
@@ -101,7 +101,7 @@ namespace OnDoc.UIControls
|
||||
{
|
||||
return dok; ;
|
||||
}
|
||||
if (AppParams.RESTURI != "")
|
||||
if (AppParams.UseAPI == "YES")
|
||||
{
|
||||
string URL = AppParams.RESTURI + "api/GetDocument?dokid=" + dokumentid;
|
||||
if (AsPDF == true)
|
||||
|
||||
@@ -286,7 +286,7 @@ namespace OnDoc.UICintrols
|
||||
{
|
||||
return dok; ;
|
||||
}
|
||||
if (AppParams.RESTURI != "")
|
||||
if (AppParams.UseAPI == "YES")
|
||||
{
|
||||
string URL = AppParams.RESTURI + "api/GetDocument?dokid=" + selected_dokumentid;
|
||||
if (AsPDF == true)
|
||||
@@ -557,6 +557,8 @@ namespace OnDoc.UICintrols
|
||||
case 3:
|
||||
break;
|
||||
case 4:
|
||||
archivedoc(frmnewdok.dokumentid);
|
||||
|
||||
break;
|
||||
case 5:
|
||||
break;
|
||||
@@ -824,6 +826,35 @@ namespace OnDoc.UICintrols
|
||||
nv.Show();
|
||||
}
|
||||
|
||||
private void archivedoc (string documentid)
|
||||
{
|
||||
string URL = AppParams.RESTURI + "api/ArchiveDocFromDatabase?dokumentid=" + documentid;
|
||||
|
||||
HttpWebRequest webRequest = HttpWebRequest.Create(URL) as HttpWebRequest;
|
||||
webRequest.Method = WebRequestMethods.Http.Get;
|
||||
webRequest.Headers["Authorization"] = "Bearer " + AppParams.apikey;
|
||||
try
|
||||
{
|
||||
using (HttpWebResponse response = webRequest.GetResponse() as HttpWebResponse)
|
||||
{
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
StreamReader reader = new StreamReader(response.GetResponseStream());
|
||||
string responseContent = reader.ReadToEnd();
|
||||
Logging.DocLog.Info("Dokument archiviert", "OnDoc", documentid, "", "Dokument archiviert und abgeschlossen");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Die Archivierung des Dokumentes " + documentid + " wurde abgebrochen." + Environment.NewLine + "Fehler: " + response.StatusDescription);
|
||||
Logging.Logging.Error(URL + ": " + response.StatusCode.ToString() + " / " + response.StatusDescription, "Clinet - DokList GetDocument", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Die Archivierung des Dokumentes " + documentid + " konnte nicht durchgeführt werden." + Environment.NewLine + "Fehler: " + ex.Message);
|
||||
}
|
||||
}
|
||||
private void RibbonButtonArchivToOnBase_Click(object sender, EventArgs e)
|
||||
{
|
||||
var records = sfDataGrid1.View.GetSelectedRecords();
|
||||
@@ -836,8 +867,9 @@ namespace OnDoc.UICintrols
|
||||
|
||||
var datarow = record as DataRowView;
|
||||
string documentid = datarow["dokumentid"].ToString();
|
||||
|
||||
archivedoc(documentid);
|
||||
string URL = AppParams.RESTURI + "api/ArchiveDocFromDatabase?dokumentid=" + documentid;
|
||||
|
||||
|
||||
HttpWebRequest webRequest = HttpWebRequest.Create(URL) as HttpWebRequest;
|
||||
webRequest.Method = WebRequestMethods.Http.Get;
|
||||
|
||||
Reference in New Issue
Block a user