update 20250406
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user