update 20241121

This commit is contained in:
Stefan Hutter
2024-11-21 19:32:26 +01:00
parent d3bf9458eb
commit 6bdbc4173e
56 changed files with 362 additions and 168 deletions

View File

@@ -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;
}
}

View File

@@ -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("");
}
}
}

View File

@@ -284,7 +284,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACk
CAAAAk1TRnQBSQFMAgEBAgEAAWABAAFgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CAAAAk1TRnQBSQFMAgEBAgEAAYABAAGAAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA