Ejemplo n.º 1
0
        public static string FormatDifferenceString(ArcvalInstance src, ArcvalInstance ob, int?idx)
        {
            string extra = null;

            if (ob != null && idx != null)
            {
                extra = $@" - Source Val: {src.ArcvalProps[idx.Value].Value}, Outbound Val: {ob.ArcvalProps[idx.Value].Value}";
            }

            return($@"{src.Key} ({src.Status.ToString()}) {extra}");
        }
Ejemplo n.º 2
0
        private void AddToDiffDic(ArcvalInstance source, ArcvalInstance outbound, string dicKey, int?index)
        {
            var format = ArcvalUtils.FormatDifferenceString(source, outbound, index);

            if (_diffDictionary.ContainsKey(dicKey))
            {
                _diffDictionary[dicKey].Add(format);
            }
            else
            {
                _diffDictionary.Add(dicKey, new List <string> {
                    format
                });
            }
        }
Ejemplo n.º 3
0
 private void AddToDictionary(IDictionary <string, ArcvalInstance> dic, ArcvalInstance arcval)
 {
     if (dic.ContainsKey(arcval.Key))
     {
         if (_diffDictionary.ContainsKey("Duplicates"))
         {
             _diffDictionary["Duplicates"].Add(arcval.Key);
         }
         else
         {
             _diffDictionary["Duplicates"] = new List <string> {
                 arcval.Key
             };
         }
     }
     else
     {
         dic.Add(arcval.Key, arcval);
     }
 }
Ejemplo n.º 4
0
        public static ArcvalInstance GetArcvalInstance(string arcvalRow)
        {
            ArcvalInstance arcval = new ArcvalInstance(arcvalRow);

            if (!arcval.Validate())
            {
                return(null);
            }
            arcval.SetPolicyNo();
            if (InActivePolicies.ContainsKey(arcval.PolicyNo))
            {
                return(null);
            }
            arcval.Configure();
            if (arcval.Status == ArcvalRowStatus.Inactive)
            {
                InActivePolicies.Add(arcval.PolicyNo, true);
                return(null);
            }
            arcval.Process();
            return(arcval);
        }
Ejemplo n.º 5
0
        private void Compare(
            ArcvalInstance sourceProps,
            ArcvalInstance outboundProps)
        {
            for (var i = 0; i < sourceProps.ArcvalProps.Count - 1; i++)
            {
                if (sourceProps.ArcvalProps[i].ToIgnore ||
                    sourceProps.ArcvalProps[i].Value.Equals(outboundProps.ArcvalProps[i].Value))
                {
                    continue;
                }

                if (sourceProps.ArcvalProps[i].Intable)
                {
                    int.TryParse(sourceProps.ArcvalProps[i].Value, out var x);
                    int.TryParse(outboundProps.ArcvalProps[i].Value, out var y);
                    if (Math.Abs(x - y) <= 5)
                    {
                        continue;
                    }
                }
                AddToDiffDic(sourceProps, outboundProps, sourceProps.ArcvalProps[i].Name, i);
            }
        }