/// <summary> /// Permet de générer une erreur de validation /// </summary> /// <param name="ruleResults"> </param> public static void CheckResultOfValidation(RuleResults ruleResults) { if (ruleResults != null && ruleResults.Count > 0) { var _exceptions = new ProcessResults(); foreach (var objRuleResultTemp in ruleResults) { var r = new ReturnMessage(TypeError.ValidationObjet, Utilities.TranslateSeverity(objRuleResultTemp.RuleInformation.Severity), objRuleResultTemp.RuleInformation.CodeMessage, objRuleResultTemp.RuleInformation.Description, false, objRuleResultTemp.Property ) { ObjectName = objRuleResultTemp.ObjectName, ObjectPropertyName = objRuleResultTemp.Property, RuleType = objRuleResultTemp.RuleInformation.Type, RuleReference = objRuleResultTemp.RuleInformation }; _exceptions.AddException(r); } if (ruleResults.Count > 0) { throw new ExceptionProcess <ProcessResults> (_exceptions); } } }
/// <summary> /// Converti un objet de type RulesResults en objet de type ProcessResults /// </summary> /// <param name="results"> Objet de type RuleResults à convertir. </param> /// <returns> Retourne l'objet de type ProcessResults converti. </returns> public static ProcessResults ConvertRuleResultsToProcessResults(RuleResults results) { var processresults = new ProcessResults(); foreach (var objRuleResultTemp in results) { var r = new ReturnMessage(TypeError.ValidationObjet, TranslateSeverity(objRuleResultTemp.RuleInformation.Severity), objRuleResultTemp.RuleInformation.CodeMessage, objRuleResultTemp.RuleInformation.Description, false, objRuleResultTemp.Property) { ObjectName = objRuleResultTemp.ObjectName, ObjectPropertyName = objRuleResultTemp.Property }; processresults.AddException(r); } return(processresults); }
public override void ShowBusinessValidation(string title, string message, ProcessResults processResults) { StringBuilder sb = new StringBuilder(); Control crtlMSG = null; if (IsInMasterPage) crtlMSG = Master.FindControl(CRTLMSG); else crtlMSG = this.FindControl(CRTLMSG); foreach (var item in processResults.MessagesList) { sb.AppendLine("<br><div id = 'MKSMSG" + item.CodeMessage+"' class='alert alert-" + GetSeverity(item.Severity) + "'>"); sb.AppendLine("<a href = '#' class='close' data-dismiss='alert'>×</a>"); sb.AppendLine("<strong>" + item.CodeMessage + "</strong><br>" + item.Description); sb.AppendLine("</div>"); } crtlMSG.Controls.Add(new LiteralControl(sb.ToString())); }
public virtual void ShowSecurity(string title, string message, ProcessResults processResults) { vb.SecurityMessages=processResults; }
public virtual void ShowReservation(string title, string message, ProcessResults processResults) { vb.ReservationMessages=processResults; }
public virtual void ShowBusinessValidation(string title, string message, ProcessResults processResults) { vb.BusinessMessages = processResults; }
public virtual void ShowBusinessValidationMessage(string titre, ProcessResults result) { vb.ViewBusinessValidation = new Tuple<string, ProcessResults>(titre, result); }
/// <summary> /// Ajout de la liste de messages d'une autre exception à la liste de celle-ci. /// </summary> /// <param name="processResults"> Exception pour laquelle on va ajouter tous ses messages </param> public void AddProcessResultsToList(ProcessResults processResults) { _messageList.AddRange(processResults.MessagesList); }
/// <summary> /// Ajout de la liste de messages d'une autre exception à la liste de celle-ci. /// </summary> /// <param name="processResults"> Exception pour laquelle on va ajouter tous ses messages </param> public void AddProcessResultsToList(ProcessResults processResults) { _messageList.AddRange(processResults.MessagesList); }