private void btnNext_Click(object sender, EventArgs e)
        {
            List<DataImportTable> tableList = new List<DataImportTable>();
            foreach (DataGridViewRow row in dgvDataType.Rows)
            {
                string tableName = (string)row.Cells[0].Value;
                DataImportTable table;
                if (!tableList.Exists(t => t.Name == tableName))
                {
                    table = new DataImportTable() {
                        Name = tableName
                        , Order = tableList.Count+1
                        //, Count = (UInt64)tvObjects.Nodes[0].Nodes.Find(tableName, false)[0].Tag
                        , Columns = new List<DataImportColumn>()
                        , Loaded=false
                    };

                    tableList.Add(table);
                }
                else
                    table = tableList.Single(t => t.Name == tableName);

                if (row.Cells[4].Value == null)
                    row.ErrorText = "Vous devez sélectionner un type de données.\n";

                if(row.Cells[5].Value==null)
                    row.ErrorText += "Vous devez sélectionner une taille pour le type de données.";

                if (row.ErrorText != string.Empty)
                    return;

                DataImportColumn column = new DataImportColumn()
                    {
                        Name = (string)row.Cells[1].Value
                        ,
                        DataType = (string)row.Cells[4].Value
                        ,
                        Size = row.Cells[5].Value.ToString()
                        ,
                        Order = table.Columns.Count+1
                        ,
                        Loaded = false
                    };
                table.Columns.Add(column);
            }
            IConnector conn = Connector.GetConnector(_sgbdType);
            conn.Initialize(_connectionString);
            Cursor.Current = Cursors.WaitCursor;
            FrmDatabaseImportProcess frmImportProcess = new FrmDatabaseImportProcess(tableList, _db, _sgbdType, conn);
            frmImportProcess.ShowDialog(this);
            Cursor.Current = Cursors.Default;
        }
Beispiel #2
0
 private void tsmExistingFiles_Click(object sender, EventArgs e)
 {
     DataBase db = lstDb.Single(d => d.Name == tvObjects.SelectedNode.Name);
     if (db != null)
     {
         FrmDatabaseImportProcess frmDataImportProcess = new FrmDatabaseImportProcess(db);
         frmDataImportProcess.Show(this);
     }
 }