// 单击菜单"项目"-"打开项目" private void OpenProjectMenu_Click(object sender, RoutedEventArgs e) { // 隐藏项目基本信息窗口 foreach (TreeViewItem item in this.ProjectTreeView.Items) { item.IsSelected = false; } // 重置窗口 SetProgramText(); // 打开 ProjectList projectList = new ProjectList(); projectList.ShowDialog(); if (projectList.DialogResult == true) { MenuIsEnable(true); SetProgramText(Program.currentProject); // 赋值钻孔列表 bind.ReSetZkItem(Program.currentProject); // 赋值原位测试-静力触探列表 if (CPTDataBase.ReadJkList(Program.currentProject).Count > 0) { bind.AddItemToSecondTree(2, "静力触探"); } bind.ReSetJkItem(Program.currentProject); // 赋值室内试验-土工常规 if (RoutineSoilTestDataBase.ReadAllData(Program.currentProject).Count > 0) { bind.AddItemToSecondTree(3, "土工常规"); bind.TreeItem[3].IsExpanded = true; } // 赋值室内试验-颗粒分析 if (GrainAnalysisTestDataBase.ReadAllData(Program.currentProject).Count > 0) { bind.AddItemToSecondTree(3, "颗粒分析"); bind.TreeItem[3].IsExpanded = true; } } }
/// <summary> /// 触探孔编号输入框内容变化时 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void JKNameTextBox_TextChanged(object sender, TextChangedEventArgs e) { tt0.IsOpen = false; tt1.IsOpen = false; string str = this.JKNameTextBox.Text; if (string.IsNullOrEmpty(str) || string.IsNullOrWhiteSpace(str)) { this.JKNameTextBox.BorderBrush = Brushes.Red; setCanJkName = false; tt1.IsOpen = true; } else if (CPTDataBase.ReadJkList(Program.currentProject).Contains(str) && str != oldJkName) { this.JKNameTextBox.BorderBrush = Brushes.Red; setCanJkName = false; tt0.IsOpen = true; } else { this.JKNameTextBox.BorderBrush = Brushes.Gray; setCanJkName = true; } }