/// <summary> /// Deep Clone /// </summary> /// <returns></returns> public IDSSubSystem Copy() { IDSSubSystem subSystem = MemberwiseClone() as IDSSubSystem; subSystem.Loops = this.Loops.Copy(); return(subSystem); }
public IDSLoop(IDSSubSystem subSystem) { ID = ""; ParentID = ""; _subSystem = subSystem; LoopType = ""; SerialNumber = ""; Suffix = ""; ShortLocation = ""; Medium = ""; Parameter = ""; NormalTemperature = ""; UplimitTemperature = ""; NormalPressure = ""; UplimitPressure = ""; PressureUnit = ""; PipeMaterial = ""; DN = ""; ContainerMaterial = ""; HasInnerLining = false; AmbientTemperature = ""; AmbientExLevel = ""; MediumExLevel = ""; MeasurementRange = ""; ProcessRange = ""; Unit = ""; Function = ""; Description = ""; Source = ""; SubLoops = new IDSSubLoopCollection(); }
public static IDSSubSystem CreateIDSSubSystem(DataRow rowSubSystem, string systemCode, DataTable tableLoop, DataTable tableHierarchy, DataTable tableEquipment, DataTable tableSubEquipment, DataTable tableRepositories, DataTable tableCable, DataTable tableMountingScheme) { if (rowSubSystem == null) { throw new System.ArgumentNullException("frome function CreateIDSSubSystem", "Parameter rowSubSystem equals to null"); } IDSSubSystem subSystem = new IDSSubSystem(); lock (rowSubSystem) { try { subSystem.ID = Convert.ToString(rowSubSystem[TblIDSHierarchy.ID]).Trim(); subSystem.ParentID = Convert.ToString(rowSubSystem[TblIDSHierarchy.ParentID]).Trim(); subSystem.Code = (rowSubSystem[TblIDSHierarchy.Code] as string).Trim(); subSystem.Name = (rowSubSystem[TblIDSHierarchy.Name] as string).Trim(); subSystem.IsNameInLoop = Convert.ToBoolean(rowSubSystem[TblIDSHierarchy.IsNameInLoop]); subSystem.Phase = (rowSubSystem[TblIDSHierarchy.Phase] as string).Trim(); subSystem.SerialNumber = Convert.ToString(rowSubSystem[TblIDSHierarchy.SerialNumber]).Trim(); subSystem.Description = (rowSubSystem[TblIDSHierarchy.Description] as string).Trim(); subSystem.Loops.Clear(); lock (tableLoop) { foreach (DataRow rowLoop in tableLoop.Rows) { if (Convert.ToString(rowLoop[TblIDSLoop.ParentID]).Trim() == subSystem.ID) { subSystem.Loops.Add(CreateIDSLoop(rowLoop, subSystem.Code, systemCode, (subSystem.IsNameInLoop == true ? subSystem.Name : ""), tableHierarchy, tableEquipment, tableSubEquipment, tableRepositories, tableCable, tableMountingScheme)); } } } } catch (System.Data.DataException ex) { MessageBoxWinForm.Info("数据访问错误", ex.Message, ""); } } return(subSystem); }