Ejemplo n.º 1
0
        /// <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);
                }
            }
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        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'>&times;</a>");
                sb.AppendLine("<strong>" + item.CodeMessage + "</strong><br>" + item.Description);
                sb.AppendLine("</div>");
            }
            crtlMSG.Controls.Add(new LiteralControl(sb.ToString()));
        }
Ejemplo n.º 4
0
 public virtual void ShowSecurity(string title, string message, ProcessResults processResults)
 {
     vb.SecurityMessages=processResults;
 }
Ejemplo n.º 5
0
 public virtual void ShowReservation(string title, string message, ProcessResults processResults)
 {
     vb.ReservationMessages=processResults;
 }
Ejemplo n.º 6
0
 public virtual void ShowBusinessValidation(string title, string message, ProcessResults processResults)
 {
     vb.BusinessMessages = processResults;
 }
Ejemplo n.º 7
0
 public virtual void ShowBusinessValidationMessage(string titre, ProcessResults result)
 {
     vb.ViewBusinessValidation = new Tuple<string, ProcessResults>(titre, result);
 }
Ejemplo n.º 8
0
 /// <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);
 }
Ejemplo n.º 9
0
 /// <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);
 }