update 20250406

This commit is contained in:
Stefan Hutter
2025-04-06 07:39:53 +02:00
parent 632b97c292
commit 42c86d957c
155 changed files with 1725 additions and 607 deletions

View File

@@ -122,7 +122,7 @@ namespace OnDoc.UIControls.Administrator
db.Get_Tabledata("Select * from Dokumenttyp_BP_Person_Erstellung where dokumenttypnr=" + dokumenttypnr.ToString(), false, true);
if (db.dsdaten.Tables[0].Rows.Count != 0)
{
erstellungstyp = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0][0]);
erstellungstyp = Convert.ToInt32(db.dsdaten.Tables[0].Rows[0][1]);
}
db.Get_Tabledata("Select * from dokumenttyp where dokumenttypnr = " + dokumenttypnr.ToString(), false, true);

View File

@@ -1,6 +1,8 @@
using Database;
using DOCGEN;
using Microsoft.Office.Interop.Word;
using Model;
using OnDoc.Helper;
using OnDoc.Klassen;
using System;
using System.Collections.Generic;
@@ -12,6 +14,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Web.UI.WebControls.Expressions;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace OnDoc.UIControls
{
@@ -21,6 +24,8 @@ namespace OnDoc.UIControls
public int einzeldokument { get; set; } = 0;
public bool dokumentpaket { get; set; } = false;
public string source { get; set; } = "";
public DokTypDetail()
{
InitializeComponent();
@@ -35,18 +40,20 @@ namespace OnDoc.UIControls
public void Refresh_Details()
{
DataTable details = new DataTable();
System.Data.DataTable details = new System.Data.DataTable();
details.Columns.Add("Element");
details.Columns.Add("Inhalt");
if (dokumentpaket)
{
sfDataGrid1.Dock = DockStyle.Top;
groupBox2.Dock = DockStyle.Fill;
groupBox2.Visible = true;
}
else
{
sfDataGrid1.Dock = DockStyle.Fill;
groupBox2.Visible = false;
}
@@ -124,6 +131,7 @@ namespace OnDoc.UIControls
{
DocGet dg = new DocGet(AppParams.connectionstring);
clsdok dok = new clsdok(dB.dsdaten.Tables[0].Rows[0][dc.ColumnName].ToString(), dB.dsdaten.Tables[0].Rows[0]["Applikation"].ToString(), "","");
source = dok.dokument;
string PDF = "";
switch (dB.dsdaten.Tables[0].Rows[0]["Applikation"].ToString().ToUpper())
{
@@ -148,6 +156,46 @@ namespace OnDoc.UIControls
sfDataGrid1.DataSource = details;
dB = null;
}
public string RandomString(int length)
{
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var stringChars = new char[8];
var random = new Random();
for (int i = 0; i < stringChars.Length; i++)
{
stringChars[i] = chars[random.Next(chars.Length)];
}
return new String(stringChars);
}
public void opensource()
{
DB db = new DB(AppParams.connectionstring);
db.Get_Tabledata("Select office_vorlagenr from dokumenttyp where dokumenttypnr=" + this.dokumenttypnr.ToString(), false, true);
string vorlagenr = db.dsdaten.Tables[0].Rows[0][0].ToString();
VBFileManagement.VBFileManagement vm = new VBFileManagement.VBFileManagement();
db.Get_ApplicationType_from_Vorlage(Convert.ToInt32(vorlagenr));
string type = db.dsdaten.Tables[0].Rows[0][0].ToString();
string ext = db.dsdaten.Tables[0].Rows[0][1].ToString();
string filename = AppParams.tempdir+ RandomString(12) + "." + ext;
vm.Get_From_DB(Convert.ToInt32(vorlagenr), filename, AppParams.connectionstring);
vm = null;
if (type.ToUpper().Substring(0,1) == "D" || type.ToUpper().Substring(0, 1) == "W")
{
System.Diagnostics.Process.Start("winword.exe", "/n " + filename);
}
if (type.ToUpper().Substring(0,1) == "X" || type.ToUpper().Substring(0, 1) == "E")
{
System.Diagnostics.Process.Start("excel.exe", " " + filename);
}
db = null;
}
private void sfDataGrid2_CellClick(object sender, Syncfusion.WinForms.DataGrid.Events.CellClickEventArgs e)
{

View File

@@ -117,6 +117,9 @@ namespace OnDoc.UIControls
Refresh_Lists();
Refresh_Team();
Broadcaster().AddListener(this);
Security security = new Security();
security.set_security_general(this);
security = null;
//Closing += Form_Closing;
}
@@ -2519,14 +2522,18 @@ namespace OnDoc.UIControls
fh = null;
sb.dsempfaenger.Tables["UsedFelder"].Rows.Clear();
string json = sbt.usedfelder;
System.Data.DataTable dt = (System.Data.DataTable)JsonConvert.DeserializeObject(json, (typeof(System.Data.DataTable)));
sb.dsempfaenger.Tables["UsedFelder"].Rows.Clear();
foreach (System.Data.DataRow dr in dt.Rows)
try
{
sb.dsempfaenger.Tables["Usedfelder"].ImportRow(dr);
};
string json = sbt.usedfelder;
System.Data.DataTable dt = (System.Data.DataTable)JsonConvert.DeserializeObject(json, (typeof(System.Data.DataTable)));
sb.dsempfaenger.Tables["UsedFelder"].Rows.Clear();
foreach (System.Data.DataRow dr in dt.Rows)
{
sb.dsempfaenger.Tables["Usedfelder"].ImportRow(dr);
};
}
catch { }
update_serienbriefdaten(false);
}