Exemplo n.º 1
0
        public void RemoveField()
        {
            DataColumnCollection columns = Scan.ResTable.Columns;

            if (columns.Contains(serviseField))
            {
                columns.Remove(serviseField);
                if (!IsPrint)
                {
                    columns.Remove(ResName);
                }
            }
        }
Exemplo n.º 2
0
 public static void RemoveColumns(this DataColumnCollection column, params string[] columns)
 {
     foreach (string c in columns)
     {
         column.Remove(c);
     }
 }
Exemplo n.º 3
0
    public DataTable FindItems(string BegCat, string EndCat, string BegPkg, string EndPkg, string BegPlt, string EndPlt)
    {
        DataTable dtLocal    = new DataTable();
        DataTable dtHead     = new DataTable();
        string    SortString = "";

        //try
        //{
        dt = (DataTable)Session["BranchTable"];
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow drow = dt.Rows[i];
                SortString += drow["Code"].ToString();
                SortString += ";" + drow["SortKey"].ToString() + ":";
            }
        }
        DataSet dsLocal = SqlHelper.ExecuteDataset(connectionString, "[pSKUAnalysisFind]",
                                                   new SqlParameter("@BegCat", BegCat),
                                                   new SqlParameter("@EndCat", EndCat),
                                                   new SqlParameter("@BegPkg", BegPkg),
                                                   new SqlParameter("@EndPkg", EndPkg),
                                                   new SqlParameter("@BegPlt", BegPlt),
                                                   new SqlParameter("@EndPlt", EndPlt),
                                                   new SqlParameter("@SortKeys", SortString));

        if (dsLocal.Tables.Count == 2)
        {
            dtLocal = dsLocal.Tables[0];
            dtHead  = dsLocal.Tables[1];
            int ColCount = dtHead.Rows.Count + 3;
            int ColMax   = dtLocal.Columns.Count;
            int ColCtr   = 3;
            foreach (DataRow drow in dtHead.Rows)
            {
                dtLocal.Columns[ColCtr].ColumnName = drow[0].ToString();
                ColCtr++;
            }
            DataColumnCollection columns = dtLocal.Columns;
            for (int i = ColCount; i < ColMax; i++)
            {
                columns.Remove(dtLocal.Columns[ColCount]);
            }
            DataView dv = new DataView(dtLocal, "", "Item", DataViewRowState.CurrentRows);
            dtLocal = dv.ToTable();
        }
        return(dtLocal);
        //}
        //catch (Exception ex)
        //{
        //    return null;
        //}
    }
Exemplo n.º 4
0
    //<Snippet1>
    private void RemoveColumn(string columnName, DataTable table)
    {
        DataColumnCollection columns = table.Columns;

        if (columns.Contains(columnName))
        {
            if (columns.CanRemove(columns[columnName]))
            {
                columns.Remove(columnName);
            }
        }
    }
Exemplo n.º 5
0
 /// <summary>
 /// remove col: heatArea, name1.
 /// </summary>
 ///
 /// <param name="dt"></param>
 private void RemoveColumns(DataTable dt)
 {
     if (dt != null)
     {
         DataColumnCollection cols = dt.Columns;
         if (cols.Contains("heatArea"))
         {
             if (cols.CanRemove(cols["heatArea"]))
             {
                 cols.Remove("heatArea");
             }
         }
         if (cols.Contains("Name1"))
         {
             if (cols.CanRemove(cols["Name1"]))
             {
                 cols.Remove("Name1");
             }
         }
     }
 }
Exemplo n.º 6
0
        private void delFiledsFromRes()
        {
            var fields = FindAll(x => x.IsActive && !x.IsPrint && (x.Attr == attrName.Field));
            DataColumnCollection columns = ResTable.Columns;

            foreach (FieldBase field in fields)
            {
                if (columns.Contains(field.ResName))
                {
                    columns.Remove(columns[field.ResName]);
                }
            }
        }
Exemplo n.º 7
0
    // <Snippet1>
    private void RemoveColumnByName(string columnName)
    {
        // Get the DataColumnCollection from a DataTable in a DataSet.
        DataColumnCollection columns =
            ds.Tables["Suppliers"].Columns;

        if (columns.Contains(columnName))
        {
            if (columns.CanRemove(columns[columnName]))
            {
                columns.Remove(columnName);
            }
        }
    }
Exemplo n.º 8
0
 /// <summary>
 ///
 /// </summary>
 private void RemoveID()
 {
     if (dt != null)
     {
         DataColumnCollection cols = dt.Columns;
         if (cols.Contains("id"))
         {
             if (cols.CanRemove(cols["id"]))
             {
                 cols.Remove("id");
             }
         }
     }
 }
Exemplo n.º 9
0
        public static void MapDynamicColumn(DataColumnCollection columns)
        {
            var targetColumn = new List <string> (new string[] { "rowNumber", "item_InternalId", "totalRow" });

            foreach (var item in targetColumn)
            {
                if (columns.Contains(item))
                {
                    columns.Remove(item);
                }
            }
            foreach (DataColumn col in columns)
            {
                col.ColumnName = col.ColumnName.Replace(@"_", ".");
            }
        }
Exemplo n.º 10
0
        void RemoveNotPrint()
        {
            List <FieldBase>     newFields = this.FindAll(x => x.IsActive && !x.IsPrint).OrderBy(x => x.Npp).ToList();
            DataColumnCollection columns   = ResTable.Columns;

            foreach (FieldBase field in newFields)
            {
                if (columns.Contains(field.ResName))
                {
                    columns.Remove(columns[field.ResName]);
                    continue;
                }
            }
            if (columns.Contains(ACTIVE_FIELD))
            {
                columns[ACTIVE_FIELD].SetOrdinal(columns.Count - 1);
            }
        }
Exemplo n.º 11
0
        public void Remove()
        {
            DataTable            table = new DataTable("test_table");
            DataColumnCollection cols  = table.Columns;

            cols.Add("test");
            cols.Add("test2");
            cols.Add("test3");
            cols.Add("test4");

            Assert.Equal(4, cols.Count);
            cols.Remove("test2");
            Assert.Equal(3, cols.Count);
            cols.Remove("TEST3");
            Assert.Equal(2, cols.Count);

            // Column '_test_' does not belong to table test_table.
            Assert.Throws <ArgumentException>(() => cols.Remove("_test_"));

            cols.Add();
            cols.Add();
            cols.Add();
            cols.Add();

            Assert.Equal(6, cols.Count);
            cols.Remove(cols[0]);
            cols.Remove(cols[0]);
            Assert.Equal(4, cols.Count);
            Assert.Equal("Column1", cols[0].ColumnName);

            // Cannot remove a column that doesn't belong to this table.
            Assert.Throws <ArgumentException>(() => cols.Remove(new DataColumn("Column10")));

            cols.Add();
            cols.Add();
            cols.Add();
            cols.Add();

            Assert.Equal(8, cols.Count);
            cols.RemoveAt(7);
            cols.RemoveAt(1);
            cols.RemoveAt(0);
            cols.RemoveAt(0);
            Assert.Equal(4, cols.Count);
            Assert.Equal("Column4", cols[0].ColumnName);
            Assert.Equal("Column5", cols[1].ColumnName);

            // Cannot find column 10.
            Assert.Throws <IndexOutOfRangeException>(() => cols.RemoveAt(10));
        }
Exemplo n.º 12
0
        public IContent WritePage(ISource source, IPageData pageData, OutputData outputData)
        {
            TkDebug.AssertArgumentNull(outputData, "outputData", this);

            PageMakerUtil.AssertType(source, outputData,
                                     SourceOutputType.XmlReader, SourceOutputType.DataSet);

            if (outputData.OutputType == SourceOutputType.DataSet)
            {
                DataSet             ds     = PageMakerUtil.GetObject <DataSet>(outputData);
                DataTableCollection tables = ds.Tables;
                foreach (string tableName in fRemoveTables)
                {
                    if (tables.Contains(tableName))
                    {
                        tables.Remove(tableName);
                    }
                }
                foreach (var mapping in fTableMappings)
                {
                    if (tables.Contains(mapping.Key))
                    {
                        DataTable            table   = tables[mapping.Key];
                        DataColumnCollection columns = table.Columns;
                        foreach (string field in mapping.Value)
                        {
                            if (columns.Contains(field))
                            {
                                columns.Remove(field);
                            }
                        }
                    }
                }
            }

            using (XmlReader reader = PageMakerUtil.GetDataSetReader(outputData))
            {
                string xml = XmlUtil.GetJson(reader, Result);
                return(new SimpleContent(ContentTypeConst.JSON, xml));
            }
        }
 public void Remove(MetaDataColumn column)
 {
     _columns.Remove(column);
 }
Exemplo n.º 14
0
 /// <summary>
 /// Removes the specified DataColumn object from the collection.
 /// </summary>
 /// <param name="column">The DataColumn to remove. </param>
 public void Remove(DataColumn column)
 {
     _dataColumnCollection.Remove(column);
 }
Exemplo n.º 15
0
        public void Remove()
        {
            DataTable            Table = new DataTable("test_table");
            DataColumnCollection Cols  = Table.Columns;

            Cols.Add("test");
            Cols.Add("test2");
            Cols.Add("test3");
            Cols.Add("test4");

            Assert.Equal(4, Cols.Count);
            Cols.Remove("test2");
            Assert.Equal(3, Cols.Count);
            Cols.Remove("TEST3");
            Assert.Equal(2, Cols.Count);

            try
            {
                Cols.Remove("_test_");
                Assert.False(true);
            }
            catch (Exception e)
            {
                Assert.Equal(typeof(ArgumentException), e.GetType());
                // Never premise English.
                //Assert.Equal ("Column '_test_' does not belong to table test_table.", e.Message);
            }

            Cols.Add();
            Cols.Add();
            Cols.Add();
            Cols.Add();

            Assert.Equal(6, Cols.Count);
            Cols.Remove(Cols[0]);
            Cols.Remove(Cols[0]);
            Assert.Equal(4, Cols.Count);
            Assert.Equal("Column1", Cols[0].ColumnName);

            try
            {
                Cols.Remove(new DataColumn("Column10"));
                Assert.False(true);
            }
            catch (Exception e)
            {
                Assert.Equal(typeof(ArgumentException), e.GetType());
                // Never premise English.
                //Assert.Equal ("Cannot remove a column that doesn't belong to this table.", e.Message);
            }

            Cols.Add();
            Cols.Add();
            Cols.Add();
            Cols.Add();

            Assert.Equal(8, Cols.Count);
            Cols.RemoveAt(7);
            Cols.RemoveAt(1);
            Cols.RemoveAt(0);
            Cols.RemoveAt(0);
            Assert.Equal(4, Cols.Count);
            Assert.Equal("Column4", Cols[0].ColumnName);
            Assert.Equal("Column5", Cols[1].ColumnName);

            try
            {
                Cols.RemoveAt(10);
                Assert.False(true);
            }
            catch (Exception e)
            {
                Assert.Equal(typeof(IndexOutOfRangeException), e.GetType());
                // Never premise English.
                //Assert.Equal ("Cannot find column 10.", e.Message);
            }
        }
Exemplo n.º 16
0
 /// <summary>
 /// This sub removes the given column from the collection.
 /// </summary>
 /// <param name="Column"><see cref=" DASDataColumn "></see> object to be removed.</param>
 public void Remove(DASDataColumn Column)
 {
     m_Columns.Remove(Column);
 }
Exemplo n.º 17
0
        private static DataSet GetConfigurationDataSet()
        {
            DataSet configuration   = null;
            bool    configException = false;
            Ticks   startTime       = DateTime.UtcNow.Ticks;
            Time    elapsedTime;
            string  nodeIDQueryString = null;

            switch (s_configurationType)
            {
            case ConfigurationType.Database:
                // Attempt to load configuration from a database connection
                IDbConnection connection = null;
                Dictionary <string, string> settings;
                string    assemblyName, connectionTypeName, adapterTypeName;
                string    setting;
                Assembly  assembly;
                Type      connectionType, adapterType;
                DataTable entities, source, destination;

                try
                {
                    settings           = s_dataProviderString.ParseKeyValuePairs();
                    assemblyName       = settings["AssemblyName"].ToNonNullString();
                    connectionTypeName = settings["ConnectionType"].ToNonNullString();
                    adapterTypeName    = settings["AdapterType"].ToNonNullString();

                    if (string.IsNullOrWhiteSpace(connectionTypeName))
                    {
                        throw new InvalidOperationException("Database connection type was not defined.");
                    }

                    if (string.IsNullOrWhiteSpace(adapterTypeName))
                    {
                        throw new InvalidOperationException("Database adapter type was not defined.");
                    }

                    assembly       = Assembly.Load(new AssemblyName(assemblyName));
                    connectionType = assembly.GetType(connectionTypeName);
                    adapterType    = assembly.GetType(adapterTypeName);

                    connection = (IDbConnection)Activator.CreateInstance(connectionType);
                    connection.ConnectionString = s_connectionString;
                    connection.Open();

                    configuration = new DataSet("Iaon");

                    // Load configuration entities defined in database
                    entities           = connection.RetrieveData(adapterType, "SELECT * FROM ConfigurationEntity WHERE Enabled <> 0 ORDER BY LoadOrder");
                    entities.TableName = "ConfigurationEntity";

                    // Add configuration entities table to system configuration for reference
                    configuration.Tables.Add(entities.Copy());

                    // Get the node ID query string
                    if (settings.TryGetValue("Provider", out setting))
                    {
                        // Check if provider is for Access since it uses braces as Guid delimiters
                        if (setting.StartsWith("Microsoft.Jet.OLEDB", StringComparison.OrdinalIgnoreCase))
                        {
                            nodeIDQueryString = "{" + s_nodeID + "}";

                            // Make sure path to Access database is fully qualified
                            if (settings.TryGetValue("Data Source", out setting))
                            {
                                settings["Data Source"] = FilePath.GetAbsolutePath(setting);
                                s_connectionString      = settings.JoinKeyValuePairs();
                            }
                        }
                    }

                    if (string.IsNullOrWhiteSpace(nodeIDQueryString))
                    {
                        nodeIDQueryString = "'" + s_nodeID + "'";
                    }

                    Ticks operationStartTime;
                    Time  operationElapsedTime;

                    // Add each configuration entity to the system configuration
                    foreach (DataRow entityRow in entities.Rows)
                    {
                        // Load configuration entity data filtered by node ID
                        operationStartTime   = DateTime.UtcNow.Ticks;
                        source               = connection.RetrieveData(adapterType, string.Format("SELECT * FROM {0} WHERE NodeID={1}", entityRow["SourceName"], nodeIDQueryString));
                        operationElapsedTime = (DateTime.UtcNow.Ticks - operationStartTime).ToSeconds();

                        // Update table name as defined in configuration entity
                        source.TableName = entityRow["RuntimeName"].ToString();

                        DisplayStatusMessage("Loaded {0} row{1} from \"{2}\" in {3}...", UpdateType.Information, source.Rows.Count, source.Rows.Count == 1 ? "" : "s", source.TableName, operationElapsedTime.ToString(3));

                        operationStartTime = DateTime.UtcNow.Ticks;

                        // Clone data source
                        destination = source.Clone();

                        // Get destination column collection
                        DataColumnCollection columns = destination.Columns;

                        // Remove redundant node ID column
                        columns.Remove("NodeID");

                        // Pre-cache column index translation after removal of NodeID column to speed data copy
                        Dictionary <int, int> columnIndex = new Dictionary <int, int>();

                        foreach (DataColumn column in columns)
                        {
                            columnIndex[column.Ordinal] = source.Columns[column.ColumnName].Ordinal;
                        }

                        // Manually copy-in each row into table
                        foreach (DataRow sourceRow in source.Rows)
                        {
                            DataRow newRow = destination.NewRow();

                            // Copy each column of data in the current row
                            for (int x = 0; x < columns.Count; x++)
                            {
                                newRow[x] = sourceRow[columnIndex[x]];
                            }

                            // Add new row to destination table
                            destination.Rows.Add(newRow);
                        }

                        operationElapsedTime = (DateTime.UtcNow.Ticks - operationStartTime).ToSeconds();

                        // Add entity configuration data to system configuration
                        configuration.Tables.Add(destination);

                        DisplayStatusMessage("{0} configuration pre-cache completed in {1}.", UpdateType.Information, source.TableName, operationElapsedTime.ToString(3));
                    }

                    DisplayStatusMessage("Database configuration successfully loaded.", UpdateType.Information);
                }
                catch (Exception ex)
                {
                    configException = true;
                    DisplayStatusMessage("Failed to load database configuration due to exception: {0}", UpdateType.Warning, ex.Message);
                }
                finally
                {
                    if (connection != null)
                    {
                        connection.Dispose();
                    }

                    DisplayStatusMessage("Database configuration connection closed.", UpdateType.Information);
                }

                break;

            case ConfigurationType.WebService:
                // Attempt to load configuration from webservice based connection
                WebRequest request  = null;
                Stream     response = null;
                try
                {
                    DisplayStatusMessage("Webservice configuration connection opened.", UpdateType.Information);

                    configuration = new DataSet();
                    request       = WebRequest.Create(s_connectionString);
                    response      = request.GetResponse().GetResponseStream();
                    configuration.ReadXml(response);

                    DisplayStatusMessage("Webservice configuration successfully loaded.", UpdateType.Information);
                }
                catch (Exception ex)
                {
                    configException = true;
                    DisplayStatusMessage("Failed to load webservice configuration due to exception: {0}", UpdateType.Warning, ex.Message);
                }
                finally
                {
                    if (response != null)
                    {
                        response.Dispose();
                    }

                    DisplayStatusMessage("Webservice configuration connection closed.", UpdateType.Information);
                }

                break;

            case ConfigurationType.BinaryFile:
                // Attempt to load cached binary configuration file
                try
                {
                    DisplayStatusMessage("Loading binary based configuration from \"{0}\".", UpdateType.Information, s_connectionString);

                    configuration = Serialization.Deserialize <DataSet>(File.OpenRead(s_connectionString), SerializationFormat.Binary);

                    DisplayStatusMessage("Binary based configuration successfully loaded.", UpdateType.Information);
                }
                catch (Exception ex)
                {
                    configException = true;
                    DisplayStatusMessage("Failed to load binary based configuration due to exception: {0}.", UpdateType.Alarm, ex.Message);
                }

                break;

            case ConfigurationType.XmlFile:
                // Attempt to load cached XML configuration file
                try
                {
                    DisplayStatusMessage("Loading XML based configuration from \"{0}\".", UpdateType.Information, s_connectionString);

                    configuration = new DataSet();
                    configuration.ReadXml(s_connectionString);

                    DisplayStatusMessage("XML based configuration successfully loaded.", UpdateType.Information);
                }
                catch (Exception ex)
                {
                    configException = true;
                    DisplayStatusMessage("Failed to load XML based configuration due to exception: {0}.", UpdateType.Alarm, ex.Message);
                }

                break;
            }

            if (!configException)
            {
                elapsedTime = (DateTime.UtcNow.Ticks - startTime).ToSeconds();
                DisplayStatusMessage("{0} configuration load process completed in {1}...", UpdateType.Information, s_configurationType, elapsedTime.ToString(3));
            }

            return(configuration);
        }
Exemplo n.º 18
0
        /// <summary>
        /// propose the editable panel for a table, if table will probably not be self-editable
        /// (such as an M2N mapping), return null
        /// </summary>
        /// <param name="tableName"></param>
        /// <returns>IPanel (or null)</returns>
        public IPanel proposeForTable(string tableName)
        {
            // dont care for indexes for now

            DataColumnCollection cols   = stats.columnTypes(tableName);
            List <IFK>           FKs    = stats.foreignKeys(tableName);
            List <string>        PKCols = stats.primaryKeyCols(tableName);

            while (PKCols.Count == 0)
            {
                Dictionary <string, object> options = new Dictionary <string, object>();
                options.Add("Try again", 1);
                options.Add("Ommit table", 2);

                ArchitectQuestionEventArgs args = new ArchitectQuestionEventArgs(
                    "The table " + tableName + " does not have a primary key defined and therefore "
                    + "cannot be used in the administration. Is this intentional or will you add the primary key? (OMMIT TABLE)",
                    options);
                Question(this, args);
                //int answer = (int)questionAnswer;
                int answer = 2;
                if (answer == 1)
                {
                    PKCols = stats.primaryKeyCols(tableName);
                }
                else
                {
                    return(null);
                }
            }


            if (cols.Count == 2 && FKs.Count == 2)
            {
                return(null);                                   // seems like mapping table
            }
            // FK ~> mapping ?

            List <IField> fields = new List <IField>();

            foreach (IM2NMapping mapping in mappings)
            {
                if (mapping.myTable == tableName && !usedMappings.Exists(m => mapping == m))
                // && (stats.TableCreation(mapping.myTable) > stats.TableCreation(mapping.refTable)
                // the later-created table would get to edit the mapping
                // but I`d better ask the user

                {
                    Dictionary <string, object> options = new Dictionary <string, object>();
                    options.Add("Include in this panel", 1);
                    options.Add("Include in this panel only", 2);
                    options.Add("Do not include", 3);
                    ArchitectQuestionEventArgs args = new ArchitectQuestionEventArgs(
                        "While proposing administration panel for the table " + mapping.myTable
                        + ", the system found out that the table " + mapping.mapTable
                        + " is likely to  be a M to N mapping between this table and " + mapping.refTable
                        + ". Do you want to include an interface to manage this mapping in this panel? (INCLUDE IN THIS PANEL ONLY)",
                        options);
                    Question(this, args); // ask questions!
                    //int answer = (int)questionAnswer;
                    int answer = 2;
                    if (answer == 1 || answer == 2)
                    {
                        // no potentional field from cols is removed by this, though
                        List <string> displayColOrder = DisplayColOrder(mapping.refTable);
                        mapping.displayColumn = displayColOrder[0];
                        fields.Add(new M2NMappingField(0, mapping.myColumn, fieldTypeIdMap[FieldTypes.M2NMapping],
                                                       FieldTypes.M2NMapping.ToString(), 0, mapping));
                    }
                    if (answer == 2)
                    {
                        usedMappings.Add(mapping);
                    }
                }
            }

            // standard FKs
            foreach (IFK actFK in FKs)
            {
                List <string> displayColOrder = DisplayColOrder(actFK.refTable);
                actFK.displayColumn = displayColOrder[0];
                fields.Add(new FKField(0, actFK.myColumn, fieldTypeIdMap[FieldTypes.FK],
                                       FieldTypes.FK.ToString(), 0, actFK));
                cols.Remove(actFK.myColumn);    // will be edited as a foreign key
            }
            // editable fields in the order as defined in table; don`t edit AI
            foreach (DataColumn col in cols)
            {
                PropertyCollection validation = new PropertyCollection();

                if (!col.ExtendedProperties.ContainsKey(CC.COLUMN_EDITABLE))
                {
                    continue;
                }
                if (!col.AllowDBNull)
                {
                    validation.Add(CC.RULES_REQUIRED, true);
                }
                FieldTypes fieldType;  // default => standard textBox

                if (col.DataType == typeof(string))
                {
                    if (col.MaxLength <= 255)
                    {
                        fieldType = FieldTypes.Varchar;
                    }
                    else
                    {
                        fieldType = FieldTypes.Text;
                    }
                }
                else if (col.DataType == typeof(int) || col.DataType == typeof(long) || col.DataType == typeof(short))
                {
                    fieldType = FieldTypes.Ordinal;
                    validation.Add(fieldType.ToString(), true);
                }
                else if (col.DataType == typeof(float) || col.DataType == typeof(double))
                {
                    fieldType = FieldTypes.Decimal;
                    validation.Add(fieldType.ToString(), true);
                }
                else if (col.DataType == typeof(bool))
                {
                    fieldType = FieldTypes.Bool;
                }
                else if (col.DataType == typeof(DateTime))
                {
                    if (col.ExtendedProperties.ContainsKey(CC.FIELD_DATE_ONLY))
                    {
                        fieldType = FieldTypes.Date;
                    }
                    // should DATETIME, BUT DATETIME is usually used for date only...or is it?
                    else
                    {
                        fieldType = FieldTypes.Date;
                    }
                    validation.Add(fieldType.ToString(), true);
                }
                else if (col.DataType == typeof(Enum))
                {
                    // cannot happen, since column properties are taken from Stats
                    if (!col.ExtendedProperties.ContainsKey(CC.COLUMN_ENUM_VALUES))
                    {
                        throw new Exception("Missing enum options for field " + col.ColumnName);
                    }
                    fieldType = FieldTypes.Enum;
                }
                else
                {
                    throw new Exception("Unrecognised column type " + col.DataType.ToString());
                }
                fields.Add(new Field(0, col.ColumnName, fieldTypeIdMap[fieldType],
                                     fieldType.ToString(), 0, col.ExtendedProperties, validation)); // don`t add any properties, just copy from Stat
            }
            fields.OrderBy(x => ((int)(x.attr[CC.FIELD_POSITION])));
            // setup controls as properies
            PropertyCollection controlProps = new PropertyCollection();
            PropertyCollection viewProps    = new PropertyCollection();

            viewProps.Add(CC.PANEL_NAME, tableName + " Editation");

            List <Control> controls = new List <Control>();

            string actionName = UserAction.View.ToString();

            controlProps.Add(actionName, actionName);
            controlProps.Add(actionName + CC.CONTROL_ACCESS_LEVEL_REQUIRED_SUFFIX, 1);

            actionName = UserAction.Insert.ToString();
            controlProps.Add(actionName, actionName);
            controlProps.Add(actionName + CC.CONTROL_ACCESS_LEVEL_REQUIRED_SUFFIX, 3);

            actionName = UserAction.Update.ToString();
            controlProps.Add(actionName, actionName);
            controlProps.Add(actionName + CC.CONTROL_ACCESS_LEVEL_REQUIRED_SUFFIX, 5);

            actionName = UserAction.Delete.ToString();
            controlProps.Add(actionName, actionName);
            controlProps.Add(actionName + CC.CONTROL_ACCESS_LEVEL_REQUIRED_SUFFIX, 5);

            foreach (string actName in Enum.GetNames(typeof(UserAction)))
            {
                if (controlProps.ContainsKey(actName))
                {
                    controls.Add(new Control(actName, (UserAction)Enum.Parse(typeof(UserAction), actName)));
                }
            }
            List <IControl> controlsAsIControl = new List <IControl>(controls);

            //set additional properties
            // the order of fields in edit form (if defined), if doesn`t cover all editable columns, display the remaining
            // at the begining, non-editable columns are skipped
            //viewProps[CC.PANEL_DISPLAY_COLUMN_ORDER] = String.Join(",", DisplayColOrder(tableName));

            Panel res = new Panel(tableName, 0, panelTypeIdMp[PanelTypes.Editable], PanelTypes.Editable.ToString(),
                                  new List <IPanel>(), fields, controlsAsIControl, PKCols, null, viewProps, controlProps);

            return(res);
        }
 public void Remove(ImportDataColumn column)
 {
     _columns.Remove(column);
 }