Ejemplo n.º 1
0
        /// <summary>
        /// Add a fatal error to treament with http code
        /// </summary>
        /// <param name="httpcode"></param>
        /// <param name="message"></param>
        public void AddFatalErrorWithCode(HttpStatusCode httpcode, string message = null)
        {
            var tre = new TreatmentEvent(MessagesType.FatalError, httpcode, message);

            StatusCode = httpcode;
            FatalErrors.Add(tre);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// return a new Treatment, fusion of both treatment
        /// </summary>
        /// <param name="???"></param>
        /// <returns></returns>
        public Treatment Merge(Treatment tr)
        {
            var newTr = new Treatment();

            //merge fatal errors
            newTr.FatalErrors = FatalErrors.Union(tr.FatalErrors).ToList();

            // Merge errors
            newTr.Errors = this.Errors.Union(tr.Errors).ToList();

            // Merge Warnings
            newTr.Warnings = Warnings.Union(tr.Warnings).ToList();

            // Merge info
            newTr.Info = Info.Union(tr.Info).ToList();

            // Merge Objects
            newTr.Objects = Objects.Union(tr.Objects).ToList();
//            newTr.Objects = Treatment.MergeObjects(Objects, tr.Objects);

            return(newTr);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Chack if no fatal errors
 /// </summary>
 /// <returns></returns>
 public bool HasFatalErrors()
 {
     return(FatalErrors.Any());
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Check if no errors or no fatal errors
 /// </summary>
 /// <returns></returns>
 public bool IsSuccess()
 {
     return(!FatalErrors.Any() && !Errors.Any());
 }
Ejemplo n.º 5
0
 public void AddFatalError(string message)
 {
     FatalErrors.Add(new TreatmentEvent(MessagesType.FatalError, message));
 }
Ejemplo n.º 6
0
        }         // Get

        private void AddFatalError(string sError)
        {
            FatalErrors.Add(sError);
            this.log.Debug(sError);
        }         // AddFatalError