private string ParseMessage(string message, IntegrityCheckRun run, string logic) { var finalLogic = ParseLogic(run, logic); var finalMessage = message.Replace("{0}", run.Finding).Replace("{1}", finalLogic); if (run.RunStatus == LogicStatus.Pass) { finalMessage = finalMessage.Split('|')[0]; } else { finalMessage = finalMessage.Split('|')[1]; } return(finalMessage); }
private string ParseLogic(IntegrityCheckRun run, string logic) { if ( run.IntegrityCheckId == new Guid("d0586c5e-678a-11eb-ae93-0242ac130002") || run.IntegrityCheckId == new Guid("d0586e3e-678a-11eb-ae93-0242ac130002") || run.IntegrityCheckId == new Guid("d0586f06-678a-11eb-ae93-0242ac130002")) { // var date = DateTime.TryParse(run.Finding, out DateTime local); if (date) { var daysElapsed = DateTime.Today.Subtract(local).Days; logic = $"{daysElapsed}"; } } return(logic); }