using Neo4j.Driver; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using NPOI.SS.Formula.Functions; using Ramitta; using Ramitta.lib; using System.Collections.Generic; using System.Data.Common; using System.Data.SQLite; using System.Diagnostics; using System.IO; using System.Linq; using System.Security.Cryptography; using System.Security.Policy; using System.Text; using System.Text.RegularExpressions; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Threading; using System.Xml.Linq; using static Ramitta.Excel; using static Ramitta.lib.Basic; using static Ramitta.lib.CryptoHelper; using static Ramitta.SQLite; using static Ramitta.winDataGrid; namespace template { public partial class MainWindow : Window { static string? filePath; #region 初始化MainWindow public MainWindow(StartupEventArgs e) { Startupe = ParseCommandLineArgs(e.Args); InitializeComponent(); if (Startupe.TryGetValue("getfile", out string filePath)) { MainWindow.filePath = filePath; DebugBar(Debugtag, $"操作目标:{filePath}", 正常绿色); } else { DebugBar(Debugtag, $"未指定操作目标", 警告橙色); } } #endregion private async void 增(object sender, RoutedEventArgs e) { 表升天(); } private async void 改(object sender, RoutedEventArgs e) { 库表升天(); } private async void 删(object? sender = null, RoutedEventArgs? e=null) { } private async void 查(object sender, RoutedEventArgs e) { var properties = new Dictionary { { "文件夹", "承重柱" } }; var newmore = await neo4jService.GetRelatedNodesAsync("文件", properties); Debug.WriteLine("=== ☆ ==="); HashSet 北平 = new HashSet(); foreach (var nodeDict in newmore) { if (nodeDict.ContainsKey("型号") && !string.IsNullOrEmpty(nodeDict["型号"])) { 北平.Add(nodeDict["型号"]); } } // 输出结果 Debug.WriteLine($"不重复的型号数量: {北平.Count}"); foreach (var 型号 in 北平) { Debug.WriteLine($"型号: {型号}"); } } } }