update 20241121
This commit is contained in:
@@ -11,13 +11,13 @@
|
||||
<userSettings>
|
||||
<OnDoc.Properties.Settings>
|
||||
<setting name="Connectionstring" serializeAs="String">
|
||||
<value>Data Source=shu01\shu00;Initial Catalog=edoka_dms;Persist Security Info=True;User ID=sa;Password=*shu29;</value>
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="NativVorlagen" serializeAs="String">
|
||||
<value>E:\Software-Projekte\OnDoc\Nativ\</value>
|
||||
</setting>
|
||||
<setting name="Connectionstring_Prod" serializeAs="String">
|
||||
<value>Data Source=shu01\shu00;Initial Catalog=edoka;Persist Security Info=True;User ID=sa;Password=*shu29;</value>
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="RESTURI" serializeAs="String">
|
||||
<value>https://localhost:44334/</value>
|
||||
@@ -26,7 +26,7 @@
|
||||
<value>NO</value>
|
||||
</setting>
|
||||
<setting name="apikey" serializeAs="String">
|
||||
<value>5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6</value>
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="StandardWordDruckMakro" serializeAs="String">
|
||||
<value>FilePrintDefault</value>
|
||||
|
||||
@@ -238,6 +238,7 @@
|
||||
<Compile Include="Klassen\EDKFile.cs" />
|
||||
<Compile Include="Klassen\EventHandler.cs" />
|
||||
<Compile Include="Klassen\Factory.cs" />
|
||||
<Compile Include="Klassen\StringCipher.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Start.cs">
|
||||
|
||||
29
Client/DocMgmt/DokTypSelect.Designer.cs
generated
29
Client/DocMgmt/DokTypSelect.Designer.cs
generated
@@ -42,6 +42,7 @@ namespace OnDoc.DocMgmt
|
||||
this.ribbonItemGroup1 = new System.Windows.Forms.RibbonItemGroup();
|
||||
this.RibbonTextSearch = new System.Windows.Forms.RibbonTextBox();
|
||||
this.RibbonButtonSearch = new System.Windows.Forms.RibbonButton();
|
||||
this.ribbonButtonClear = new System.Windows.Forms.RibbonButton();
|
||||
this.ribbonPanel3 = new System.Windows.Forms.RibbonPanel();
|
||||
this.ribbonButtonCreate = new System.Windows.Forms.RibbonButton();
|
||||
this.ribbonPanel5 = new System.Windows.Forms.RibbonPanel();
|
||||
@@ -68,6 +69,8 @@ namespace OnDoc.DocMgmt
|
||||
this.tsbtnRename = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.tsbtndelete = new System.Windows.Forms.ToolStripButton();
|
||||
this.ribbonButtonFilter = new System.Windows.Forms.RibbonPanel();
|
||||
this.ribboncomboboxfachverantwortung = new System.Windows.Forms.RibbonComboBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.treeViewAdv1)).BeginInit();
|
||||
this.contextMenuStripVorlagen.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.treeViewAdv2)).BeginInit();
|
||||
@@ -108,6 +111,7 @@ namespace OnDoc.DocMgmt
|
||||
this.ribbonTab1.Panels.Add(this.ribbonPanel3);
|
||||
this.ribbonTab1.Panels.Add(this.ribbonPanel5);
|
||||
this.ribbonTab1.Panels.Add(this.ribbonPanel4);
|
||||
this.ribbonTab1.Panels.Add(this.ribbonButtonFilter);
|
||||
this.ribbonTab1.Text = null;
|
||||
//
|
||||
// ribbonPanel1
|
||||
@@ -139,6 +143,7 @@ namespace OnDoc.DocMgmt
|
||||
this.ribbonItemGroup1.Image = global::OnDoc.Properties.Resources.Search_16x16_32;
|
||||
this.ribbonItemGroup1.Items.Add(this.RibbonTextSearch);
|
||||
this.ribbonItemGroup1.Items.Add(this.RibbonButtonSearch);
|
||||
this.ribbonItemGroup1.Items.Add(this.ribbonButtonClear);
|
||||
this.ribbonItemGroup1.Name = "ribbonItemGroup1";
|
||||
//
|
||||
// RibbonTextSearch
|
||||
@@ -157,6 +162,15 @@ namespace OnDoc.DocMgmt
|
||||
this.RibbonButtonSearch.SmallImage = global::OnDoc.Properties.Resources.Search_16x16_32;
|
||||
this.RibbonButtonSearch.Click += new System.EventHandler(this.RibbonButtonSearch_Click);
|
||||
//
|
||||
// ribbonButtonClear
|
||||
//
|
||||
this.ribbonButtonClear.Image = global::OnDoc.Properties.Resources.Connect_16x16_32;
|
||||
this.ribbonButtonClear.LargeImage = global::OnDoc.Properties.Resources.Connect_16x16_32;
|
||||
this.ribbonButtonClear.MaxSizeMode = System.Windows.Forms.RibbonElementSizeMode.Compact;
|
||||
this.ribbonButtonClear.Name = "ribbonButtonClear";
|
||||
this.ribbonButtonClear.SmallImage = global::OnDoc.Properties.Resources.CloseApplication_16x16_32;
|
||||
this.ribbonButtonClear.Click += new System.EventHandler(this.ribbonButtonClear_Click);
|
||||
//
|
||||
// ribbonPanel3
|
||||
//
|
||||
this.ribbonPanel3.ButtonMoreVisible = false;
|
||||
@@ -470,6 +484,18 @@ namespace OnDoc.DocMgmt
|
||||
this.tsbtndelete.Text = "Vorlage / Ordner mit Unterlementen löschen";
|
||||
this.tsbtndelete.Click += new System.EventHandler(this.tsbtndelete_Click);
|
||||
//
|
||||
// ribbonButtonFilter
|
||||
//
|
||||
this.ribbonButtonFilter.Items.Add(this.ribboncomboboxfachverantwortung);
|
||||
this.ribbonButtonFilter.Name = "ribbonButtonFilter";
|
||||
this.ribbonButtonFilter.Text = "Filter Fachverantwortung";
|
||||
//
|
||||
// ribboncomboboxfachverantwortung
|
||||
//
|
||||
this.ribboncomboboxfachverantwortung.Name = "ribboncomboboxfachverantwortung";
|
||||
this.ribboncomboboxfachverantwortung.SelectedIndex = -1;
|
||||
this.ribboncomboboxfachverantwortung.TextBoxText = "";
|
||||
//
|
||||
// DokTypSelect
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@@ -533,5 +559,8 @@ namespace OnDoc.DocMgmt
|
||||
private System.Windows.Forms.ToolStripButton tsbtnNewFolder;
|
||||
private System.Windows.Forms.ToolStripButton tsbtnRename;
|
||||
private System.Windows.Forms.ToolStripButton tsbtndelete;
|
||||
private System.Windows.Forms.RibbonButton ribbonButtonClear;
|
||||
private System.Windows.Forms.RibbonPanel ribbonButtonFilter;
|
||||
private System.Windows.Forms.RibbonComboBox ribboncomboboxfachverantwortung;
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,8 @@ using Database;
|
||||
using OnDoc.Diverses;
|
||||
using System.Xml.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
using Microsoft.SqlServer.Server;
|
||||
using System.Collections;
|
||||
|
||||
namespace OnDoc.DocMgmt
|
||||
{
|
||||
@@ -70,15 +72,21 @@ namespace OnDoc.DocMgmt
|
||||
{
|
||||
this.Style.TitleBar.BackColor = Theaming.Titelbar();
|
||||
this.Style.TitleBar.ForeColor = Theaming.TitelFontColor();
|
||||
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Get_Tabledata("select distinct dbo.get_fachverantwortung(dbo.dokument.dokumenttypnr) from dbo.dokumenttyp", false, true);
|
||||
//foreach (System.Data.DataRow in db.dsdaten.Tables)
|
||||
|
||||
if (this.favoriten) { Load_Favoriten(""); }
|
||||
else { load_standard(""); }
|
||||
|
||||
}
|
||||
|
||||
|
||||
TreeNodeAdv[] nodestoexpand = new TreeNodeAdv[50];
|
||||
int nodextoexpandindex = 1;
|
||||
public void load_standard(string filter)
|
||||
{
|
||||
|
||||
|
||||
Cursor = Cursors.WaitCursor;
|
||||
if (AppParams.connectionstring == "")
|
||||
{
|
||||
@@ -87,9 +95,6 @@ namespace OnDoc.DocMgmt
|
||||
treeViewAdv1.Enabled = false;
|
||||
treeViewAdv1.Visible = false;
|
||||
treeViewAdv1.BeginUpdate();
|
||||
treeViewAdv1.EnableVirtualization=true;
|
||||
treeViewAdv1.SuspendExpandRecalculate=true;
|
||||
treeViewAdv1.RecalculateExpansion = false;
|
||||
treeViewAdv1.Nodes.Clear();
|
||||
treeViewAdv1.LeftImageList = imageList1;
|
||||
|
||||
@@ -101,89 +106,56 @@ namespace OnDoc.DocMgmt
|
||||
|
||||
if (vorlagentype == 1)
|
||||
{
|
||||
//DB db1 = new DB(AppParams.connectionstring);
|
||||
//DataTable vorlagen1 = new DataTable();
|
||||
//DataTable Struktur1 = new DataTable();
|
||||
//DataSet ds = new DataSet();
|
||||
//db1.Get_Tabledata("Select dokumenttypnr as id, bezeichnung, node, OnBase_Dokumenttyp from View_Dokumenttypen_Relaunch where aktiv=1 " + where + " order by bezeichnung", false, true);
|
||||
//vorlagen1 = db1.dsdaten.Tables[0].Copy();
|
||||
//db1.Get_Tabledata("Select * from Dokumentart_Relaunch order by id", false, true);
|
||||
this.Text = "Vorlage auswählen";
|
||||
//Standard Vorlagen
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
DataTable vorlagen = new DataTable();
|
||||
DataTable Struktur = new DataTable();
|
||||
DataSet ds = new DataSet();
|
||||
db.Get_Tabledata("Select dokumenttypnr as id, bezeichnung, node, OnBase_Dokumenttyp from View_Dokumenttypen_Relaunch where aktiv=1 " + where + " order by bezeichnung", false, true);
|
||||
vorlagen = db.dsdaten.Tables[0].Copy();
|
||||
db.Get_Tabledata("Select * from Dokumentart_Relaunch order by id", false, true);
|
||||
|
||||
//db1.dsdaten.Tables[0].AcceptChanges();
|
||||
//Struktur1 = db1.dsdaten.Tables[0].Copy();
|
||||
//Syncfusion.Windows.Forms.Tools.DataRelation childRelation1;
|
||||
//Syncfusion.Windows.Forms.Tools.DataRelation childRelation2;
|
||||
//Syncfusion.Windows.Forms.Tools.DataRelation childRelation3;
|
||||
db.dsdaten.Tables[0].AcceptChanges();
|
||||
Struktur = db.dsdaten.Tables[0].Copy();
|
||||
|
||||
//childRelation1 = new Syncfusion.Windows.Forms.Tools.DataRelation(Struktur1, "struktur1", "bezeichnung", "ChildFolder", "SubFolderChild1", "SubFolderName1", "Checked");
|
||||
ds.Tables.Add(Struktur.Copy());
|
||||
ds.Tables[0].TableName = "Struktur";
|
||||
ds.Tables.Add(vorlagen.Copy());
|
||||
ds.Relations.Add("TreeParentChild", ds.Tables[0].Columns["ID"], ds.Tables[0].Columns["ParentID"], false);
|
||||
ds.Relations.Add("VorlagenParent", ds.Tables[0].Columns["ID"], ds.Tables[1].Columns["node"], false);
|
||||
|
||||
nodestoexpand = null;
|
||||
nodestoexpand = new TreeNodeAdv[Struktur.Rows.Count];
|
||||
nodextoexpandindex = 1;
|
||||
|
||||
//if (where == "" && StaticValues.vorlagen.Nodes.Count>1)
|
||||
//{
|
||||
|
||||
// treeViewAdv1.Nodes.Clear();
|
||||
// TreeNodeAdv copynodes = StaticValues.vorlagen.Nodes[0].Clone();
|
||||
// treeViewAdv1.Nodes.Add(copynodes);
|
||||
// copynodes = StaticValues.vorlagen.Nodes[1].Clone();
|
||||
// treeViewAdv1.Nodes.Add(copynodes);
|
||||
|
||||
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
|
||||
|
||||
this.Text = "Vorlage auswählen";
|
||||
//Standard Vorlagen
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
DataTable vorlagen = new DataTable();
|
||||
DataTable Struktur = new DataTable();
|
||||
DataSet ds = new DataSet();
|
||||
db.Get_Tabledata("Select dokumenttypnr as id, bezeichnung, node, OnBase_Dokumenttyp from View_Dokumenttypen_Relaunch where aktiv=1 " + where + " order by bezeichnung", false, true);
|
||||
vorlagen = db.dsdaten.Tables[0].Copy();
|
||||
db.Get_Tabledata("Select * from Dokumentart_Relaunch order by id", false, true);
|
||||
|
||||
db.dsdaten.Tables[0].AcceptChanges();
|
||||
Struktur = db.dsdaten.Tables[0].Copy();
|
||||
|
||||
ds.Tables.Add(Struktur.Copy());
|
||||
ds.Tables[0].TableName = "Struktur";
|
||||
ds.Tables.Add(vorlagen.Copy());
|
||||
ds.Relations.Add("TreeParentChild", ds.Tables[0].Columns["ID"], ds.Tables[0].Columns["ParentID"], false);
|
||||
ds.Relations.Add("VorlagenParent", ds.Tables[0].Columns["ID"], ds.Tables[1].Columns["node"], false);
|
||||
|
||||
|
||||
|
||||
foreach (System.Data.DataRow dr in ds.Tables[0].Rows)
|
||||
foreach (System.Data.DataRow dr in ds.Tables[0].Rows)
|
||||
{
|
||||
if (dr["Parentid"].ToString() == "0")
|
||||
{
|
||||
if (dr["Parentid"].ToString() == "0")
|
||||
//Creates a TreeNode if the parent equals 0
|
||||
TreeNodeAdv root = new TreeNodeAdv(dr["bezeichnung"].ToString());
|
||||
root.Tag = Convert.ToInt32(dr["id"]) * -1;
|
||||
root.TagObject = dr;
|
||||
root.LeftImageIndices = new int[] { 0 };
|
||||
treeViewAdv1.Nodes.Add(root);
|
||||
PopulateTree(dr, root);
|
||||
}
|
||||
}
|
||||
if (filter == "")
|
||||
{
|
||||
try
|
||||
{
|
||||
for (int i = 1; i < nodextoexpandindex; i++)
|
||||
{
|
||||
//Creates a TreeNode if the parent equals 0
|
||||
TreeNodeAdv root = new TreeNodeAdv(dr["bezeichnung"].ToString());
|
||||
root.Tag = Convert.ToInt32(dr["id"]) * -1;
|
||||
root.TagObject = dr;
|
||||
root.LeftImageIndices = new int[] { 0 };
|
||||
treeViewAdv1.Nodes.Add(root);
|
||||
//Recursively builds the tree
|
||||
PopulateTree(dr, root);
|
||||
treeViewAdv1.SelectedNode = nodestoexpand[i];
|
||||
if (treeViewAdv1.SelectedNode.Nodes[0].Nodes.Count > 0) { treeViewAdv1.SelectedNode.Expand(); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if (StaticValues.vorlagen.Nodes.Count==0)
|
||||
//{
|
||||
// Logging.Logging.Debug("Save Static Value Start", "OnDoc", "");
|
||||
|
||||
// //StaticValues.vorlagen = treeViewAdv1;
|
||||
// TreeNodeAdv copynodes = this.treeViewAdv1.Nodes[0].Clone();
|
||||
// StaticValues.vorlagen.Nodes.Add(copynodes);
|
||||
// copynodes = this.treeViewAdv1.Nodes[1].Clone();
|
||||
// StaticValues.vorlagen.Nodes.Add(copynodes);
|
||||
// Logging.Logging.Debug("Save Static Value Ende", "OnDoc", "");
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
catch { }
|
||||
} else
|
||||
{ treeViewAdv1.ExpandAll();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -229,12 +201,14 @@ namespace OnDoc.DocMgmt
|
||||
|
||||
//Expands all the tree nodes
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
treeViewAdv1.SelectedNode = treeViewAdv1.Nodes[0];
|
||||
treeViewAdv1.EndUpdate();
|
||||
treeViewAdv1.Enabled = true;
|
||||
treeViewAdv1.Visible = true;
|
||||
Logging.Logging.Debug("Tree Expand all Ende", "OnDoc", "");
|
||||
|
||||
|
||||
if (ExternalCall.struktur != "")
|
||||
{
|
||||
@@ -247,17 +221,15 @@ namespace OnDoc.DocMgmt
|
||||
|
||||
public void PopulateSubTree(System.Data.DataRow dr, TreeNodeAdv pNode)
|
||||
{
|
||||
//To iterate through all the rows in the DataSet
|
||||
|
||||
foreach (System.Data.DataRow row in dr.GetChildRows("VorlagenParent"))
|
||||
{
|
||||
//Creating a TreeNode for each row
|
||||
|
||||
TreeNodeAdv cChild = new TreeNodeAdv(row["bezeichnung"].ToString());
|
||||
cChild.LeftImageIndices = new int[] { 1 };
|
||||
cChild.Tag = Convert.ToInt32(row["id"]) * 1;
|
||||
cChild.TagObject = row;
|
||||
//Add cChild node to the pNode
|
||||
pNode.Nodes.Add(cChild);
|
||||
//Recursively build the tree
|
||||
PopulateSubTree(row, cChild);
|
||||
}
|
||||
}
|
||||
@@ -275,8 +247,11 @@ namespace OnDoc.DocMgmt
|
||||
cChild.Tag = Convert.ToInt32(row["id"]) * -1;
|
||||
cChild.LeftImageIndices = new int[] { 0 };
|
||||
cChild.TagObject = row;
|
||||
nodestoexpand[nodextoexpandindex] = cChild;
|
||||
nodextoexpandindex = nodextoexpandindex + 1;
|
||||
//Add cChild node to the pNode
|
||||
pNode.Nodes.Add(cChild);
|
||||
|
||||
//Recursively build the tree
|
||||
PopulateTree(row, cChild);
|
||||
//PopulateSubTree(row, cChild);
|
||||
@@ -328,6 +303,7 @@ namespace OnDoc.DocMgmt
|
||||
//Recursively builds the tree
|
||||
PopulateTree_Favoriten(dr, root);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
treeViewAdv2.ExpandAll();
|
||||
@@ -801,5 +777,11 @@ namespace OnDoc.DocMgmt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ribbonButtonClear_Click(object sender, EventArgs e)
|
||||
{
|
||||
RibbonTextSearch.Text = "";
|
||||
load_standard("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACk
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAWABAAFgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAYABAAGAAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
|
||||
103
Client/Klassen/StringCipher.cs
Normal file
103
Client/Klassen/StringCipher.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OnDoc.Klassen
|
||||
{
|
||||
public static class StringCipher
|
||||
{// This constant is used to determine the keysize of the encryption algorithm in bits.
|
||||
// We divide this by 8 within the code below to get the equivalent number of bytes.
|
||||
private const int Keysize = 256;
|
||||
|
||||
// This constant determines the number of iterations for the password bytes generation function.
|
||||
private const int DerivationIterations = 1000;
|
||||
|
||||
public static string Encrypt(string plainText, string passPhrase)
|
||||
{
|
||||
// Salt and IV is randomly generated each time, but is preprended to encrypted cipher text
|
||||
// so that the same Salt and IV values can be used when decrypting.
|
||||
var saltStringBytes = Generate256BitsOfRandomEntropy();
|
||||
var ivStringBytes = Generate256BitsOfRandomEntropy();
|
||||
var plainTextBytes = Encoding.UTF8.GetBytes(plainText);
|
||||
using (var password = new Rfc2898DeriveBytes(passPhrase, saltStringBytes, DerivationIterations))
|
||||
{
|
||||
var keyBytes = password.GetBytes(Keysize / 8);
|
||||
using (var symmetricKey = new RijndaelManaged())
|
||||
{
|
||||
symmetricKey.BlockSize = 256;
|
||||
symmetricKey.Mode = CipherMode.CBC;
|
||||
symmetricKey.Padding = PaddingMode.PKCS7;
|
||||
using (var encryptor = symmetricKey.CreateEncryptor(keyBytes, ivStringBytes))
|
||||
{
|
||||
using (var memoryStream = new MemoryStream())
|
||||
{
|
||||
using (var cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write))
|
||||
{
|
||||
cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length);
|
||||
cryptoStream.FlushFinalBlock();
|
||||
// Create the final bytes as a concatenation of the random salt bytes, the random iv bytes and the cipher bytes.
|
||||
var cipherTextBytes = saltStringBytes;
|
||||
cipherTextBytes = cipherTextBytes.Concat(ivStringBytes).ToArray();
|
||||
cipherTextBytes = cipherTextBytes.Concat(memoryStream.ToArray()).ToArray();
|
||||
memoryStream.Close();
|
||||
cryptoStream.Close();
|
||||
return Convert.ToBase64String(cipherTextBytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string Decrypt(string cipherText, string passPhrase)
|
||||
{
|
||||
// Get the complete stream of bytes that represent:
|
||||
// [32 bytes of Salt] + [32 bytes of IV] + [n bytes of CipherText]
|
||||
var cipherTextBytesWithSaltAndIv = Convert.FromBase64String(cipherText);
|
||||
// Get the saltbytes by extracting the first 32 bytes from the supplied cipherText bytes.
|
||||
var saltStringBytes = cipherTextBytesWithSaltAndIv.Take(Keysize / 8).ToArray();
|
||||
// Get the IV bytes by extracting the next 32 bytes from the supplied cipherText bytes.
|
||||
var ivStringBytes = cipherTextBytesWithSaltAndIv.Skip(Keysize / 8).Take(Keysize / 8).ToArray();
|
||||
// Get the actual cipher text bytes by removing the first 64 bytes from the cipherText string.
|
||||
var cipherTextBytes = cipherTextBytesWithSaltAndIv.Skip((Keysize / 8) * 2).Take(cipherTextBytesWithSaltAndIv.Length - ((Keysize / 8) * 2)).ToArray();
|
||||
|
||||
using (var password = new Rfc2898DeriveBytes(passPhrase, saltStringBytes, DerivationIterations))
|
||||
{
|
||||
var keyBytes = password.GetBytes(Keysize / 8);
|
||||
using (var symmetricKey = new RijndaelManaged())
|
||||
{
|
||||
symmetricKey.BlockSize = 256;
|
||||
symmetricKey.Mode = CipherMode.CBC;
|
||||
symmetricKey.Padding = PaddingMode.PKCS7;
|
||||
using (var decryptor = symmetricKey.CreateDecryptor(keyBytes, ivStringBytes))
|
||||
{
|
||||
using (var memoryStream = new MemoryStream(cipherTextBytes))
|
||||
{
|
||||
using (var cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read))
|
||||
using (var streamReader = new StreamReader(cryptoStream, Encoding.UTF8))
|
||||
{
|
||||
return streamReader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] Generate256BitsOfRandomEntropy()
|
||||
{
|
||||
var randomBytes = new byte[32]; // 32 Bytes will give us 256 bits.
|
||||
using (var rngCsp = new RNGCryptoServiceProvider())
|
||||
{
|
||||
// Fill the array with cryptographically secure random bytes.
|
||||
rngCsp.GetBytes(randomBytes);
|
||||
}
|
||||
return randomBytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,17 +35,19 @@ namespace OnDoc.Klassen
|
||||
public static void init()
|
||||
{
|
||||
string startuppath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
connectionstring = System.IO.File.ReadAllText(startuppath + @"\edokaconn.cfg");
|
||||
|
||||
connectionstring = System.IO.File.ReadAllText(startuppath + @"\ondocconn.cfg");
|
||||
connectionstring = StringCipher.Decrypt(connectionstring, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
|
||||
DB db = new DB(connectionstring);
|
||||
db.Get_Tabledata("Select * from applikation where applikationsnr = 1", false, true);
|
||||
tempdir = db.dsdaten.Tables[0].Rows[0]["pfad_temporaer_dokumente"].ToString();
|
||||
db = null;
|
||||
StaticValues.UserID = "Stefan Hutter";
|
||||
|
||||
apikey = System.IO.File.ReadAllText(startuppath + @"\apikey.cfg");
|
||||
apikey = StringCipher.Decrypt(apikey, "PBod8b%s@c9ib7Lws#na5sGM2trugrx3h!oyB^y!Bc%fHEYUT3QvTVr6sAaAr9FoQWzb");
|
||||
UseAPI = Properties.Settings.Default.UseAPI;
|
||||
RESTURI = Properties.Settings.Default.RESTURI;
|
||||
apikey = Properties.Settings.Default.apikey;
|
||||
//apikey = Properties.Settings.Default.apikey;
|
||||
wordprintmacro = Properties.Settings.Default.StandardWordDruckMakro;
|
||||
vbvorlagenmanagement = Properties.Settings.Default.VBVorlagenmanagement;
|
||||
|
||||
|
||||
@@ -470,19 +470,19 @@
|
||||
<data name="ribbonbuttonlogin.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wgAADsIBFShKgAAAABpJREFUWEftwQEBAAAAgiD/r25IQAAAAMC5GhAgAAGdeElDAAAAAElFTkSuQmCC
|
||||
wQAADsEBuJFr7QAAABpJREFUWEftwQEBAAAAgiD/r25IQAAAAMC5GhAgAAGdeElDAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="ribbonbuttonlogin.LargeImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wgAADsIBFShKgAAAABpJREFUWEftwQEBAAAAgiD/r25IQAAAAMC5GhAgAAGdeElDAAAAAElFTkSuQmCC
|
||||
wQAADsEBuJFr7QAAABpJREFUWEftwQEBAAAAgiD/r25IQAAAAMC5GhAgAAGdeElDAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="ribbonbuttonlogin.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wgAADsIBFShKgAAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
|
||||
wQAADsEBuJFr7QAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="pdfConfig1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
|
||||
Binary file not shown.
@@ -11,13 +11,13 @@
|
||||
<userSettings>
|
||||
<OnDoc.Properties.Settings>
|
||||
<setting name="Connectionstring" serializeAs="String">
|
||||
<value>Data Source=shu01\shu00;Initial Catalog=edoka_dms;Persist Security Info=True;User ID=sa;Password=*shu29;</value>
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="NativVorlagen" serializeAs="String">
|
||||
<value>E:\Software-Projekte\OnDoc\Nativ\</value>
|
||||
</setting>
|
||||
<setting name="Connectionstring_Prod" serializeAs="String">
|
||||
<value>Data Source=shu01\shu00;Initial Catalog=edoka;Persist Security Info=True;User ID=sa;Password=*shu29;</value>
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="RESTURI" serializeAs="String">
|
||||
<value>https://localhost:44334/</value>
|
||||
@@ -26,7 +26,7 @@
|
||||
<value>NO</value>
|
||||
</setting>
|
||||
<setting name="apikey" serializeAs="String">
|
||||
<value>5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6</value>
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="StandardWordDruckMakro" serializeAs="String">
|
||||
<value>FilePrintDefault</value>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
1
Client/bin/Debug/apikey.cfg
Normal file
1
Client/bin/Debug/apikey.cfg
Normal file
@@ -0,0 +1 @@
|
||||
dFuyEhqaiQZ5vsGP66+D0BJttUtKYRCXt7XpBHLym7flLMz8gpFZgf28+9wwx30EkjOd0OVD5fgxqxFftCQ9UucI6Xf119aM48gMt3/T3tlx/QWcnuPlLhM/MpS8P8I4tuCwrj//dDGf194wJK9lWBB0LT6xFUqAZLuujmMHVPRn0QmcQQi992T00HTTiwz1SwgawjRlLt0jD40UO6vl9Wf2n5eq3000jwOno1YbyvCBqQu6wAVYtmtMAYw1IoKQ5bF6zpqAGehpFjm0EcdIJFVR6U3njEmI5xBjeY6/SNA=
|
||||
Binary file not shown.
1
Client/bin/Debug/ondocconn.cfg
Normal file
1
Client/bin/Debug/ondocconn.cfg
Normal file
@@ -0,0 +1 @@
|
||||
Q3MS5GJhakLjwhZg7WIP6Tt9p4ZmjtzTRsJyQgBdF8MuFZGjjomJyJ09DyCaAzZ4ZvgxAAAI0Ij3SybN/Y/3SWDpj68jav/xP5kd7t2p9RCa3pWRTIWjCawF026Mrndr1Z93cI+sV9MYnLB74dcqcuVqFn1l6NA2g3hLLmWVxva904e456kO1Oojn0wPIBs66XVSsRqS3MhyoKK/hTl/YCZZuzUsSV1v/JRAo+aYVxbYx6UpxK8IUegDY/CZc5NM
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
b85197c4cb2d8acde4f36cac6dd54c4797f46e1d9966a337f99196a91d00f019
|
||||
d12f283318bf5001c92ba993d56640d65572c928ee53285767ebdfcf370acd1a
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -11,13 +11,13 @@
|
||||
<userSettings>
|
||||
<OnDoc.Properties.Settings>
|
||||
<setting name="Connectionstring" serializeAs="String">
|
||||
<value>Data Source=shu01\shu00;Initial Catalog=edoka_dms;Persist Security Info=True;User ID=sa;Password=*shu29;</value>
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="NativVorlagen" serializeAs="String">
|
||||
<value>E:\Software-Projekte\OnDoc\Nativ\</value>
|
||||
</setting>
|
||||
<setting name="Connectionstring_Prod" serializeAs="String">
|
||||
<value>Data Source=shu01\shu00;Initial Catalog=edoka;Persist Security Info=True;User ID=sa;Password=*shu29;</value>
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="RESTURI" serializeAs="String">
|
||||
<value>https://localhost:44334/</value>
|
||||
@@ -26,7 +26,7 @@
|
||||
<value>NO</value>
|
||||
</setting>
|
||||
<setting name="apikey" serializeAs="String">
|
||||
<value>5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6</value>
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="StandardWordDruckMakro" serializeAs="String">
|
||||
<value>FilePrintDefault</value>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user