From 77a4be9a061af13fcd7a0143cf6299172a6fa7f9 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期四, 05 十二月 2024 11:14:46 +0800
Subject: [PATCH] 项目管理优化

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/05-completed/XhsProjectSimulationAnalysisCtrl.cs |   40 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/05-completed/XhsProjectSimulationAnalysisCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/05-completed/XhsProjectSimulationAnalysisCtrl.cs
index e9246bd..08d9475 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/05-completed/XhsProjectSimulationAnalysisCtrl.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/05-completed/XhsProjectSimulationAnalysisCtrl.cs
@@ -5,12 +5,16 @@
         public XhsProjectSimulationAnalysisCtrl()
         {
             InitializeComponent();
+            this.gridView1.SetNormalView(30);
+            this.gridView1.RegistCustomDrawRowIndicator(40);
         }
 
         private List<XhsProjectSimulationAnalysisViewModel> _allBindingList;
 
         public void SetBindingData(Model.RevitModel revitModel)
         {
+            if (revitModel == null)
+                return;
             _allBindingList = new List<XhsProjectSimulationAnalysisViewModel>();
             this.xhsProjectSimulationAnalysisViewModelBindingSource.DataSource = _allBindingList;
             var allRevitParterList = revitModel.GetAllParters();
@@ -28,19 +32,19 @@
                         {
                             case Revit.ePropStatus.Error:
                                 {
-                                    _allBindingList.Add(new XhsProjectSimulationAnalysisViewModel { Type = revitParter.Catalog, Code = revitParter.Code, Name = revitParter.Name, Description = revitParterPropStatus.StatusInfo });
+                                    _allBindingList.Add(new XhsProjectSimulationAnalysisViewModel { Type = revitParter.Catalog, Code = revitParter.Id, Name = revitParter.Name, Description = revitParterPropStatus.StatusInfo, ErrorLevel = "Error", PropStatus = "閿欒" });
                                 }
                                 break;
 
                             case Revit.ePropStatus.Lack:
                                 {
-                                    _allBindingList.Add(new XhsProjectSimulationAnalysisViewModel { Type = revitParter.Catalog, Code = revitParter.Code, Name = revitParterPropStatus.PropName, Description = revitParterPropStatus.StatusInfo });
+                                    _allBindingList.Add(new XhsProjectSimulationAnalysisViewModel { Type = revitParter.Catalog, Code = revitParter.Id, Name = revitParterPropStatus.PropName, Description = revitParterPropStatus.StatusInfo, ErrorLevel = "Lack", PropStatus = "缂虹渷" });
                                 }
                                 break;
 
                             case Revit.ePropStatus.Abnormal:
                                 {
-                                    _allBindingList.Add(new XhsProjectSimulationAnalysisViewModel { Type = revitParter.Catalog, Code = revitParter.Code, Name = revitParterPropStatus.PropName, Description = revitParterPropStatus.StatusInfo });
+                                    _allBindingList.Add(new XhsProjectSimulationAnalysisViewModel { Type = revitParter.Catalog, Code = revitParter.Id, Name = revitParterPropStatus.PropName, Description = revitParterPropStatus.StatusInfo, ErrorLevel = "Abnormal", PropStatus = "寮傚父" });
                                 }
                                 break;
 
@@ -51,5 +55,35 @@
             }
             this.xhsProjectSimulationAnalysisViewModelBindingSource.ResetBindings(false);
         }
+
+        //鑷畾涔夊崟鍏冩牸棰滆壊
+        private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
+        {
+            var row = this.gridView1.GetRow(e.RowHandle) as XhsProjectSimulationAnalysisViewModel;
+            if (row == null)
+            {
+                return;
+            }
+            if (e.RowHandle != this.gridView1.FocusedRowHandle)
+            {
+                switch (row.ErrorLevel)
+                {
+                    case "Error":
+                        e.Appearance.BackColor = Color.Red;
+                        e.Appearance.ForeColor = Color.White;
+                        break;
+
+                    case "Lack":
+                        e.Appearance.BackColor = Color.Gray;
+                        e.Appearance.ForeColor = Color.White;
+                        break;
+
+                    case "Abnormal":
+                        e.Appearance.BackColor = Color.Orange;
+                        e.Appearance.ForeColor = Color.White;
+                        break;
+                }
+            };
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3