Exemple #1
0
        public void AddDashFail(string serviceCode)
        {
            if (_dashFail.IndexOf(serviceCode) == -1)
            {
                ValueChangedEventArgs args = new ValueChangedEventArgs
                {
                    OldValue = _dashFail.Count.ToString(),
                    NewValue = (_dashFail.Count + 1).ToString(),
                    CalledBy = Name + " Dashboard fail codes"
                };
                ValueChanged?.Invoke(this, args);


                _dashFail.Add(serviceCode);
                FailCountMatch = CompareFail();


                MatchEventArgs eArgs = new MatchEventArgs()
                {
                    Value    = FailCountMatch,
                    CalledBy = Name + " FailDash"
                };
                MatchChanged?.Invoke(this, eArgs);
            }
        }
Exemple #2
0
        public void AddDashSuccess(string serviceCode)
        {
            if (_dashSuccess.IndexOf(serviceCode) == -1)
            {
                ValueChangedEventArgs args = new ValueChangedEventArgs
                {
                    OldValue = _dashSuccess.Count.ToString(),
                    NewValue = (_dashSuccess.Count + 1).ToString(),
                    CalledBy = Name + " Dashboard success codes"
                };
                ValueChanged?.Invoke(this, args);


                _dashSuccess.Add(serviceCode);


                SuccessCountMatch = CompareSuccess();
                MatchEventArgs eArgs = new MatchEventArgs()
                {
                    Value    = SuccessCountMatch,
                    CalledBy = Name + " SuccessDash "
                };
                MatchChanged?.Invoke(this, eArgs);
            }
        }
Exemple #3
0
        public void AddEmailFail(string serviceCode, string errorMsg)
        {
            if (!_emailFail.ContainsKey(serviceCode))
            {
                ValueChangedEventArgs args = new ValueChangedEventArgs
                {
                    OldValue = _emailFail.Count.ToString(),
                    NewValue = (_emailFail.Count + 1).ToString(),
                    CalledBy = Name + " Email fail codes"
                };
                ValueChanged?.Invoke(this, args);


                _emailFail[serviceCode] = errorMsg;
                FailCountMatch          = CompareFail();
                SetEmailErrorFlag(errorMsg);


                MatchEventArgs eArgs = new MatchEventArgs()
                {
                    Value    = FailCountMatch,
                    CalledBy = Name + " FailEmail"
                };
                MatchChanged?.Invoke(this, eArgs);
            }
        }
Exemple #4
0
 private void SetEmailErrorFlag(string errorMsg)
 {
     EmailError |= errorMsg.Contains("ISM");
     if (EmailError)
     {
         MatchEventArgs eArgs = new MatchEventArgs()
         {
             Value    = EmailError,
             CalledBy = "ISM Error"
         };
         MatchChanged?.Invoke(this, eArgs);
     }
 }
        private void ReportFailChange(object sender, MatchEventArgs args)
        {
            bool overallSuccessMatch = true;
            bool overallFailMatch    = true;
            bool overallEmailError   = false;
            bool overallScriptError  = false;

            foreach (Script script in scripts)
            {
                //if any facility has a mismatch or ISM error then the flag for this facility is set
                if (script.FailCountMatch == false)
                {
                    overallFailMatch = false;
                }
                if (script.SuccessCountMatch == false)
                {
                    overallSuccessMatch = false;
                }
                if (script.EmailError == true)
                {
                    overallEmailError = true;
                }
                if (script.ScriptError == true)
                {
                    overallScriptError = true;
                }
            }

            FacilityFailMatch    = overallFailMatch;
            FacilitySuccessMatch = overallSuccessMatch;
            FacilityISMError     = overallEmailError;
            FacilityScriptError  = overallScriptError;

            Console.WriteLine("Script " + args.CalledBy + " Facility success: " + overallSuccessMatch);
            Console.WriteLine("Script " + args.CalledBy + " Facility fail: " + overallFailMatch);
            Console.WriteLine("Script " + args.CalledBy + " Email error: " + overallEmailError);
            Console.WriteLine("Script " + args.CalledBy + " Script error: " + overallScriptError);
        }
        private void ReportFacFlagsChanged(object sender, MatchEventArgs args)
        {
            //need to check all facility flags
            bool dashFailMatch   = true;
            bool dashSuccMatch   = true;
            bool dashISMError    = false;
            bool dashScriptError = false;

            foreach (Facility facility in facilities)
            {
                if (facility.FacilitySuccessMatch == false)
                {
                    dashSuccMatch = false;
                }
                if (facility.FacilityFailMatch == false)
                {
                    dashFailMatch = false;
                }
                if (facility.FacilityISMError == true)
                {
                    dashISMError = true;
                }
                if (facility.FacilityScriptError == true)
                {
                    dashScriptError = true;
                }
            }
            DashFailMatch    = dashFailMatch;
            DashSuccessMatch = dashSuccMatch;
            DashISMError     = dashISMError;
            DashScriptError  = dashScriptError;

            Console.WriteLine("Facility " + args.CalledBy + " dash success match: " + dashSuccMatch);
            Console.WriteLine("Facility " + args.CalledBy + " dash fail match: " + dashFailMatch);
            Console.WriteLine("Facility " + args.CalledBy + " dash ISM Error: " + dashISMError);
            Console.WriteLine("Facility " + args.CalledBy + " dash Script Error: " + dashScriptError);
        }
 private void ReportDashFlags(object sender, MatchEventArgs args)
 {
 }