Exemple #1
0
        public static List <Model.ErrorOtherLogTrigger> GetPendingTriggers(int?intAppID = null)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand("[dbo].[pr_ErrorOther_SelectPendingTriggers]");
            cmd.CommandType = CommandType.StoredProcedure;
            if (intAppID.HasValue)
            {
                cmd.Parameters.AddWithValue("@AppID", intAppID.Value);
            }
            DataTable objTable = SqlHelper.ExecuteDataset(cmd, null, ConnectionStringName).Tables[0];
            List <Model.ErrorOtherLogTrigger> aryModels = new List <Model.ErrorOtherLogTrigger>();

            foreach (DataRow objRow in objTable.Rows)
            {
                Model.ErrorOtherLogTrigger trigger = new Model.ErrorOtherLogTrigger();
                trigger.ID     = (int)objRow["ErrorOtherLogTriggerID"];
                trigger.Event  = ErrorOther.GetErrorOtherOccurrenceModel(objRow);
                trigger.Filter = (Model.LoggingFilter)LoggingFilter.GetFilterModel(objRow, LoggingFilterViewType.Full);
                aryModels.Add(trigger);
            }
            return(aryModels);
        }
Exemple #2
0
 public void Post(string AppID, ErrorOther error)
 {
     General.ErrorLogging.Data.ErrorOther.StoreEvent(error, null, null);
 }
Exemple #3
0
 public ErrorOther Put(string AppID, ErrorOther error)
 {
     return(General.ErrorLogging.Data.ErrorOther.UpdateEvent(error));
 }
Exemple #4
0
        private bool FullTextMatch(string strSearch, ErrorOther obj)
        {
            if (String.IsNullOrWhiteSpace(strSearch))
            {
                return(true);
            }

            var tokens = FullTextSearch.Tokenize(strSearch);

            bool blnHasNotToken      = tokens.Where(t => t.StartsWith("-")).Count() > 0;
            bool blnMatchedHardBlock = false;
            bool blnMatched          = false;

            if (tokens.Where(t => t.StartsWith("-")).Count() == tokens.Count()) //If I'm only using negative matches, then show everything that isn't eliminated.
            {
                blnMatched = true;
            }

            if (FullTextSearch.TokenContains(obj.AppName, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }
            if (FullTextSearch.TokenContains(obj.CodeMethod, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }
            if (FullTextSearch.TokenContains(obj.CodeFileName, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }
            if (FullTextSearch.TokenEquals(obj.CodeLineNumber.ToString(), tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }
            if (obj.Custom1 != null)
            {
                if (FullTextSearch.TokenContains(obj.Custom1, tokens, out blnMatchedHardBlock))
                {
                    blnMatched = true;
                }
                if (blnHasNotToken && blnMatchedHardBlock)
                {
                    return(false);
                }
                else if (!blnHasNotToken && blnMatched)
                {
                    return(true);
                }
            }
            if (obj.Custom2 != null)
            {
                if (FullTextSearch.TokenContains(obj.Custom2, tokens, out blnMatchedHardBlock))
                {
                    blnMatched = true;
                }
                if (blnHasNotToken && blnMatchedHardBlock)
                {
                    return(false);
                }
                else if (!blnHasNotToken && blnMatched)
                {
                    return(true);
                }
            }
            if (obj.Custom3 != null)
            {
                if (FullTextSearch.TokenContains(obj.Custom3, tokens, out blnMatchedHardBlock))
                {
                    blnMatched = true;
                }
                if (blnHasNotToken && blnMatchedHardBlock)
                {
                    return(false);
                }
                else if (!blnHasNotToken && blnMatched)
                {
                    return(true);
                }
            }
            if (obj.CustomID != null)
            {
                if (FullTextSearch.TokenEquals(obj.CustomID.ToString(), tokens, out blnMatchedHardBlock))
                {
                    blnMatched = true;
                }
                if (blnHasNotToken && blnMatchedHardBlock)
                {
                    return(false);
                }
                else if (!blnHasNotToken && blnMatched)
                {
                    return(true);
                }
            }
            if (FullTextSearch.TokenContains(obj.ErrorCode, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }
            if (FullTextSearch.TokenContains(obj.EventName, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }
            if (FullTextSearch.TokenContains(obj.EventURL, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }
            if (FullTextSearch.TokenContains(obj.ExceptionType, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }
            if (FullTextSearch.TokenContains(obj.MachineName, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }

            if (!String.IsNullOrWhiteSpace(obj.ClientID))
            {
                if (FullTextSearch.TokenContains(obj.ClientID, tokens, out blnMatchedHardBlock))
                {
                    blnMatched = true;
                }
                if (blnHasNotToken && blnMatchedHardBlock)
                {
                    return(false);
                }
                else if (!blnHasNotToken && blnMatched)
                {
                    return(true);
                }
            }
            if (!String.IsNullOrWhiteSpace(obj.UserType))
            {
                if (FullTextSearch.TokenContains(obj.UserType, tokens, out blnMatchedHardBlock))
                {
                    blnMatched = true;
                }
                if (blnHasNotToken && blnMatchedHardBlock)
                {
                    return(false);
                }
                else if (!blnHasNotToken && blnMatched)
                {
                    return(true);
                }
            }
            if (!String.IsNullOrWhiteSpace(obj.UserID))
            {
                if (FullTextSearch.TokenContains(obj.UserID, tokens, out blnMatchedHardBlock))
                {
                    blnMatched = true;
                }
                if (blnHasNotToken && blnMatchedHardBlock)
                {
                    return(false);
                }
                else if (!blnHasNotToken && blnMatched)
                {
                    return(true);
                }
            }
            if (!String.IsNullOrWhiteSpace(obj.EventDetail))
            {
                //The big one is last
                if (FullTextSearch.TokenContains(obj.EventDetail, tokens, out blnMatchedHardBlock))
                {
                    blnMatched = true;
                }
                if (blnHasNotToken && blnMatchedHardBlock)
                {
                    return(false);
                }
                else if (!blnHasNotToken && blnMatched)
                {
                    return(true);
                }
            }
            return(blnMatched);
        }