updaet 20250226

This commit is contained in:
Stefan Hutter
2025-02-26 07:54:12 +01:00
parent 0f76b2b376
commit d745bb8ead
47 changed files with 205 additions and 39 deletions

View File

@@ -401,6 +401,7 @@
<Reference Include="System.Core" />
<Reference Include="System.Design" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Management" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Transactions" />
<Reference Include="System.Web" />

View File

@@ -64,7 +64,7 @@
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(177, 26);
this.label2.TabIndex = 2;
this.label2.Text = "23. Februar 2025";
this.label2.Text = "25. Februar 2025";
//
// SplashScreen
//

View File

@@ -446,7 +446,7 @@ namespace OnDoc.DocMgmt
//
this.ordnerLöschenToolStripMenuItem.Name = "ordnerLöschenToolStripMenuItem";
this.ordnerLöschenToolStripMenuItem.Size = new System.Drawing.Size(308, 22);
this.ordnerLöschenToolStripMenuItem.Text = "Vorlage / Ordner mit Unterlementen löschen";
this.ordnerLöschenToolStripMenuItem.Text = "Vorlage / Ordner mit Unterelementen löschen";
this.ordnerLöschenToolStripMenuItem.Click += new System.EventHandler(this.ordnerLöschenToolStripMenuItem_Click);
//
// detailsAnzeigenToolStripMenuItem1
@@ -534,7 +534,7 @@ namespace OnDoc.DocMgmt
this.tsbtndelete.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbtndelete.Name = "tsbtndelete";
this.tsbtndelete.Size = new System.Drawing.Size(48, 48);
this.tsbtndelete.Text = "Vorlage / Ordner mit Unterlementen löschen";
this.tsbtndelete.Text = "Vorlage / Ordner mit Unterelementen löschen";
this.tsbtndelete.Click += new System.EventHandler(this.tsbtndelete_Click);
//
// grpVorlagen

View File

@@ -26,7 +26,7 @@ namespace OnDoc.Klassen
public static string UseAPI { get; set; } = "FALSE";
public static int CurrentMitarbeiter { get; set; }
public static string CurrentTGNummer { get; set; } = "";
public static string RESTURI { get; set; } = "";//"http://localhost:2032/";
public static string apikey { get; set; } = "";
@@ -39,6 +39,8 @@ namespace OnDoc.Klassen
public static bool isSysadmin { get; set; } = false;
public static bool showlogin { get; set; } = false;
public static string currenttgnummer { get; set; }="";
public static string systemtgnummer { get; set; } = "";
public static string umgebung { get; set; } = "";
public static string ZusatzFont { get; set; } = "";
public static string ZusatzFontSize { get; set; } = "";

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Management;
using System.Security.AccessControl;
using System.Text;
using System.Threading;
@@ -50,6 +51,27 @@ namespace OnDoc.Klassen
}
}
private static string GetProcessOwner(int processId)
{
string query = "SELECT * FROM Win32_Process WHERE ProcessID = " + processId;
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
ManagementObjectCollection processList = searcher.Get();
foreach (ManagementObject obj in processList)
{
string[] argList = new string[] { string.Empty, string.Empty };
int returnVal = Convert.ToInt32(obj.InvokeMethod("GetOwner", argList));
if (returnVal == 0)
{
// return DOMAIN\user
return argList[1] + "\\" + argList[0];
}
}
searcher = null;
return "NO OWNER";
}
private static void WatchProcesses(object source, ElapsedEventArgs e)
{
bool word = false;
@@ -81,26 +103,45 @@ namespace OnDoc.Klassen
foreach (Process p in localByName)
{
Logging.Logging.Debug(fc.dokumentid + "/" + p.MainWindowTitle, "", "");
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1 || p.MainWindowTitle.Trim() == "")
string owner = GetProcessOwner(p.Id);
owner = owner.ToUpper();
Logging.Logging.Debug(AppParams.systemtgnummer+"/"+AppParams.currenttgnummer+"/"+owner+"/"+fc.dokumentid + "/" + p.MainWindowTitle, "", "");
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1 ||
(p.MainWindowTitle.Trim() == "" && owner.Contains(AppParams.systemtgnummer.ToUpper())))
{
if (p.MainWindowTitle.Trim() != "") { fc.Lastfound = DateTime.Now; }
found = true;
save_to_db(fc);
break;
}
}
//foreach (Process p in localByName)
//{
// Logging.Logging.Debug(fc.dokumentid + "/" + p.MainWindowTitle, "", "");
// if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1 || p.MainWindowTitle.Trim() == "")
// {
// if (p.MainWindowTitle.Trim() != "") { fc.Lastfound = DateTime.Now; }
// found = true;
// save_to_db(fc);
// break;
// }
//}
}
if (excel)
{
Process[] localByName = Process.GetProcessesByName("EXCEL");
foreach (Process p in localByName)
{
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1 || p.MainWindowTitle.Trim() == "")
string owner = GetProcessOwner(p.Id);
owner = owner.ToUpper();
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1 ||
(p.MainWindowTitle.Trim() == "" && owner.Contains(AppParams.systemtgnummer.ToUpper())))
{
if (p.MainWindowTitle.Trim() != "") { fc.Lastfound = DateTime.Now; }
found = true;
@@ -108,6 +149,17 @@ namespace OnDoc.Klassen
}
}
//Process[] localByName = Process.GetProcessesByName("EXCEL");
//foreach (Process p in localByName)
//{
// if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1 || p.MainWindowTitle.Trim() == "")
// {
// if (p.MainWindowTitle.Trim() != "") { fc.Lastfound = DateTime.Now; }
// found = true;
// save_to_db(fc);
// }
//}
}
if (!found)
{

View File

@@ -58,6 +58,7 @@ namespace OnDoc
mitarbeiter = mitarbeiter.Substring(mitarbeiter.IndexOf("\\") + 1);
Logging.Logging.Debug("EDK-Umleitung", args[0], "");
AppParams.currenttgnummer = mitarbeiter;
AppParams.systemtgnummer = mitarbeiter;
db.Get_Tabledata("Select count(*) from ondoc_edk_routing where aktiv=1 and tgnummer='" + AppParams.currenttgnummer + "'", false, true);
if (Convert.ToInt32(db.dsdaten.Tables[0].Rows[0][0]) > 0)
{

View File

@@ -54,9 +54,10 @@ namespace OnDoc
Logging.Logging.Debug("Start", "OnDoc-Client", "");
mitarbeiter = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
mitarbeiter = mitarbeiter.Substring(mitarbeiter.IndexOf("\\") + 1);
Logging.Logging.Debug("Start", "start.cs", mitarbeiter);
AppParams.systemtgnummer = mitarbeiter;
Logging.Logging.Info("Start", "start.cs", mitarbeiter);
DB db = new DB(AppParams.connectionstring);
db.Get_Tabledata("Select mitarbeiternr, tgnummer from mitarbeiter where aktiv = 1 and tgnummer='" + mitarbeiter + "'", false, true); if (db.dsdaten.Tables[0].Rows.Count == 0)

View File

@@ -65,6 +65,8 @@
this.ribbonButtonNotApproved = new System.Windows.Forms.RibbonButton();
this.ribbonPanel2 = new System.Windows.Forms.RibbonPanel();
this.ribbonButton1 = new System.Windows.Forms.RibbonButton();
this.panelsign = new System.Windows.Forms.Panel();
this.label5 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -72,6 +74,7 @@
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.treeViewAdv1)).BeginInit();
this.grpDetails.SuspendLayout();
this.panelsign.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
@@ -86,6 +89,7 @@
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.panelsign);
this.splitContainer1.Panel2.Controls.Add(this.panel1);
this.splitContainer1.Panel2.Controls.Add(this.grpDetails);
this.splitContainer1.Panel2.Controls.Add(this.docPreview1);
@@ -492,6 +496,26 @@
this.ribbonButton1.Text = "Aktualisieren";
this.ribbonButton1.Click += new System.EventHandler(this.ribbonButton1_Click);
//
// panelsign
//
this.panelsign.BackColor = System.Drawing.SystemColors.ActiveBorder;
this.panelsign.Controls.Add(this.label5);
this.panelsign.Location = new System.Drawing.Point(117, 47);
this.panelsign.Name = "panelsign";
this.panelsign.Size = new System.Drawing.Size(804, 167);
this.panelsign.TabIndex = 5;
this.panelsign.Visible = false;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label5.Location = new System.Drawing.Point(188, 81);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(390, 24);
this.label5.TabIndex = 0;
this.label5.Text = "Das Dokument wird signiert - bitte warten";
//
// Approval
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -507,6 +531,8 @@
((System.ComponentModel.ISupportInitialize)(this.treeViewAdv1)).EndInit();
this.grpDetails.ResumeLayout(false);
this.grpDetails.PerformLayout();
this.panelsign.ResumeLayout(false);
this.panelsign.PerformLayout();
this.ResumeLayout(false);
}
@@ -544,5 +570,7 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.RibbonPanel ribbonPanel2;
private System.Windows.Forms.RibbonButton ribbonButton1;
private System.Windows.Forms.Panel panelsign;
private System.Windows.Forms.Label label5;
}
}

View File

@@ -202,6 +202,7 @@ namespace OnDoc.UIControls
}
else
{
db.Exec_SQL("Update dokument set approval1=1 where dokumentid='" + dr["dokumentid"].ToString()+"'");
}
@@ -212,6 +213,8 @@ namespace OnDoc.UIControls
db.Get_Tabledata("Select * from dokument where dokumentid='" + dr["dokumentid"].ToString() + "'", false, true);
if (db.dsdaten.Tables[0].Rows[0]["approved"].ToString()=="True")
{
panelsign.Visible = true;
Application.DoEvents();
Cursor = Cursors.WaitCursor;
DOCGEN.DocGen dg = new DocGen(AppParams.connectionstring, AppParams.RESTURI, AppParams.apikey);
if (dg.signdoc(dr["dokumentid"].ToString(), AppParams.tempdir))
@@ -219,6 +222,8 @@ namespace OnDoc.UIControls
db.Exec_SQL("Update Dokument set signiert=1, mutierer=" + AppParams.CurrentMitarbeiter.ToString() + ", mutiertam=getdate() where dokumentid='" + dr["dokumentid"].ToString() + "'");
}
dg = null;
panelsign.Visible = false;
Application.DoEvents();
Cursor = Cursors.Default;
}

View File

@@ -814,7 +814,7 @@ namespace OnDoc.UICintrols
this.ribbonButton3.MinSizeMode = System.Windows.Forms.RibbonElementSizeMode.Medium;
this.ribbonButton3.Name = "ribbonButton3";
this.ribbonButton3.SmallImage = global::OnDoc.Properties.Resources.Partner_16x16_32;
this.ribbonButton3.Text = "Partner";
this.ribbonButton3.Text = "Kunde";
this.ribbonButton3.Click += new System.EventHandler(this.ribbonButton3_Click_1);
//
// RibbonGroupFilter

View File

@@ -1417,7 +1417,14 @@ namespace OnDoc.UICintrols
{
StreamReader reader = new StreamReader(response.GetResponseStream());
string responseContent = reader.ReadToEnd();
Logging.DocLog.Info("Dokument archiviert", "OnDoc", documentid, "", "Dokument archiviert und abgeschlossen");
if (responseContent.Contains("Hinweismeldung:"))
{
MessageBox.Show("Die Archivierung des Dokumentes " + documentid + " wurde nicht durchgeführt:" + Environment.NewLine + responseContent);
return;
}
Logging.DocLog.Info("Dokument archiviert", "OnDoc", documentid, "", "Dokument archiviert und abgeschlossen");
}
else
{
@@ -1437,7 +1444,7 @@ namespace OnDoc.UICintrols
{
var records = sfDataGrid1.View.GetSelectedRecords();
if (records.Count < 1) { return; }
if (MessageBox.Show("Gewählte Dokument(e) archiviern und abschliessen", "Dokument archivieren und abschliessen", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; }
if (MessageBox.Show("Gewählte Dokument(e) archivieren und abschliessen?", "Dokument archivieren und abschliessen", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; }
DB db = new DB(AppParams.connectionstring);
Cursor = Cursors.WaitCursor;

View File

@@ -84,6 +84,7 @@ namespace OnDoc.UIControls
try
{
TableHelper.FormatTable(ref clsPartner.partnerliste, "Partner", ref trefferlistedata, true);
trefferlistedata.Columns[0].HeaderText = "Kunden-Nr.";
try
{
trefferlistedata.Columns[0].Width = trefferlistedata.Columns[0].Width + 20;

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
34c3609b08e0edcfa9562aab3046bc82a3e9b1c632b03c992c222fe1502d3c2a
306896684bce3851df942bde604ba5f484881e00d57a1005c56d5b6b051718b6

Binary file not shown.

Binary file not shown.