public ActionResult SetupGuaranteeTexts() { var context = GetContext(); var configId = GetConfigID(); var texts = GuaranteeModel.GuaranteeModels(context, configId); //var texts = new[] // { // new GuaranteeModel // { // Id = 1, // GuaranteeName = "guar1", // GuaranteeText = "guar1text" // }, // new GuaranteeModel // { // Id = 2, // GuaranteeName = "guar2", // GuaranteeText = "guar2text" // } // }; return(PartialView(texts)); }
private VerificationResult VerificationGuaranteeTexts() { var texts = GuaranteeModel.GuaranteeModels(_context, _configId); var result = new VerificationResult { NameOfVerification = "Guarantee Text Validation", Result = true, Message = "" }; foreach (var guaranteeModel in texts) { if (String.IsNullOrEmpty(guaranteeModel.GuaranteeText)) { result.Result = false; result.Message += String.Format("Guarantee {0} has no text\n", guaranteeModel.GuaranteeName); } } if (result.Result) { result.Message = "All guarantees have texts"; } return(result); }