Browse Source

xls:修改设备部件,CADID控制

xulisong 6 years ago
parent
commit
981e6e014f

+ 1 - 1
MBI/SAGA.MBI/Model/CloudDataBase.cs

@@ -88,7 +88,7 @@ namespace SAGA.MBI.Model
                     {
                         continue;
                     }
-                    if (value.IsNotNullEmpty())
+                    if (value.IsNotNullEmpty()&& info.CanWrite)
                     {
                         object obj = Convert.ChangeType(value, info.PropertyType);
                         info.SetValue(this, obj);

+ 11 - 3
MBI/SAGA.MBI/Model/MEquipment.cs

@@ -70,7 +70,7 @@ namespace SAGA.MBI.Model
             {
                 m_LocalId = value;
                 NotifyPropertyChanged("LocalId");
-                NotifyPropertyChanged("CADID");
+                //NotifyPropertyChanged("CADID");
             }
         }
 
@@ -83,14 +83,22 @@ namespace SAGA.MBI.Model
             {
                 m_LocalName = value;
                 NotifyPropertyChanged("LocalName");
-                NotifyPropertyChanged("CADID");
+               // NotifyPropertyChanged("CADID");
             }
         }
         private string m_CADID;
         [Description("CADID")]
         public string CADID
         {
-            get { return MBIElementUtils.GetCADID(LocalId, LocalName); }
+
+            get
+            {
+                if (!string.IsNullOrWhiteSpace(Id))
+                {
+                    return null;
+                }
+                return MBIElementUtils.GetCADID(LocalId, LocalName);
+            }
         }
 
         #endregion CloudProperty

+ 10 - 3
MBI/SAGA.MBI/Model/MEquipmentPart.cs

@@ -77,7 +77,7 @@ namespace SAGA.MBI.Model
             {
                 m_LocalId = value;
                 NotifyPropertyChanged("LocalId");
-                NotifyPropertyChanged("CADID");
+                //NotifyPropertyChanged("CADID");
             }
         }
 
@@ -91,14 +91,21 @@ namespace SAGA.MBI.Model
             {
                 m_LocalName = value;
                 NotifyPropertyChanged("LocalName");
-                NotifyPropertyChanged("CADID");
+                //NotifyPropertyChanged("CADID");
             }
         }
         private string m_CADID;
         [Description("CADID")]
         public string CADID
         {
-            get { return MBIElementUtils.GetCADID(LocalId, LocalName); }
+            get
+            {
+                if (!string.IsNullOrWhiteSpace(Id))
+                {
+                    return null;
+                }
+                return MBIElementUtils.GetCADID(LocalId, LocalName);
+            }
         }
         #endregion Model