C2024-005 - Kevin working on folder retrieval

This commit is contained in:
Kevin Laskey 2024-07-22 09:28:48 -04:00
parent 501798a8cb
commit 6e6abbd759
3 changed files with 94 additions and 45 deletions

View File

@ -350,7 +350,7 @@
this.pnlLater.Controls.Add(this.dtpDate); this.pnlLater.Controls.Add(this.dtpDate);
this.pnlLater.Dock = System.Windows.Forms.DockStyle.Top; this.pnlLater.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlLater.Enabled = false; this.pnlLater.Enabled = false;
this.pnlLater.Location = new System.Drawing.Point(6, 23); this.pnlLater.Location = new System.Drawing.Point(6, 27);
this.pnlLater.Name = "pnlLater"; this.pnlLater.Name = "pnlLater";
this.pnlLater.Padding = new System.Windows.Forms.Padding(6); this.pnlLater.Padding = new System.Windows.Forms.Padding(6);
this.pnlLater.Size = new System.Drawing.Size(279, 37); this.pnlLater.Size = new System.Drawing.Size(279, 37);
@ -391,7 +391,7 @@
this.chkLater.Dock = System.Windows.Forms.DockStyle.Top; this.chkLater.Dock = System.Windows.Forms.DockStyle.Top;
this.chkLater.Location = new System.Drawing.Point(6, 6); this.chkLater.Location = new System.Drawing.Point(6, 6);
this.chkLater.Name = "chkLater"; this.chkLater.Name = "chkLater";
this.chkLater.Size = new System.Drawing.Size(279, 17); this.chkLater.Size = new System.Drawing.Size(279, 21);
this.chkLater.TabIndex = 4; this.chkLater.TabIndex = 4;
this.chkLater.Text = "Process Later"; this.chkLater.Text = "Process Later";
this.chkLater.UseVisualStyleBackColor = true; this.chkLater.UseVisualStyleBackColor = true;
@ -496,9 +496,9 @@
this.sideNavPanel4.Controls.Add(this.myTVdel); this.sideNavPanel4.Controls.Add(this.myTVdel);
this.sideNavPanel4.Controls.Add(this.btnDeleteItems); this.sideNavPanel4.Controls.Add(this.btnDeleteItems);
this.sideNavPanel4.Dock = System.Windows.Forms.DockStyle.Fill; this.sideNavPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.sideNavPanel4.Location = new System.Drawing.Point(89, 31); this.sideNavPanel4.Location = new System.Drawing.Point(102, 39);
this.sideNavPanel4.Name = "sideNavPanel4"; this.sideNavPanel4.Name = "sideNavPanel4";
this.sideNavPanel4.Size = new System.Drawing.Size(291, 494); this.sideNavPanel4.Size = new System.Drawing.Size(278, 486);
this.sideNavPanel4.TabIndex = 27; this.sideNavPanel4.TabIndex = 27;
// //
// swDeleteFolder // swDeleteFolder
@ -514,7 +514,6 @@
this.superTooltip1.SetSuperTooltip(this.swDeleteFolder, new DevComponents.DotNetBar.SuperTooltipInfo("Check RO Links", "", resources.GetString("swDeleteFolder.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(250, 150))); this.superTooltip1.SetSuperTooltip(this.swDeleteFolder, new DevComponents.DotNetBar.SuperTooltipInfo("Check RO Links", "", resources.GetString("swDeleteFolder.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(250, 150)));
this.swDeleteFolder.SwitchClickTogglesValue = true; this.swDeleteFolder.SwitchClickTogglesValue = true;
this.swDeleteFolder.TabIndex = 39; this.swDeleteFolder.TabIndex = 39;
this.swDeleteFolder.Visible = false;
this.swDeleteFolder.ValueChanged += new System.EventHandler(this.swDeleteFolder_ValueChanged); this.swDeleteFolder.ValueChanged += new System.EventHandler(this.swDeleteFolder_ValueChanged);
// //
// labelX13 // labelX13
@ -573,7 +572,7 @@
this.myTVdel.CheckBoxes = true; this.myTVdel.CheckBoxes = true;
this.myTVdel.Location = new System.Drawing.Point(14, 145); this.myTVdel.Location = new System.Drawing.Point(14, 145);
this.myTVdel.Name = "myTVdel"; this.myTVdel.Name = "myTVdel";
this.myTVdel.Size = new System.Drawing.Size(267, 331); this.myTVdel.Size = new System.Drawing.Size(254, 323);
this.myTVdel.TabIndex = 34; this.myTVdel.TabIndex = 34;
// //
// btnDeleteItems // btnDeleteItems
@ -617,7 +616,7 @@
this.warningBox3.CloseButtonVisible = false; this.warningBox3.CloseButtonVisible = false;
this.warningBox3.Image = ((System.Drawing.Image)(resources.GetObject("warningBox3.Image"))); this.warningBox3.Image = ((System.Drawing.Image)(resources.GetObject("warningBox3.Image")));
this.warningBox3.Location = new System.Drawing.Point(17, 207); this.warningBox3.Location = new System.Drawing.Point(17, 207);
this.warningBox3.Margin = new System.Windows.Forms.Padding(4); this.warningBox3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.warningBox3.Name = "warningBox3"; this.warningBox3.Name = "warningBox3";
this.warningBox3.OptionsButtonVisible = false; this.warningBox3.OptionsButtonVisible = false;
this.warningBox3.Size = new System.Drawing.Size(264, 32); this.warningBox3.Size = new System.Drawing.Size(264, 32);
@ -821,7 +820,7 @@
this.warningBox4.CloseButtonVisible = false; this.warningBox4.CloseButtonVisible = false;
this.warningBox4.Image = ((System.Drawing.Image)(resources.GetObject("warningBox4.Image"))); this.warningBox4.Image = ((System.Drawing.Image)(resources.GetObject("warningBox4.Image")));
this.warningBox4.Location = new System.Drawing.Point(12, 264); this.warningBox4.Location = new System.Drawing.Point(12, 264);
this.warningBox4.Margin = new System.Windows.Forms.Padding(4); this.warningBox4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.warningBox4.Name = "warningBox4"; this.warningBox4.Name = "warningBox4";
this.warningBox4.OptionsButtonVisible = false; this.warningBox4.OptionsButtonVisible = false;
this.warningBox4.Size = new System.Drawing.Size(264, 32); this.warningBox4.Size = new System.Drawing.Size(264, 32);
@ -834,7 +833,7 @@
this.warningBox2.CloseButtonVisible = false; this.warningBox2.CloseButtonVisible = false;
this.warningBox2.Image = ((System.Drawing.Image)(resources.GetObject("warningBox2.Image"))); this.warningBox2.Image = ((System.Drawing.Image)(resources.GetObject("warningBox2.Image")));
this.warningBox2.Location = new System.Drawing.Point(12, 302); this.warningBox2.Location = new System.Drawing.Point(12, 302);
this.warningBox2.Margin = new System.Windows.Forms.Padding(4); this.warningBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.warningBox2.Name = "warningBox2"; this.warningBox2.Name = "warningBox2";
this.warningBox2.OptionsButtonVisible = false; this.warningBox2.OptionsButtonVisible = false;
this.warningBox2.Size = new System.Drawing.Size(264, 43); this.warningBox2.Size = new System.Drawing.Size(264, 43);
@ -1065,7 +1064,7 @@
this.warningBox5.CloseButtonVisible = false; this.warningBox5.CloseButtonVisible = false;
this.warningBox5.Image = ((System.Drawing.Image)(resources.GetObject("warningBox5.Image"))); this.warningBox5.Image = ((System.Drawing.Image)(resources.GetObject("warningBox5.Image")));
this.warningBox5.Location = new System.Drawing.Point(17, 145); this.warningBox5.Location = new System.Drawing.Point(17, 145);
this.warningBox5.Margin = new System.Windows.Forms.Padding(4); this.warningBox5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.warningBox5.Name = "warningBox5"; this.warningBox5.Name = "warningBox5";
this.warningBox5.OptionsButtonVisible = false; this.warningBox5.OptionsButtonVisible = false;
this.warningBox5.Size = new System.Drawing.Size(262, 32); this.warningBox5.Size = new System.Drawing.Size(262, 32);
@ -1149,7 +1148,7 @@
this.warningBox1.CloseButtonVisible = false; this.warningBox1.CloseButtonVisible = false;
this.warningBox1.Image = ((System.Drawing.Image)(resources.GetObject("warningBox1.Image"))); this.warningBox1.Image = ((System.Drawing.Image)(resources.GetObject("warningBox1.Image")));
this.warningBox1.Location = new System.Drawing.Point(17, 181); this.warningBox1.Location = new System.Drawing.Point(17, 181);
this.warningBox1.Margin = new System.Windows.Forms.Padding(4); this.warningBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.warningBox1.Name = "warningBox1"; this.warningBox1.Name = "warningBox1";
this.warningBox1.OptionsButtonVisible = false; this.warningBox1.OptionsButtonVisible = false;
this.warningBox1.Size = new System.Drawing.Size(262, 43); this.warningBox1.Size = new System.Drawing.Size(262, 43);

View File

@ -158,7 +158,7 @@ namespace VEPROMS
{ {
if (noProcs) if (noProcs)
{ {
LoadBottomLevelFolders(fi, myTVdel); LoadFolders(fi, myTVdel, null);
} }
else else
{ {
@ -223,33 +223,99 @@ namespace VEPROMS
return loadedWorkingDraft; return loadedWorkingDraft;
} }
/// <summary> /// <summary>
/// Load only bottom layer of folders into treenode. /// Load only folders into treeview
/// </summary> /// </summary>
/// <param name="fi"></param> private void LoadFolders(FolderInfo fi, TreeView treeView, TreeNode parentNode)
/// <param name="tn"></param>
private void LoadBottomLevelFolders(FolderInfo fi, TreeView treeView)
{ {
foreach (FolderInfo fic in fi.SortedChildFolders) foreach (FolderInfo fic in fi.SortedChildFolders)
{ {
TreeNode tnc = treeView.Nodes.Add(fic.Name);
tnc.Tag = fic;
if (fic.ChildFolderCount > 0) if (fic.ChildFolderCount > 0)
{ {
// Recursively call for child folders // Recursively call for child folders
LoadBottomLevelFolders(fic, treeView); LoadFolders(fic, treeView, tnc);
} }
else else
{ {
if (fic.Name != "PROMS") if (fic.Name != "PROMS")
{ {
// If the folder is a bottom-level folder (no child folders), add it directly to the TreeView // If the folder is a bottom-level folder (no child folders), add it directly to the TreeView
TreeNode tnc = treeView.Nodes.Add(fic.Name);
tnc.Tag = fic; //Working
//foreach (DocVersionInfo dvi in fic.FolderDocVersions)
//{
// myDocVersions.Add(tnc, dvi);
//}
// If parentNode is null, add to the root of the tree
if (parentNode == null)
{
// If the folder is a bottom-level folder (no child folders), add it directly to the TreeView
treeView.Nodes.Add(tnc);
foreach (DocVersionInfo dvi in fic.FolderDocVersions)
{
myDocVersions.Add(tnc, dvi);
}
}
else
{
// Otherwise, add to the parent node
parentNode.Nodes.Add(fic.Name);
foreach (DocVersionInfo dvi in fic.FolderDocVersions)
{
myDocVersions.Add(tnc, dvi);
} }
} }
} }
} }
}
//foreach (FolderInfo fic in fi.SortedChildFolders)
//{
// // Skip "PROMS" folder
// if (fic.Name == "PROMS")
// {
// continue;
// }
// //// Create a new tree node for the current folder
// TreeNode tnc = new TreeNode(fic.Name) { Tag = fic };
// // If parentNode is null, add to the root of the tree
// if (parentNode == null)
// {
// // If the folder is a bottom-level folder (no child folders), add it directly to the TreeView
// treeView.Nodes.Add(tnc);
// foreach (DocVersionInfo dvi in fic.FolderDocVersions)
// {
// myDocVersions.Add(tnc, dvi);
// }
// }
// else
// {
// // Otherwise, add to the parent node
// //parentNode.Nodes.Add(tnc);
// // If the folder is a bottom-level folder (no child folders), add it directly to the TreeView
// parentNode.Nodes.Add(fic.Name);
// foreach (DocVersionInfo dvi in fic.FolderDocVersions)
// {
// myDocVersions.Add(tnc, dvi);
// }
// }
// // Recursively call for child folders
// if (fic.ChildFolderCount > 0)
// {
// LoadFolders(fic, treeView, tnc);
// }
//}
}
private bool LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs) private bool LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs)
{ {
bool rtnval = false; bool rtnval = false;
@ -1693,28 +1759,12 @@ namespace VEPROMS
// pil.Add(myProcedures[tn]); // pil.Add(myProcedures[tn]);
////Load Selected Folders ////Load Selected Folders
Dictionary<int, string> folderData = new Dictionary<int, string>(); List<DocVersionInfo> dvil = new List<DocVersionInfo>();
foreach (TreeNode tn in myDocVersions.Keys)
if (tn.Checked)
dvil.Add(myDocVersions[tn]);
//List<FolderInfo> Flist = new List<FolderInfo>(); ProcessDelete(dvil);
//foreach (TreeNode tn in myDocVersions.Keys)
// if (tn.Checked)
// Flist.Add();
//List<DocVersionInfo> dvil = new List<DocVersionInfo>();
//foreach (TreeNode tn in myDocVersions.Keys)
// if (tn.Checked)
// dvil.Add(myDocVersions[tn]);
//foreach (TreeNode tn in myTVdel.Nodes)
//{
// if (tn.Checked)
// {
// var itemInfo = myProcedures[tn];
// folderData.Add(itemInfo.ItemID, itemInfo.DisplayText);
// }
//}
//ProcessDelete(dvil);
} }
else else
{ {