/// <summary> ///Monitoring Element Conditions /// </summary> /// <param name="dt"></param> /// <returns></returns> public List <MonitoringElementConditionsEntity> AdaptElementConditions(DataTable dt) { List <MonitoringElementConditionsEntity> results = new List <MonitoringElementConditionsEntity>(); foreach (DataRow rw in dt.Rows) { MonitoringElementConditionsEntity profileDataEntity = new MonitoringElementConditionsEntity(); profileDataEntity = AdaptElementConditionsItem(rw, dt); results.Add(profileDataEntity); } return(results); }
public MonitoringElementConditionsEntity AdaptElementConditionsItem(DataRow rw, DataTable dt) { MonitoringElementConditionsEntity result = new MonitoringElementConditionsEntity(); result.MonitoringConditionID = SafeHelper.GetSafeint(rw["MonitoringConditionID"]); if (dt.Columns.Contains("ProfileID")) { result.ProfileID = SafeHelper.GetSafeint(rw["ProfileID"]); } if (dt.Columns.Contains("ProductElementID")) { result.ProductElementID = SafeHelper.GetSafeint(rw["ProductElementID"]); } if (dt.Columns.Contains("ElementName")) { result.ElementName = SafeHelper.GetSafestring(rw["ElementName"]); } if (dt.Columns.Contains("ChangeCondition")) { result.ChangeCondition = SafeHelper.GetSafestring(rw["ChangeCondition"]); } if (dt.Columns.Contains("Condition")) { result.Condition = SafeHelper.GetSafestring(rw["Condition"]); } if (dt.Columns.Contains("JsonCondition")) { result.JsonCondition = SafeHelper.GetSafestring(rw["JsonCondition"]); } if (dt.Columns.Contains("ElementPCMXPath")) { result.ElementPCMXPath = SafeHelper.GetSafestring(rw["ElementPCMXPath"]); } result.TempConditionId = SafeHelper.GetSafeint(rw["MonitoringConditionID"]); return(result); }