示例#1
0
        /// <summary>
        /// Populate <see cref="SloRecord"/> model with the <paramref name="record"/> data obtained from running the Kusto query.
        /// </summary>
        /// <param name="record">Kusto data mapped as <see cref="IDataRecord"/> from a single entry.</param>
        /// <returns><see cref="SloRecord"/> object that contains service and review data.</returns>
        SloRecord ReadSingleResult(IDataRecord record)
        {
            var slo = new SloRecord();

            ThreadContext <SloParsingContext> .Set(new SloParsingContext(slo));

            slo.ServiceId        = record["ServiceId"] as string;
            slo.OrganizationName = record["OrganizationName"] as string;
            slo.ServiceGroupName = record["ServiceGroupName"] as string;
            slo.TeamGroupName    = record["TeamGroupName"] as string;
            slo.ServiceName      = record["ServiceName"] as string;
            slo.SetYamlValue(record["YamlValue"] as string);

            slo.ReviewPassed  = Convert.ToBoolean(record["ReviewPassed"]);
            slo.ReviewDetails = record["ReviewDetails"].ToString();
            slo.ReviewDate    = !record.IsDBNull(record.GetOrdinal("ReviewDate"))
                ? (DateTime)record["ReviewDate"]
                : new DateTime();
            slo.ReviewedBy             = record["ReviewedBy"].ToString();
            slo.AdvancedReviewRequired = !record.IsDBNull(record.GetOrdinal("AdvancedReviewRequired"))
                ? Convert.ToBoolean(record["AdvancedReviewRequired"])
                : false;
            slo.AcknowledgmentDetails = record["AcknowledgmentDetails"].ToString();
            slo.AcknowledgmentDate    = !record.IsDBNull(record.GetOrdinal("AcknowledgmentDate"))
                ? (DateTime)record["AcknowledgmentDate"]
                : new DateTime();
            slo.AcknowledgedBy        = record["AcknowledgedBy"].ToString();
            slo.AcknowledgedYamlValue = record["SloDefinition"].ToString();

            return(slo);
        }
示例#2
0
        SloRecord ReadSingleResult(IDataRecord record)
        {
            var slo = new SloRecord();

            ThreadContext <SloParsingContext> .Set(new SloParsingContext(slo));

            slo.ServiceId        = record["ServiceId"] as string;
            slo.OrganizationName = record["OrganizationName"] as string;
            slo.ServiceGroupName = record["ServiceGroupName"] as string;
            slo.TeamGroupName    = record["TeamGroupName"] as string;
            slo.ServiceName      = record["ServiceName"] as string;
            slo.SetYamlValue(record["YamlValue"] as string);
            if (!record.IsDBNull(record.GetOrdinal("ReviewPassed")))
            {
                slo.ReviewPassed = ((sbyte)record.GetValue(record.GetOrdinal("ReviewPassed")) != 0);
            }
            slo.ReviewDetails = record["ReviewDetails"] as string;
            if (!record.IsDBNull(record.GetOrdinal("ReviewDate")))
            {
                slo.ReviewDate = record.GetDateTime(record.GetOrdinal("ReviewDate"));
            }
            slo.ReviewedBy = record["ReviewedBy"] as string;

            return(slo);
        }
示例#3
0
        public SloManualReview(SloRecord record)
        {
            ServiceId     = Guid.Parse(record.ServiceId);
            ReviewPassed  = record.ReviewPassed;
            ReviewDetails = record.ReviewDetails;

            // Update Review Date to be the current date
            ReviewDate        = DateTime.Now;
            record.ReviewDate = ReviewDate;

            // Update Reviewed By to be the current user
            ReviewedBy        = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
            record.ReviewedBy = ReviewedBy;
        }
示例#4
0
        public SloManualReview(SloRecord record)
        {
            ServiceId     = Guid.Parse(record.ServiceId);
            ReviewPassed  = record.ReviewPassed;
            ReviewDetails = record.ReviewDetails;
            // reset Advanced review required flag if the reviewer resets the manual review
            // so service owners can address new comments
            AdvancedReviewRequired = record.ReviewPassed ? record.AdvancedReviewRequired : false;
            AcknowledgmentDetails  = record.AcknowledgmentDetails;
            AcknowledgmentDate     = record.AcknowledgmentDate;
            AcknowledgedBy         = record.AcknowledgedBy;
            AcknowledgedYamlValue  = record.AcknowledgedYamlValue;

            // Update Review Date to be the current date
            ReviewDate        = DateTime.Now;
            record.ReviewDate = ReviewDate;

            // Update Reviewed By to be the current user
            ReviewedBy        = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
            record.ReviewedBy = ReviewedBy;
        }
示例#5
0
 public SloParsingContext(SloRecord record)
 {
     Record = record;
 }