public override bool Check(DataTable dt) { bool succ = true; var dt_source = ODM.GetDataTable(TableName, 1); var col_external = from DataColumn dc in dt.Columns select dc.ColumnName; var col_source = (from DataColumn dc in dt_source.Columns select dc.ColumnName).ToList(); col_source.Remove("ValueID"); foreach (var str in col_source) { if (!col_external.Contains(str)) { _Message = string.Format("The neccessary field {0} is missing", str); succ = false; break; } } if (!succ) { return(false); } else { return(succ); } }
public virtual bool Check(System.Data.DataTable dt) { bool succ = true; var dt_source = ODM.GetDataTable(TableName, 1); var col_external = from DataColumn dc in dt.Columns select dc.ColumnName; var col_source = from DataColumn dc in dt_source.Columns select dc.ColumnName; foreach (var str in col_source) { if (!col_external.Contains(str)) { _Message = string.Format("The neccessary field {0} is missing", str); succ = false; break; } } if (!succ) { return(false); } else { return(succ); } }