private void SendMessage2(IMessage message)
        {
            if (message.Key.Equals(string.Empty) == false &&
                props.Contains(message.Key.ToString()) &&
                biDirectional == true)
            {
                message = new Message(message.From, node1.Key, message.Key, message.Content);

                if (message.Key.Equals(nameof(node1.X)))
                {
                    RaisePropertyChanged(nameof(this.X2));
                }

                if (message.Key.Equals(nameof(node1.Y)))
                {
                    RaisePropertyChanged(nameof(this.Y2));
                    message = Modify(message, node2.Size);
                }

                MovePoint2To1();

                Task.Delay(Delay).ContinueWith(a =>
                {
                    Messages2.Add(message);
                    node1.NextMessage(message);
                }, TaskScheduler.FromCurrentSynchronizationContext());
            }
        }
        public bool Check(OleDbConnection connection)
        {
            var reader = ADOSQLHelper.ExecuteReader(connection, _SQL);

            if (reader == null)
            {
                return(false);
            }

            while (reader.Read())
            {
                var keyValue   = reader[0].ToString().Trim();
                var checkValue = reader[0].ToString().Trim();
                if (string.IsNullOrEmpty(keyValue) == false)
                {
                    if (Values.Contains(checkValue) == false)
                    {
                        Messages2.Add(new Models.VillageMessage
                        {
                            Value       = keyValue,
                            Description = string.Format("【{0}={1}】不符合【{2}】", Key, keyValue, Name),
                            WhereClause = string.Format("[{0}] = '{1}'", Key, keyValue)
                        });
                        //Messages.Add(keyValue);
                    }
                }
            }
            return(true);
        }
        public bool Check(OleDbConnection connection)
        {
            var reader = ADOSQLHelper.ExecuteReader(connection, _SQL);

            if (reader == null)
            {
                return(false);
            }
            var list = new List <string>();

            while (reader.Read())
            {
                var keyValue = reader[0].ToString().Trim();

                if (string.IsNullOrEmpty(keyValue) == false)
                {
                    var str = string.Format("{0}:{1}", reader[2].ToString().Trim(), reader[1].ToString().Trim());
                    if (list.Contains(str))
                    {
                        Messages2.Add(new Models.VillageMessage
                        {
                            Value       = keyValue,
                            CheckValue  = str,
                            Description = string.Format("【{0} ={1}】对应的数据不符合【{2}】", Key, keyValue, Name),
                            WhereClause = string.Format("[{0}] = '{1}'", Key, keyValue)
                        });
                    }
                    else
                    {
                        list.Add(str);
                    }
                }
            }
            return(true);
        }
        public bool Check(OleDbConnection connection)
        {
            var reader = ADOSQLHelper.ExecuteReader(connection, _SQL);

            if (reader == null)
            {
                return(false);
            }

            while (reader.Read())
            {
                var keyValue = reader[0].ToString().Trim();
                if (string.IsNullOrEmpty(keyValue) == false)
                {
                    var temp = new List <string>();
                    for (var i = 0; i < CheckFields.Count(); i++)
                    {
                        var a = reader[i + 1].ToString().Trim();
                        if (string.IsNullOrEmpty(RegexString) == false && Is_Nullable == false)
                        {
                            if (Regex.IsMatch(a, RegexString) == false)
                            {
                                temp.Add(CheckFields[i]);
                            }
                        }
                        else
                        {
                            if (Is_Nullable ^ string.IsNullOrEmpty(a))
                            {
                                temp.Add(CheckFields[i]);
                            }
                        }
                    }
                    if (temp.Count > 0)
                    {
                        Messages2.Add(new Models.VillageMessage
                        {
                            Value       = keyValue,
                            Description = string.Format("【{0} = {1}】对应的字段【{2}】值不符合【{3}】", Key, keyValue, string.Join(",", temp.ToArray()), Name),
                            WhereClause = string.Format("[{0}] = '{1}'", Key, keyValue)
                        });
                    }
                }
            }
            return(true);
        }
        public bool Check(OleDbConnection connection)
        {
            var reader = ADOSQLHelper.ExecuteReader(connection, _SQL);

            if (reader == null)
            {
                return(false);
            }
            while (reader.Read())
            {
                var keyValue = reader[0].ToString().Trim();
                if (string.IsNullOrEmpty(keyValue) == false)
                {
                    var value = reader[1].ToString().Trim();
                    var flag  = false;
                    foreach (var item in RegexStrings)
                    {
                        if (Regex.IsMatch(value, item))
                        {
                            flag = true;
                            break;
                        }
                    }

                    if (flag == false)
                    {
                        Messages2.Add(new Models.VillageMessage
                        {
                            Value       = keyValue,
                            CheckValue  = value,
                            Description = string.Format("【{0}={1}】对应的数据不符合【{2}】", Key, keyValue, Name),
                            WhereClause = string.Format("[{0}] = '{1}'", Key, keyValue)
                        });
                    }
                }
            }
            return(true);
        }
Exemple #6
0
        public bool Check(OleDbConnection connection)
        {
            var reader = ADOSQLHelper.ExecuteReader(connection, _SQL);

            if (reader == null)
            {
                return(false);
            }
            while (reader.Read())
            {
                var keyValue = reader[0].ToString().Trim();
                if (string.IsNullOrEmpty(keyValue) == false)
                {
                    var value1 = reader[1].ToString().Trim();
                    var value2 = reader[2].ToString().Trim();
                    if (string.IsNullOrEmpty(value1) == false && string.IsNullOrEmpty(value2) == false)
                    {
                        if (CurrentDict.ContainsKey(value1))
                        {
                            if (CurrentDict[value1].ToLower() != value2.ToLower())
                            {
                                Messages2.Add(new Models.VillageMessage
                                {
                                    Value       = keyValue,
                                    CheckValue  = value1 + ";" + value2,
                                    Description = string.Format("【{0}={1}】对应的数据不符合【{2}】", Key, keyValue, Name),
                                    WhereClause = string.Format("[{0}] = '{1}'", Key, keyValue)
                                });
                            }
                        }
                    }
                }
            }

            return(true);
        }