public void AddError(string propName, string error)
        {
            var e = new ErrorLogDO();
            if (error.StartsWith("Warning::"))
            {
                e.Level = "W";
            }
            else
            {
                e.Level = "E";
            }

            e.TableName = _tableName;
            e.ColumnName = propName;
            e.Message = error;
            e.Program = AppDomain.CurrentDomain.FriendlyName;
            AddError(propName, e);
        }
		public void SetValues(ErrorLogDO obj)
		{
			if(obj == null) { return; }
			TableName = obj.TableName;
			CN_Number = obj.CN_Number;
			ColumnName = obj.ColumnName;
			Level = obj.Level;
			Message = obj.Message;
			Program = obj.Program;
			Suppress = obj.Suppress;
		}
		public ErrorLogDO(ErrorLogDO obj) : this()
		{
		    SetValues(obj);
		}
        private void AddError(string propName, ErrorLogDO e)
        {
            lock (this._errorsSyncLock)
            {
                if (this._errors == null)
                {
                    this._errors = new Dictionary<string, ErrorLogDO>();
                }

                if (_errors.ContainsKey(propName) == true)
                {
                    ErrorLogDO e1 = _errors[propName];
                    if (e1.Level[0] != e.Level[0] && e1.Suppress == true)
                    {
                        _errors[propName] = e;
                        //OnErrorsChanged(new DataErrorsChangedEventArgs(propName));
                    }
                    else if (e1.Message == e.Message && (e.Suppress == true && e1.Suppress == false))
                    {
                        if (e1.IsPersisted)
                        {
                            e1.Delete();
                        }
                        _errors[propName] = e;
                        //OnErrorsChanged(new DataErrorsChangedEventArgs(propName));
                    }
                    else if (e1.Level.StartsWith("W") && e.Level.StartsWith("E"))
                    {
                        _errors[propName] = e;
                        //OnErrorsChanged(new DataErrorsChangedEventArgs(propName));
                    }
                }
                else
                {
                    _errors[propName] = e;
                    //OnErrorsChanged(new DataErrorsChangedEventArgs(propName));
                }

                OnDataErrorsChanged(new DataErrorsChangedEventArgs(propName));
            }
        }
Beispiel #5
0
 private static void InsureErrorLogEntry(DAL db, ErrorLogDO el)
 {
     if (db.GetRowCount(el.TableName, "WHERE rowID = ?", el.CN_Number) == 0)
     {
         el.Delete();
     }
 }