/// <summary>
 ///     Removes the selected excel column from the excel column list
 /// </summary>
 public void RemoveFieldFromExcelColumns()
 {
     if (SelectedExcelColumn != null)
     {
         int columnNum = this.SelectedExcelColumn.ColumnNumber;
         ExcelColumns.Remove(ExcelColumns.Where(i => i.ColumnNumber == columnNum).Single());
         RenumberExcelColumns();
     }
 }
        public List <string> PKColumnNameList()
        {
            List <string> result = new List <string>();

            foreach (ExcelColumn aExcelColumns in ExcelColumns.Where(aExcelColumns => aExcelColumns.IsPK == 1 && !result.Contains(aExcelColumns.ColumnName)))
            {
                result.Add(aExcelColumns.ColumnName);
            }
            return(result);
        }
        /// <summary>
        /// 返回建值对《key:外键ColumnName,Value:父Sheet中对应列名》
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, string> FKColumnNameList()
        {
            Dictionary <string, string> result = null;

            foreach (ExcelColumn aExcelColumns in ExcelColumns.Where(aExcelColumns => aExcelColumns.IsFK == 1))
            {
                if (result == null)
                {
                    result = new Dictionary <string, string>();
                }
                if (!result.Keys.Contains(aExcelColumns.ColumnName))
                {
                    result.Add(aExcelColumns.ColumnName, aExcelColumns.FKColumnName);
                }
            }
            return(result);
        }