예제 #1
0
        /// <summary>
        /// Monitoring Profile
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public List <MonitoringProfileEntity> AdaptProfile(DataTable dt)
        {
            List <MonitoringProfileEntity> results = new List <MonitoringProfileEntity>();

            foreach (DataRow rw in dt.Rows)
            {
                MonitoringProfileEntity profileDataEntity = new MonitoringProfileEntity();
                profileDataEntity = AdaptprofileItem(rw, dt);
                results.Add(profileDataEntity);
            }
            return(results);
        }
예제 #2
0
        public MonitoringProfileEntity AdaptprofileItem(DataRow rw, DataTable dt)
        {
            MonitoringProfileEntity result = new MonitoringProfileEntity();

            if (dt.Columns.Contains("ProfileName"))
            {
                result.ProfileName = SafeHelper.GetSafestring(rw["ProfileName"]);
            }

            if (dt.Columns.Contains("ProfileDescription"))
            {
                result.ProfileDescription = SafeHelper.GetSafestring(rw["ProfileDescription"]);
            }

            if (dt.Columns.Contains("ProductCode"))
            {
                result.ProductCode = SafeHelper.GetSafestring(rw["ProductCode"]);
            }

            if (dt.Columns.Contains("ProductID"))
            {
                result.ProductID = SafeHelper.GetSafeint(rw["ProductID"]);
            }

            if (dt.Columns.Contains("MonitoringLevel"))
            {
                result.MonitoringLevel = SafeHelper.GetSafestring(rw["MonitoringLevel"]);
            }

            if (dt.Columns.Contains("ApplicationTransactionID"))
            {
                result.ApplicationTransactionID = SafeHelper.GetSafeint(rw["ApplicationTransactionID"]);
            }

            if (dt.Columns.Contains("TransactionTimestamp"))
            {
                result.TransactionTimestamp = SafeHelper.GetSafeDateTime(rw["TransactionTimestamp"]);
            }

            if (dt.Columns.Contains("CustomerReferenceText"))
            {
                result.CustomerReferenceText = SafeHelper.GetSafestring(rw["CustomerReferenceText"]);
            }

            if (dt.Columns.Contains("ResultID"))
            {
                result.ResultID = SafeHelper.GetSafestring(rw["ResultID"]);
            }

            if (dt.Columns.Contains("SeverityText"))
            {
                result.SeverityText = SafeHelper.GetSafestring(rw["SeverityText"]);
            }

            if (dt.Columns.Contains("ResultText"))
            {
                result.ResultText = SafeHelper.GetSafestring(rw["ResultText"]);
            }

            if (dt.Columns.Contains("MonitoringProfileID"))
            {
                result.MonitoringProfileID = SafeHelper.GetSafeint(rw["MonitoringProfileID"]);
            }

            if (dt.Columns.Contains("RequestDateTime"))
            {
                result.RequestDateTime = SafeHelper.GetSafeDateTime(rw["RequestDateTime"]);
            }

            if (dt.Columns.Contains("ResponseDateTime"))
            {
                result.ResponseDateTime = SafeHelper.GetSafeDateTime(rw["ResponseDateTime"]);
            }

            if (dt.Columns.Contains("CreatedBy"))
            {
                result.CreatedBy = SafeHelper.GetSafeint(rw["CreatedBy"]);
            }

            if (dt.Columns.Contains("ModifiedBy"))
            {
                result.CreatedBy = SafeHelper.GetSafeint(rw["ModifiedBy"]);
            }

            if (dt.Columns.Contains("CreatedDateTime"))
            {
                result.CreatedDateTime = SafeHelper.GetSafeDateTime(rw["CreatedDateTime"]);
            }

            if (dt.Columns.Contains("ModifiedDateTime"))
            {
                result.ModifiedDateTime = SafeHelper.GetSafeDateTime(rw["ModifiedDateTime"]);
            }

            if (dt.Columns.Contains("ElementName"))
            {
                result.ElementName = SafeHelper.GetSafestring(rw["ElementName"]);
            }

            if (dt.Columns.Contains("Condition"))
            {
                result.Condition = SafeHelper.GetSafestring(rw["Condition"]);
            }

            if (dt.Columns.Contains("SingleCondition"))
            {
                result.SingleCondition = SafeHelper.GetSafebool(rw["SingleCondition"]);
            }

            if (dt.Columns.Contains("CredentialId"))
            {
                result.CredentialId = SafeHelper.GetSafeint(rw["CredentialId"]);
            }

            return(result);
        }