From 649481e1a972a88549d745f8e9be5a9928835b0f Mon Sep 17 00:00:00 2001 From: magicdict Date: Fri, 11 Nov 2016 14:58:22 +0800 Subject: [PATCH] =?UTF-8?q?ImportAccess=C2=B2=C3=A5=C2=BC=C3=BE=C3=96?= =?UTF-8?q?=C3=98=C3=96=C3=86=20MongoCola=C2=B1=C3=A0=C3=92=C3=AB=C6=BD?= =?UTF-8?q?=CC=A8=C2=B8=C3=84=CE=AAAnyCpu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Common/FileFilter.cs | 4 +- MachineLearning/App.config | 4 + MachineLearning/MachineLearning/Regression.cs | 2 +- MongoCola/MongoCola.csproj | 1 + MongoCola/Properties/AssemblyInfo.cs | 4 +- PlugInPackage/ClassDiagram1.cd | 81 ++++++ PlugInPackage/DosCommand/frmDosCommand.cs | 8 +- PlugInPackage/ExportToExcel/ExportToExcel.cs | 2 +- .../GenerateConfigIni/GenerateConfigIni.cs | 2 +- .../ImportAccessDB/ImportAccessDB.cs | 254 +++++++++--------- .../ImportAccessDB/frmSelectTable.Designer.cs | 128 ++++----- .../ImportAccessDB/frmSelectTable.cs | 7 +- PlugInPackage/PlugInPackage.csproj | 39 ++- PlugInPackage/PlugInPackage.csproj.user | 16 ++ PlugInPackage/Program.cs | 27 ++ PlugInPackage/app.config | 11 + PlugInPackage/packages.config | 1 + ResourceLib/UI/ctlFilePicker.Designer.cs | 29 +- ResourceLib/UI/ctlFilePicker.cs | 4 +- readme.md | 4 +- 20 files changed, 405 insertions(+), 223 deletions(-) create mode 100644 PlugInPackage/ClassDiagram1.cd create mode 100644 PlugInPackage/PlugInPackage.csproj.user create mode 100644 PlugInPackage/Program.cs create mode 100644 PlugInPackage/app.config diff --git a/Common/FileFilter.cs b/Common/FileFilter.cs index f8232c41..af7d7028 100644 --- a/Common/FileFilter.cs +++ b/Common/FileFilter.cs @@ -18,9 +18,9 @@ public static partial class Utility public const string LogFilter = "Log File(*.log)|*.log|*.*(All Files)|*.*"; /// - /// MDB文件选择过滤器 + /// Access文件选择过滤器 /// - public const string MdbFilter = "Access File(*.mdb)|*.mdb|*.*(All Files)|*.*"; + public const string AccessDBFilter = "Access File(*.mdb,accdb)|*.mdb;*.accdb|*.*(All Files)|*.*"; /// /// Conf文件选择过滤器 diff --git a/MachineLearning/App.config b/MachineLearning/App.config index e2b4e636..3f5f05c8 100644 --- a/MachineLearning/App.config +++ b/MachineLearning/App.config @@ -9,6 +9,10 @@ + + + + diff --git a/MachineLearning/MachineLearning/Regression.cs b/MachineLearning/MachineLearning/Regression.cs index 47ad76b3..64b8decc 100644 --- a/MachineLearning/MachineLearning/Regression.cs +++ b/MachineLearning/MachineLearning/Regression.cs @@ -23,7 +23,7 @@ public override int Run() var frm = new frmRegression(); frm.mongoCol = _processCollection; frm.ShowDialog(); - return 0; + return Success; } } } diff --git a/MongoCola/MongoCola.csproj b/MongoCola/MongoCola.csproj index 7f3b5be8..b2e923e8 100644 --- a/MongoCola/MongoCola.csproj +++ b/MongoCola/MongoCola.csproj @@ -69,6 +69,7 @@ bin\Debug 4 AnyCPU + false false diff --git a/MongoCola/Properties/AssemblyInfo.cs b/MongoCola/Properties/AssemblyInfo.cs index ec031a28..a35092ac 100644 --- a/MongoCola/Properties/AssemblyInfo.cs +++ b/MongoCola/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.5.0")] -[assembly: AssemblyFileVersion("2.0.5.0")] \ No newline at end of file +[assembly: AssemblyVersion("2.0.7.0")] +[assembly: AssemblyFileVersion("2.0.7.0")] \ No newline at end of file diff --git a/PlugInPackage/ClassDiagram1.cd b/PlugInPackage/ClassDiagram1.cd new file mode 100644 index 00000000..7615301e --- /dev/null +++ b/PlugInPackage/ClassDiagram1.cd @@ -0,0 +1,81 @@ + + + + + + ggAAAASAACAAAAAAAACAAAACAAAAAAAAAACAAAAAAAA= + DosCommand\ctllogLv.cs + + + + + + AggACADAACQIAAAgEACBBAIjJgBAAEgiBAAEAAAQQAA= + DosCommand\ctlMongod.cs + + + + + + AAwAEABAACAEAAAAIAGgBABjIAAAABQQAVQEQAAQwAE= + DosCommand\ctlMongodump.cs + + + + + + AAwAEQBBACCAAAAAAACgJABHICAIABQAAVQEAAIwQAA= + DosCommand\ctlMongoImportExport.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI= + DosCommand\DosCommand.cs + + + + + + AQgAQAAAACgAACAAAESEAQICAAAggAIgAAQAAAAAAAA= + DosCommand\frmDosCommand.cs + + + + + + AAAAAAAAAAAAAAAAAAAABAAAAAAAAABAAAAAAAAAAAI= + ExportToExcel\ExportToExcel.cs + + + + + + AAAAIAAAACABAAAAIACAAAICAAAAQAAAAIAABAAACAA= + GenerateConfigIni\frmGenerateConfigIni.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI= + GenerateConfigIni\GenerateConfigIni.cs + + + + + + AAAAAIACACAAACAAAQCAIAACYAEAAAAAAAAAAAAAAAA= + ImportAccessDB\frmSelectTable.cs + + + + + + AAAAEgAAAABAIEAAAAAAAAAAAAAAAACAAAAAAAAAAAI= + ImportAccessDB\ImportAccessDB.cs + + + + \ No newline at end of file diff --git a/PlugInPackage/DosCommand/frmDosCommand.cs b/PlugInPackage/DosCommand/frmDosCommand.cs index 0ad41c8b..007251b9 100644 --- a/PlugInPackage/DosCommand/frmDosCommand.cs +++ b/PlugInPackage/DosCommand/frmDosCommand.cs @@ -1,10 +1,10 @@ -using System; +using Common; +using MongoUtility.ToolKit; +using ResourceLib.Method; +using System; using System.IO; using System.Text; using System.Windows.Forms; -using Common; -using MongoUtility.ToolKit; -using ResourceLib.Method; namespace PlugInPackage.DosCommand { diff --git a/PlugInPackage/ExportToExcel/ExportToExcel.cs b/PlugInPackage/ExportToExcel/ExportToExcel.cs index 782d07d4..5b6fc341 100644 --- a/PlugInPackage/ExportToExcel/ExportToExcel.cs +++ b/PlugInPackage/ExportToExcel/ExportToExcel.cs @@ -49,7 +49,7 @@ public override int Run() Export(_processCollection.FindAllAs().ToList(), _processCollection.Name); } MessageBox.Show(_processCollection.Name); - return 0; + return Success; } /// diff --git a/PlugInPackage/GenerateConfigIni/GenerateConfigIni.cs b/PlugInPackage/GenerateConfigIni/GenerateConfigIni.cs index 646bef8d..12e89e35 100644 --- a/PlugInPackage/GenerateConfigIni/GenerateConfigIni.cs +++ b/PlugInPackage/GenerateConfigIni/GenerateConfigIni.cs @@ -21,7 +21,7 @@ public GenerateConfigIni() public override int Run() { Utility.OpenModalForm(new FrmGenerateConfigIni(), true, true); - return 0; + return Success; } #endregion diff --git a/PlugInPackage/ImportAccessDB/ImportAccessDB.cs b/PlugInPackage/ImportAccessDB/ImportAccessDB.cs index 7478d6fd..8b87a428 100644 --- a/PlugInPackage/ImportAccessDB/ImportAccessDB.cs +++ b/PlugInPackage/ImportAccessDB/ImportAccessDB.cs @@ -1,22 +1,26 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Data.OleDb; -using Common; +using Common; using MongoDB.Bson; using MongoDB.Driver; using MongoUtility.EventArgs; using PlugInPrj; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.OleDb; namespace PlugInPackage.ImportAccessDB { public class ImportAccessDb : PlugInBase { /// - /// 数据连接字符串 + /// 数据连接字符串(MDB) + /// + private const string MDBConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=@AccessPath;Persist Security Info=True"; + + /// + /// 数据连接字符串(ACCDB) /// - private const string AccessConnectionString = - @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=@AccessPath;Persist Security Info=True"; + private const string ACCDBConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=@AccessPath;Persist Security Info=True"; /// /// 通用的ActionDone事件 @@ -37,8 +41,10 @@ public ImportAccessDb() /// public override int Run() { - Utility.OpenModalForm(new FrmSelectTable(), true, true); - return 0; + var frm = new FrmSelectTable(); + frm.mServer = (MongoServer)PlugObj; + Utility.OpenModalForm(frm, true, true); + return Success; } /// @@ -51,6 +57,7 @@ public static void OnActionDone(ActionDoneEventArgs e) } //GetOleDbSchemaTable Is Not Supported In MONO + //https://support.microsoft.com/en-us/kb/320435 /// /// 获得数据类型 @@ -60,14 +67,13 @@ public static void OnActionDone(ActionDoneEventArgs e) /// /// /// - private static string GetDataType(int oleDataType, long columnSize, int numericPrecision, int numericScale) + private static string GetDataType(OleDbType oleDataType, long columnSize, int numericPrecision, int numericScale) { switch (oleDataType) { - case 2: + case OleDbType.SmallInt: return "Integer"; - - case 3: + case OleDbType.Integer: //Long switch (columnSize) { @@ -79,92 +85,67 @@ private static string GetDataType(int oleDataType, long columnSize, int numericP default: return "Long"; } - //break; - - case 4: + case OleDbType.Single: return "Single"; - - case 5: + case OleDbType.Double: return "Double"; - - case 6: + case OleDbType.Numeric: + return "Numeric"; + case OleDbType.UnsignedTinyInt: + return "Byte"; + case OleDbType.Currency: //CURRECY - return "Money"; - - case 7: - return "DATETIME"; - - case 11: + return "Currency"; + case OleDbType.Date: + return "Date"; + case OleDbType.Boolean: //Yes/No fields - return "BIT"; - - case 17: - return "BYTE"; - - case 72: - return "MEMO"; - - case 130: - if (columnSize == 0) - { - return "MEMO"; - } - if (columnSize == -1) - { - return "MEMO"; - } - return "VARCHAR"; - //return "VARCHAR(" + ColumnSize + ")"; - //break; - - case 131: + return "Boolean"; + case OleDbType.Decimal: //decimal - return "decimal(" + numericPrecision + "," + numericScale + ")"; - - case 128: - if (columnSize == -1) - { - return "MEMO"; - } - if (columnSize == 0) - { - return "MENO"; - //OLE Object - } - return "VARCHAR"; - //return "VARCHAR(" + ColumnSize + ")"; - //break; - + return "Decimal"; + case OleDbType.Guid: + //同步复制ID + return "Guid"; + case OleDbType.WChar: + return "Memo"; default: - if (columnSize == -1) - { - return "MEMO"; - } + if (columnSize == -1) return "Memo"; return "VARCHAR"; - //return "VARCHAR(" + ColumnSize + ")"; - //break; } - //return null; } - + /// + /// 获得字段列表 + /// + /// + /// public static List GetTableList(string accessFileName) { - var conn = new OleDbConnection(AccessConnectionString.Replace("@AccessPath", accessFileName)); + var connectionstring = string.Empty; + if (accessFileName.EndsWith("accdb")) + { + connectionstring = ACCDBConnectionString.Replace("@AccessPath", accessFileName); + } + else + { + connectionstring = MDBConnectionString.Replace("@AccessPath", accessFileName); + } + var conn = new OleDbConnection(connectionstring); var tableList = new List(); try { conn.Open(); var tblTableList = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, - new object[] {null, null, null, "Table"}); + new object[] { null, null, null, "Table" }); var strCreateTableInfo = string.Empty; foreach (DataRow recTable in tblTableList.Rows) { tableList.Add(recTable[2].ToString()); } } - catch (Exception) + catch (Exception ex) { - throw; + Utility.ExceptionDeal(ex); } finally { @@ -185,13 +166,22 @@ public static void ImportAccessDataBase(string accessFileName, List tabl var fileMain = fileName[fileName.Length - 1]; var insertDbName = fileMain.Split(".".ToCharArray())[0]; var mongoDb = mongoSvr.GetDatabase(insertDbName); - var conn = new OleDbConnection(AccessConnectionString.Replace("@AccessPath", accessFileName)); + var connectionstring = string.Empty; + if (accessFileName.EndsWith("accdb")) + { + connectionstring = ACCDBConnectionString.Replace("@AccessPath", accessFileName); + } + else + { + connectionstring = MDBConnectionString.Replace("@AccessPath", accessFileName); + } + var conn = new OleDbConnection(connectionstring); try { conn.Open(); var err = 0; var tblTableList = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, - new object[] {null, null, null, "Table"}); + new object[] { null, null, null, "Table" }); var strCreateTableInfo = string.Empty; foreach (DataRow recTable in tblTableList.Rows) { @@ -211,7 +201,14 @@ public static void ImportAccessDataBase(string accessFileName, List tabl err++; continue; } - mongoDb.CreateCollection(strTableName); + if (mongoDb.CollectionExists(strTableName)) + { + mongoDb.GetCollection(strTableName).RemoveAll(); + } + else + { + mongoDb.CreateCollection(strTableName); + } strCreateTableInfo = strTableName + " Creating " + Environment.NewLine + strCreateTableInfo; OnActionDone(new ActionDoneEventArgs(strTableName + " Creating ")); } @@ -228,13 +225,14 @@ public static void ImportAccessDataBase(string accessFileName, List tabl } MongoCollection mongoCollection = mongoDb.GetCollection(strTableName); var tblSchema = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, - new object[] {null, null, strTableName, null}); + new object[] { null, null, strTableName, null }); var colPro = new Dictionary(); var colName = new List(); + var Debug = string.Empty; foreach (DataRow item in tblSchema.Rows) { long columnWidth; - switch ((long) item["COLUMN_FLAGS"]) + switch (item["COLUMN_FLAGS"]) { case 122: columnWidth = -1; @@ -250,15 +248,18 @@ public static void ImportAccessDataBase(string accessFileName, List tabl } else { - columnWidth = (long) item["CHARACTER_MAXIMUM_LENGTH"]; + columnWidth = (long)item["CHARACTER_MAXIMUM_LENGTH"]; } break; } colName.Add(item["COLUMN_NAME"].ToString()); - colPro.Add(item["COLUMN_NAME"].ToString(), GetDataType((int) item["DATA_TYPE"], columnWidth, - item["NUMERIC_PRECISION"] is DBNull ? 0 : (int) item["NUMERIC_PRECISION"], - item["NUMERIC_SCALE"] is DBNull ? 0 : (int) item["NUMERIC_SCALE"])); + colPro.Add(item["COLUMN_NAME"].ToString(), GetDataType((OleDbType)item["DATA_TYPE"], columnWidth, + item["NUMERIC_PRECISION"] is DBNull ? 0 : (int)item["NUMERIC_PRECISION"], + item["NUMERIC_SCALE"] is DBNull ? 0 : (short)item["NUMERIC_SCALE"])); + + Debug += item["COLUMN_NAME"].ToString() + ":" + ((OleDbType)item["DATA_TYPE"]).ToString() + System.Environment.NewLine; } + var cmd = new OleDbCommand(); cmd.Connection = conn; cmd.CommandText = "Select * from " + strTableName; @@ -277,12 +278,11 @@ public static void ImportAccessDataBase(string accessFileName, List tabl switch (colPro[colName[i]]) { case "VARCHAR": + case "Memo": insertDoc.Add(colName[i], new BsonString(itemRow[colName[i]].ToString()), true); break; - case "BIT": - //System.Boolean Can't Cast To BSonBoolean.... - //O,My LadyGaga - if ((bool) itemRow[colName[i]]) + case "Boolean": + if ((bool)itemRow[colName[i]]) { insertDoc.Add(colName[i], BsonBoolean.True, true); } @@ -291,21 +291,48 @@ public static void ImportAccessDataBase(string accessFileName, List tabl insertDoc.Add(colName[i], BsonBoolean.False, true); } break; - case "DATETIME": - //O,My LadyGaga - insertDoc.Add(colName[i], new BsonDateTime((DateTime) itemRow[colName[i]]), true); + case "Date": + insertDoc.Add(colName[i], new BsonDateTime((DateTime)itemRow[colName[i]]), true); break; case "Integer": + case "Guid": var i32 = Convert.ToInt32(itemRow[colName[i]]); - insertDoc.Add(colName[i], (BsonInt32) i32, true); + insertDoc.Add(colName[i], (BsonInt32)i32, true); + break; + case "Single": + var sgl = Convert.ToSingle(itemRow[colName[i]]); + insertDoc.Add(colName[i], sgl, true); break; case "Long": - //itemRow[ColName[i]] the default is Int32 without convert var lng = Convert.ToInt64(itemRow[colName[i]]); - insertDoc.Add(colName[i], (BsonInt64) lng, true); + insertDoc.Add(colName[i], (BsonInt64)lng, true); + break; + case "Decimal": + var dec = Convert.ToDecimal(itemRow[colName[i]]); + insertDoc.Add(colName[i], dec, true); + break; + case "Double": + var dou = Convert.ToDouble(itemRow[colName[i]]); + insertDoc.Add(colName[i], dou, true); + break; + case "Numeric": + var num = Convert.ToDouble(itemRow[colName[i]]); + insertDoc.Add(colName[i], num, true); + break; + case "Currency": + var cur = Convert.ToDouble(itemRow[colName[i]]); + insertDoc.Add(colName[i], cur, true); + break; + case "Byte": + var byt = Convert.ToByte(itemRow[colName[i]]); + insertDoc.Add(colName[i], byt, true); break; } } + else + { + insertDoc.Add(colName[i], BsonNull.Value, true); + } } mongoCollection.Insert(insertDoc); } @@ -316,40 +343,5 @@ public static void ImportAccessDataBase(string accessFileName, List tabl conn.Close(); } } - - /// - /// 列信息 - /// - internal enum ColumnInfo - { - TableCatalog, - TableSchema, - TableName, - ColumnName, - ColumnGuid, - ColumnPropid, - OrdinalPosition, - ColumnHasdefault, - ColumnDefault, - ColumnFlags, - IsNullable, - DataType, - TypeGuid, - CharacterMaximumLength, - CharacterOctetLength, - NumericPrecision, - NumericScale, - DatetimePrecision, - CharacterSetCatalog, - CharacterSetSchema, - CharacterSetName, - CollationCatalog, - CollationSchema, - CollationName, - DomainCatalog, - DomainSchema, - DomainName, - Description - } } } \ No newline at end of file diff --git a/PlugInPackage/ImportAccessDB/frmSelectTable.Designer.cs b/PlugInPackage/ImportAccessDB/frmSelectTable.Designer.cs index 6728af3b..ffd0af65 100644 --- a/PlugInPackage/ImportAccessDB/frmSelectTable.Designer.cs +++ b/PlugInPackage/ImportAccessDB/frmSelectTable.Designer.cs @@ -32,67 +32,73 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.AccessPicker = new CtlFilePicker(); - this.btnGetTabelList = new System.Windows.Forms.Button(); - this.chkTable = new System.Windows.Forms.CheckedListBox(); - this.btnImport = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // AccessPicker - // - this.AccessPicker.BackColor = System.Drawing.Color.Transparent; - this.AccessPicker.FileFilter = ""; - this.AccessPicker.InitFileName = ""; - this.AccessPicker.Location = new System.Drawing.Point(35, 20); - this.AccessPicker.Name = "AccessPicker"; - this.AccessPicker.PickerType = CtlFilePicker.DialogType.OpenFile; - this.AccessPicker.SelectedPathOrFileName = ""; - this.AccessPicker.Size = new System.Drawing.Size(640, 29); - this.AccessPicker.TabIndex = 0; - this.AccessPicker.Title = "AccessFileName"; - // - // btnGetTabelList - // - this.btnGetTabelList.Location = new System.Drawing.Point(542, 55); - this.btnGetTabelList.Name = "btnGetTabelList"; - this.btnGetTabelList.Size = new System.Drawing.Size(116, 31); - this.btnGetTabelList.TabIndex = 1; - this.btnGetTabelList.Text = "Get Table List"; - this.btnGetTabelList.UseVisualStyleBackColor = true; - this.btnGetTabelList.Click += new System.EventHandler(this.btnGetTabelList_Click); - // - // chkTable - // - this.chkTable.FormattingEnabled = true; - this.chkTable.Location = new System.Drawing.Point(35, 105); - this.chkTable.Name = "chkTable"; - this.chkTable.Size = new System.Drawing.Size(623, 116); - this.chkTable.TabIndex = 2; - // - // btnImport - // - this.btnImport.Location = new System.Drawing.Point(542, 245); - this.btnImport.Name = "btnImport"; - this.btnImport.Size = new System.Drawing.Size(116, 27); - this.btnImport.TabIndex = 3; - this.btnImport.Text = "Import"; - this.btnImport.UseVisualStyleBackColor = true; - this.btnImport.Click += new System.EventHandler(this.btnImport_Click); - // - // SelectTable - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(679, 284); - this.Controls.Add(this.btnImport); - this.Controls.Add(this.chkTable); - this.Controls.Add(this.btnGetTabelList); - this.Controls.Add(this.AccessPicker); - this.Name = "SelectTable"; - this.Text = "SelectTable"; - this.Load += new System.EventHandler(this.SelectTable_Load); - this.ResumeLayout(false); + this.btnGetTabelList = new System.Windows.Forms.Button(); + this.chkTable = new System.Windows.Forms.CheckedListBox(); + this.btnImport = new System.Windows.Forms.Button(); + this.AccessPicker = new ResourceLib.UI.CtlFilePicker(); + this.SuspendLayout(); + // + // btnGetTabelList + // + this.btnGetTabelList.Location = new System.Drawing.Point(499, 59); + this.btnGetTabelList.Name = "btnGetTabelList"; + this.btnGetTabelList.Size = new System.Drawing.Size(168, 31); + this.btnGetTabelList.TabIndex = 1; + this.btnGetTabelList.Text = "Get Table List"; + this.btnGetTabelList.UseVisualStyleBackColor = true; + this.btnGetTabelList.Click += new System.EventHandler(this.btnGetTabelList_Click); + // + // chkTable + // + this.chkTable.FormattingEnabled = true; + this.chkTable.Location = new System.Drawing.Point(35, 105); + this.chkTable.Name = "chkTable"; + this.chkTable.Size = new System.Drawing.Size(623, 116); + this.chkTable.TabIndex = 2; + // + // btnImport + // + this.btnImport.Location = new System.Drawing.Point(499, 238); + this.btnImport.Name = "btnImport"; + this.btnImport.Size = new System.Drawing.Size(159, 34); + this.btnImport.TabIndex = 3; + this.btnImport.Text = "Import"; + this.btnImport.UseVisualStyleBackColor = true; + this.btnImport.Click += new System.EventHandler(this.btnImport_Click); + // + // AccessPicker + // + this.AccessPicker.AutoSize = true; + this.AccessPicker.BackColor = System.Drawing.Color.Transparent; + this.AccessPicker.Browse = "Browse..."; + this.AccessPicker.Clear = "Clear"; + this.AccessPicker.FileFilter = ""; + this.AccessPicker.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.AccessPicker.InitFileName = ""; + this.AccessPicker.Location = new System.Drawing.Point(35, 20); + this.AccessPicker.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.AccessPicker.Name = "AccessPicker"; + this.AccessPicker.PickerType = ResourceLib.UI.CtlFilePicker.DialogType.OpenFile; + this.AccessPicker.SelectedPathOrFileName = ""; + this.AccessPicker.Size = new System.Drawing.Size(640, 32); + this.AccessPicker.TabIndex = 0; + this.AccessPicker.Title = "AccessFileName"; + // + // FrmSelectTable + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(679, 284); + this.Controls.Add(this.btnImport); + this.Controls.Add(this.chkTable); + this.Controls.Add(this.btnGetTabelList); + this.Controls.Add(this.AccessPicker); + this.Name = "FrmSelectTable"; + this.Text = "SelectTable"; + this.Load += new System.EventHandler(this.SelectTable_Load); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/PlugInPackage/ImportAccessDB/frmSelectTable.cs b/PlugInPackage/ImportAccessDB/frmSelectTable.cs index 07b056b4..bc237e43 100644 --- a/PlugInPackage/ImportAccessDB/frmSelectTable.cs +++ b/PlugInPackage/ImportAccessDB/frmSelectTable.cs @@ -11,7 +11,7 @@ internal partial class FrmSelectTable : Form /// /// 必须设定 /// - public MongoServer MServer = null; + public MongoServer mServer = null; public FrmSelectTable() { @@ -20,7 +20,7 @@ public FrmSelectTable() private void SelectTable_Load(object sender, EventArgs e) { - AccessPicker.FileFilter = Utility.MdbFilter; + AccessPicker.FileFilter = Utility.AccessDBFilter; } private void btnGetTabelList_Click(object sender, EventArgs e) @@ -42,7 +42,8 @@ private void btnImport_Click(object sender, EventArgs e) { table.Add(item.ToString()); } - ImportAccessDb.ImportAccessDataBase(AccessPicker.SelectedPathOrFileName, table, MServer); + ImportAccessDb.ImportAccessDataBase(AccessPicker.SelectedPathOrFileName, table, mServer); + MessageBox.Show("Completed"); } } } \ No newline at end of file diff --git a/PlugInPackage/PlugInPackage.csproj b/PlugInPackage/PlugInPackage.csproj index f43899a1..da92e363 100644 --- a/PlugInPackage/PlugInPackage.csproj +++ b/PlugInPackage/PlugInPackage.csproj @@ -12,7 +12,6 @@ v4.6.2 512 - False False False False @@ -23,6 +22,21 @@ bin\Debug\ Full 4 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true true @@ -72,6 +86,10 @@ false + + + + @@ -94,6 +112,10 @@ + + ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0-preview1-24530-04\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + @@ -145,6 +167,7 @@ frmSelectTable.cs + @@ -197,8 +220,22 @@ + + + + + False + Microsoft .NET Framework 4.6.2 %28x86 和 x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + +