예제 #1
0
        public bool Validate(IRowSource Value)
        {
            //格過驗證。
            if (_skip_validate)
            {
                return(true);
            }

            int            rowIndex = -1;
            SheetRowSource sheetRow = Value as SheetRowSource;

            if (sheetRow != null)
            {
                rowIndex = sheetRow.CurrentRowIndex;
            }

            DuplicateInfo dup = _key_sets.GetDuplicateBy(_primary_condition, Value);

            if (dup != null)
            {
                Record record = dup.Record;
                record.SourceRowIndex = rowIndex;

                foreach (ImportCondition each in _check_conditions)
                {
                    foreach (ImportField eachField in each.Fields)
                    {
                        record[eachField.InternalName] = Value.GetFieldData(eachField.FieldName);
                    }
                }
            }
            return(true);
        }
예제 #2
0
        public bool Validate(IRowSource Value)
        {
            //格過驗證。
            if (_skip_validate)
            {
                return(true);
            }

            List <DuplicateInfo> dups = _key_sets.GetDuplicate(Value);

            if (dups.Count <= 0)
            {
                return(true);
            }
            else
            {
                DuplicateInfo dup = dups[0];
                _previous_result = dup;

                string serverValue = dup.Record[_check_field.InternalName].Trim();
                string sourceValue = Value.GetFieldData(_check_field.FieldName).Trim();

                return(serverValue == sourceValue);
            }
        }