Update 20250107

This commit is contained in:
Stefan Hutter
2025-01-07 21:00:50 +01:00
parent 3b0a2b0527
commit af418d0114
706 changed files with 1054974 additions and 976 deletions

View File

@@ -28,13 +28,23 @@
/// </summary>
private void InitializeComponent()
{
Syncfusion.Windows.Forms.PdfViewer.MessageBoxSettings messageBoxSettings6 = new Syncfusion.Windows.Forms.PdfViewer.MessageBoxSettings();
Syncfusion.Windows.PdfViewer.PdfViewerPrinterSettings pdfViewerPrinterSettings6 = new Syncfusion.Windows.PdfViewer.PdfViewerPrinterSettings();
Syncfusion.Windows.Forms.PdfViewer.MessageBoxSettings messageBoxSettings4 = new Syncfusion.Windows.Forms.PdfViewer.MessageBoxSettings();
Syncfusion.Windows.PdfViewer.PdfViewerPrinterSettings pdfViewerPrinterSettings4 = new Syncfusion.Windows.PdfViewer.PdfViewerPrinterSettings();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
Syncfusion.Windows.Forms.PdfViewer.TextSearchSettings textSearchSettings6 = new Syncfusion.Windows.Forms.PdfViewer.TextSearchSettings();
Syncfusion.Windows.Forms.PdfViewer.TextSearchSettings textSearchSettings4 = new Syncfusion.Windows.Forms.PdfViewer.TextSearchSettings();
this.sfDataGrid1 = new Syncfusion.WinForms.DataGrid.SfDataGrid();
this.pdfViewerControl1 = new Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
((System.ComponentModel.ISupportInitialize)(this.sfDataGrid1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// sfDataGrid1
@@ -44,11 +54,11 @@
this.sfDataGrid1.AllowFiltering = true;
this.sfDataGrid1.AllowResizingColumns = true;
this.sfDataGrid1.AutoSizeColumnsMode = Syncfusion.WinForms.DataGrid.Enums.AutoSizeColumnsMode.AllCellsWithLastColumnFill;
this.sfDataGrid1.Dock = System.Windows.Forms.DockStyle.Left;
this.sfDataGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.sfDataGrid1.FilterRowPosition = Syncfusion.WinForms.DataGrid.Enums.RowPosition.Top;
this.sfDataGrid1.Location = new System.Drawing.Point(0, 0);
this.sfDataGrid1.Location = new System.Drawing.Point(0, 56);
this.sfDataGrid1.Name = "sfDataGrid1";
this.sfDataGrid1.Size = new System.Drawing.Size(839, 1018);
this.sfDataGrid1.Size = new System.Drawing.Size(560, 962);
this.sfDataGrid1.TabIndex = 0;
this.sfDataGrid1.Text = "sfDataGrid1";
this.sfDataGrid1.CellClick += new Syncfusion.WinForms.DataGrid.Events.CellClickEventHandler(this.sfDataGrid1_CellClick);
@@ -64,47 +74,104 @@
this.pdfViewerControl1.IsBookmarkEnabled = true;
this.pdfViewerControl1.IsTextSearchEnabled = true;
this.pdfViewerControl1.IsTextSelectionEnabled = true;
this.pdfViewerControl1.Location = new System.Drawing.Point(839, 0);
messageBoxSettings6.EnableNotification = true;
this.pdfViewerControl1.MessageBoxSettings = messageBoxSettings6;
this.pdfViewerControl1.Location = new System.Drawing.Point(0, 0);
messageBoxSettings4.EnableNotification = true;
this.pdfViewerControl1.MessageBoxSettings = messageBoxSettings4;
this.pdfViewerControl1.MinimumZoomPercentage = 50;
this.pdfViewerControl1.Name = "pdfViewerControl1";
this.pdfViewerControl1.PageBorderThickness = 1;
pdfViewerPrinterSettings6.Copies = 1;
pdfViewerPrinterSettings6.PageOrientation = Syncfusion.Windows.PdfViewer.PdfViewerPrintOrientation.Auto;
pdfViewerPrinterSettings6.PageSize = Syncfusion.Windows.PdfViewer.PdfViewerPrintSize.ActualSize;
pdfViewerPrinterSettings6.PrintLocation = ((System.Drawing.PointF)(resources.GetObject("pdfViewerPrinterSettings6.PrintLocation")));
pdfViewerPrinterSettings6.ShowPrintStatusDialog = true;
this.pdfViewerControl1.PrinterSettings = pdfViewerPrinterSettings6;
pdfViewerPrinterSettings4.Copies = 1;
pdfViewerPrinterSettings4.PageOrientation = Syncfusion.Windows.PdfViewer.PdfViewerPrintOrientation.Auto;
pdfViewerPrinterSettings4.PageSize = Syncfusion.Windows.PdfViewer.PdfViewerPrintSize.ActualSize;
pdfViewerPrinterSettings4.PrintLocation = ((System.Drawing.PointF)(resources.GetObject("pdfViewerPrinterSettings4.PrintLocation")));
pdfViewerPrinterSettings4.ShowPrintStatusDialog = true;
this.pdfViewerControl1.PrinterSettings = pdfViewerPrinterSettings4;
this.pdfViewerControl1.ReferencePath = null;
this.pdfViewerControl1.ScrollDisplacementValue = 0;
this.pdfViewerControl1.ShowHorizontalScrollBar = true;
this.pdfViewerControl1.ShowToolBar = true;
this.pdfViewerControl1.ShowVerticalScrollBar = true;
this.pdfViewerControl1.Size = new System.Drawing.Size(843, 1018);
this.pdfViewerControl1.Size = new System.Drawing.Size(1118, 1018);
this.pdfViewerControl1.SpaceBetweenPages = 8;
this.pdfViewerControl1.TabIndex = 1;
this.pdfViewerControl1.Text = "pdfViewerControl1";
textSearchSettings6.CurrentInstanceColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(255)))), ((int)(((byte)(171)))), ((int)(((byte)(64)))));
textSearchSettings6.HighlightAllInstance = true;
textSearchSettings6.OtherInstanceColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(254)))), ((int)(((byte)(255)))), ((int)(((byte)(0)))));
this.pdfViewerControl1.TextSearchSettings = textSearchSettings6;
textSearchSettings4.CurrentInstanceColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(255)))), ((int)(((byte)(171)))), ((int)(((byte)(64)))));
textSearchSettings4.HighlightAllInstance = true;
textSearchSettings4.OtherInstanceColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(254)))), ((int)(((byte)(255)))), ((int)(((byte)(0)))));
this.pdfViewerControl1.TextSearchSettings = textSearchSettings4;
this.pdfViewerControl1.ThemeName = "Default";
this.pdfViewerControl1.VerticalScrollOffset = 0;
this.pdfViewerControl1.VisualStyle = Syncfusion.Windows.Forms.PdfViewer.VisualStyle.Default;
this.pdfViewerControl1.ZoomMode = Syncfusion.Windows.Forms.PdfViewer.ZoomMode.Default;
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.sfDataGrid1);
this.splitContainer1.Panel1.Controls.Add(this.panel1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.pdfViewerControl1);
this.splitContainer1.Size = new System.Drawing.Size(1682, 1018);
this.splitContainer1.SplitterDistance = 560;
this.splitContainer1.TabIndex = 3;
//
// panel1
//
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.button1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(560, 56);
this.panel1.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(13, 13);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(120, 23);
this.button1.TabIndex = 0;
this.button1.Text = "Doktyp-List aus DB";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(160, 13);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(120, 23);
this.button2.TabIndex = 1;
this.button2.Text = "Excel-Liste";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1682, 1018);
this.Controls.Add(this.pdfViewerControl1);
this.Controls.Add(this.sfDataGrid1);
this.Controls.Add(this.splitContainer1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Form1";
this.Text = "Vorlagen-Viewer";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.sfDataGrid1)).EndInit();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -113,6 +180,11 @@
private Syncfusion.WinForms.DataGrid.SfDataGrid sfDataGrid1;
private Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl pdfViewerControl1;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
}
}

View File

@@ -10,12 +10,17 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using Database;
using OnDoc.Klassen;
using ExcelNet;
using System.Windows.Forms.VisualStyles;
namespace Vorlagen_Viewer
{
public partial class Form1 : Form
{
System.Data.DataTable importdata = new DataTable();
System.Data.DataTable importdata1 = new DataTable();
bool fromexcel = false;
string connectionstring = "";
public Form1()
{
@@ -24,39 +29,47 @@ namespace Vorlagen_Viewer
private void Form1_Load(object sender, EventArgs e)
{
string startuppath = AppDomain.CurrentDomain.BaseDirectory;
connectionstring = System.IO.File.ReadAllText(startuppath + @"\ondocconn.cfg");
connectionstring = StringCipher.Decrypt(connectionstring, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
string sql = "";
sql = "SELECT dbo.dokumenttyp.dokumenttypnr, dbo.dokumenttyp.bezeichnung, dbo.Office_Vorlage_Datei.dateiname, dbo.office_vorlage_datei.office_vorlage_dateinr as dateinr ";
sql = sql + "FROM dbo.dokumenttyp INNER JOIN ";
sql = sql + "dbo.office_vorlage ON dbo.dokumenttyp.office_vorlagenr = dbo.office_vorlage.office_vorlagenr INNER JOIN ";
sql = sql + "dbo.Office_Vorlage_Datei ON dbo.office_vorlage.office_vorlagenr = dbo.Office_Vorlage_Datei.office_vorlagenr";
DB db = new DB(connectionstring);
db.Get_Tabledata(sql, false, true);
splitContainer1.SplitterDistance = this.Width / 2;
button1_Click(sender, e);
sfDataGrid1.DataSource=db.dsdaten.Tables[0];
db = null;
}
private void sfDataGrid1_Click(object sender, EventArgs e)
{
}
private void sfDataGrid1_CellClick(object sender, Syncfusion.WinForms.DataGrid.Events.CellClickEventArgs e)
{
string dateinr = "";
DB db = new DB(connectionstring);
try
{
string dateinr = "";
string dokumenttypnr = "";
var rowIndex = e.DataRow.RowIndex;
//Get the column index value
var columnIndex = e.DataColumn.ColumnIndex;
var selectedItem = e.DataRow;
var dataRow = (e.DataRow.RowData as DataRowView).Row;
dateinr = dataRow["dateinr"].ToString();
DB db = new DB(connectionstring);
if (fromexcel)
{
dokumenttypnr = dataRow[0].ToString();
string sql = "";
sql = "SELECT dbo.dokumenttyp.dokumenttypnr, dbo.dokumenttyp.bezeichnung, dbo.Office_Vorlage_Datei.dateiname, dbo.office_vorlage_datei.office_vorlage_dateinr as dateinr ";
sql = sql + "FROM dbo.dokumenttyp INNER JOIN ";
sql = sql + "dbo.office_vorlage ON dbo.dokumenttyp.office_vorlagenr = dbo.office_vorlage.office_vorlagenr INNER JOIN ";
sql = sql + "dbo.Office_Vorlage_Datei ON dbo.office_vorlage.office_vorlagenr = dbo.Office_Vorlage_Datei.office_vorlagenr where dokumenttypnr=" + dokumenttypnr;
db.Get_Tabledata(sql, false, true);
dateinr = db.dsdaten.Tables[0].Rows[0]["dateinr"].ToString();
}
else
{
dateinr = dataRow["dateinr"].ToString();
}
string document = db.Get_Office_Vorlage_asBase64(dateinr);
db.Get_ApplicationType_from_Vorlage(Convert.ToInt32(dateinr));
string Apptype = "";
@@ -102,6 +115,85 @@ namespace Vorlagen_Viewer
dg = null;
}
catch { }
finally {
db = null;
}
}
private void button1_Click(object sender, EventArgs e)
{
string startuppath = AppDomain.CurrentDomain.BaseDirectory;
connectionstring = System.IO.File.ReadAllText(startuppath + @"\ondocconn.cfg");
connectionstring = StringCipher.Decrypt(connectionstring, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
string sql = "";
sql = "SELECT dbo.dokumenttyp.dokumenttypnr, dbo.dokumenttyp.bezeichnung, dbo.Office_Vorlage_Datei.dateiname, dbo.office_vorlage_datei.office_vorlage_dateinr as dateinr ";
sql = sql + "FROM dbo.dokumenttyp INNER JOIN ";
sql = sql + "dbo.office_vorlage ON dbo.dokumenttyp.office_vorlagenr = dbo.office_vorlage.office_vorlagenr INNER JOIN ";
sql = sql + "dbo.Office_Vorlage_Datei ON dbo.office_vorlage.office_vorlagenr = dbo.Office_Vorlage_Datei.office_vorlagenr";
DB db = new DB(connectionstring);
db.Get_Tabledata(sql, false, true);
sfDataGrid1.DataSource = db.dsdaten.Tables[0];
db = null;
fromexcel = false;
}
private void button2_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Excel-Dateien (*.xlsx)|*.xlsx|Alle Dateien (*.*)|*.*";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
ExcelNet.ExcelReader reader = new ExcelNet.ExcelReader();
string selected_sheetname = "";
var sheets = new List<string>();
try
{
sheets = reader.Get_ExcelSheets(openFileDialog1.FileName);
}
catch
{
MessageBox.Show("Auf die gewählte Excel-Datei kann aktuell nicht zugegriffen werden. Evtl. ist diese noch geöffnet.", "Excel-Import", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
selected_sheetname = sheets[0];
reader.Excel_To_Datatabable(openFileDialog1.FileName, selected_sheetname, true, ref importdata);
sfDataGrid1.DataSource = null;
importdata1.Rows.Clear();
importdata1.Columns.Clear();
int i = 0;
foreach(DataColumn dc in importdata.Columns)
{
if (i == 0)
{
importdata1.Columns.Add(dc.ColumnName, typeof(Int32));
}
else
{
importdata1.Columns.Add(dc.ColumnName, typeof(string));
}
i++;
}
foreach(DataRow dr in importdata.Rows)
{
DataRow drn = importdata1.NewRow();
foreach (DataColumn dc in importdata.Columns)
{
drn[dc.ColumnName] = dr[dc.ColumnName];
}
importdata1.Rows.Add(drn);
}
importdata1.AcceptChanges();
//importdata.Columns[0].DataType = typeof(Int32);
sfDataGrid1.DataSource = importdata1;
fromexcel = true;
reader = null;
}
}
}
}

View File

@@ -117,13 +117,16 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="pdfViewerPrinterSettings6.PrintLocation" mimetype="application/x-microsoft.net.object.binary.base64">
<data name="pdfViewerPrinterSettings4.PrintLocation" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0
dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABVTeXN0ZW0uRHJh
d2luZy5Qb2ludEYCAAAAAXgBeQAACwsCAAAAAAAAAAAAAAAL
</value>
</data>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@@ -36,6 +36,9 @@
<Reference Include="Database">
<HintPath>..\Database\bin\Debug\Database.dll</HintPath>
</Reference>
<Reference Include="ExcelNet">
<HintPath>..\Client\bin\Debug\ExcelNet.dll</HintPath>
</Reference>
<Reference Include="Helper, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\DOCGEN\bin\Debug\Helper.dll</HintPath>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
1126ec5e4d9b8a7c7a86ec9dc3b40137a197208b2487816541ff40077fdd9892
afe8e2e32a0a2a1c8615a6a52a176d5b83d5398c2fa968cec78b0e538a747547

View File

@@ -84,3 +84,5 @@ E:\Software-Projekte\OnDoc\OnDoc\Vorlagen_Viewer\bin\Debug\Syncfusion.Grid.Base.
E:\Software-Projekte\OnDoc\OnDoc\Vorlagen_Viewer\bin\Debug\Syncfusion.Tools.Base.xml
E:\Software-Projekte\OnDoc\OnDoc\Vorlagen_Viewer\bin\Debug\Syncfusion.SfChart.WPF.xml
E:\Software-Projekte\OnDoc\OnDoc\Vorlagen_Viewer\bin\Debug\Syncfusion.Grid.Windows.XmlSerializers.dll
E:\Software-Projekte\OnDoc\OnDoc\Vorlagen_Viewer\bin\Debug\ExcelNet.dll
E:\Software-Projekte\OnDoc\OnDoc\Vorlagen_Viewer\bin\Debug\ExcelNet.pdb

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]