initial version with inspection edition

This commit is contained in:
2020-04-29 14:08:00 +08:00
commit 6a5629fc3b
186 changed files with 33984 additions and 0 deletions

18
FICMigrator/App.config Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="FICMigrator.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<applicationSettings>
<FICMigrator.Properties.Settings>
<setting name="ExcludeTables" serializeAs="String">
<value>EXPORTLOG</value>
</setting>
</FICMigrator.Properties.Settings>
</applicationSettings>
</configuration>

161
FICMigrator/Definitions.cs Normal file
View File

@ -0,0 +1,161 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FICMigrator
{
class Definitions
{
public static readonly string[] TABLES = new[]
{
"AUTHORIZE",
"BOARD",
"BOARDCHARTPIVOT",
"BOARDLANGUAGE",
"BOARDPIVOT",
"BOARDPIVOTLANGUAGE",
"CATEGORY",
"CHART",
"CHARTAGGREGATELANGUAGE",
"CHARTCLASS",
"CHARTCONTAINER",
"CHARTCONTAINERPOSITION",
"CHARTDYNAMICYCOLOR",
"CHARTDYNAMICYDATA",
"CHARTDYNAMICYDATACOMPOSITION",
"CHARTDYNAMICYPROPORTION",
"CHARTEXTENSIONCOLUMN",
"CHARTEXTENSIONCOLUMNLANGUAGE",
"CHARTEXTENSIONCOLUMNPARAMVALUE",
"CHARTEXTENSIONDETAIL",
"CHARTEXTENSIONFILTER",
"CHARTEXTENSIONY",
"CHARTFILTER",
"CHARTGAUGEDYNAMICDATA",
"CHARTGAUGEDYNAMICY",
"CHARTLANGUAGE",
"CHARTPARAMVALUE",
"CHARTPIVOT",
"CHARTPIVOTDATA",
"CHARTPIVOTLANGUAGE",
"CHARTPROPERTYVALUE",
"CHARTSORT",
"CHARTTOTALROW",
"CHARTTOTALROWCOLUMN",
"CHARTTOTALROWCOLUMNOBJECT",
"CHARTXYLANGUAGE",
"CHARTXYZ",
"COLORSCHEME",
"CONSTRUCTOROBJECT",
"DATACONNECTION",
"DATARIGHT",
"DATATABLE",
"DATATABLECLASS",
"DATATABLECLASSRELATION",
"DRILLDOWN",
"DRILLDOWNDETAIL",
"DRILLDOWNFILTER",
"DRILLDOWNFORURL",
"DRILLDOWNURLPARAMVALUES",
"DRILLDOWNY",
"DTPERFLOG",
"EMBEDEXTENDEDDATACONNECTION",
"EMBEDEXTENDEDDATATABLE",
"ENUMERATION",
"EXPORTLOG",
"EXTENDEDDC",
"EXTENDEDDCLOGIN",
"FAVORITECONTENT",
"FAVORITEITEM",
"FREECHARTCELL",
"FREECHARTCELLCOLORFILTER",
"FREECHARTCELLDATAFILTER",
"FREECHARTCELLLANGUAGE",
"FREECHARTCOLUMN",
"FREECHARTROW",
"FUNCTIONTYPE",
"GLOBALFILTER",
"GLOBALVARIABLE",
"GRIDWIDTH",
"GROUPS",
"HIDDENBOARDS",
"INNERINFORMATION",
"JOBLOG",
"JOBSCHEDULE",
"LEVELS",
"LICENSEINFO",
"LICENSEPACKAGE",
"LOOKUPDATA",
"MANAGEMENTTREE",
"MESSAGEDATA",
"MESSAGEKEY",
"MESSAGEPARAMS",
"MESSAGEPOOL",
"MESSAGETYPE",
"MODULESINFOFILES",
"MSG",
"MULTILEVELFIELD",
"MUTEX",
"MYFAVCHARTS",
"OBJSTATISTICS",
"OPERATIONRIGHT",
"OPERATIONS",
"PACKAGECONTENT",
"PACKAGEDCMAPPING",
"PACKAGEINFO",
"PACKAGELIST",
"PLUGIN",
"PLUGINCAPTION",
"PLUGINDATAIMPORT",
"PLUGINDATATABLE",
"RESOURCEDATA",
"RESOURCEFILEVERSION",
"SCATTERPLOTFILTER",
"SCATTERPLOTSTYLE",
"SCATTERTARGETSTRUCTURE",
"SCHEDULEDSNAPSHOT",
"SERVICEAGENT",
"SNAPSHOTS",
"SNAPSHOTTOFRS",
"STYLECATALOG",
"STYLEOBJECT",
"STYLEVALUE",
"SUBSCRIBEMESSAGE",
"SYS_USERLOGINERROR",
"SYSTEMFAVORITE",
"SYSTEMPARAMS",
"TABLEFIELD",
"TABLEFILTER",
"TABLEPARAMS",
"TABLERELATION",
"TRANSFORMATIONCOLUMN",
"TRANSFORMATIONROWVALUE",
"TRANSFORMATIONTABLE",
"URLGENERATOR",
"URLGENERATORFILE",
"USERCHARTINFO",
"USERDEFAULTINFO",
"USEREMAIL",
"USERFIRSTLOGIN",
"USERGROUPRELATION",
"USERMESSAGE",
"USERMESSAGEEMAIL",
"USEROBJECT",
"USEROBJECTXML",
"USERS",
"USERTEXTMESSAGE",
"VALS",
"VIRTUALDC",
"VIRTUALROLE",
"WORKSPACE",
"WORKSPACELANGUAGE",
"WORKSPACEPIVOT",
"WORKSPACEPIVOTLANGUAGE",
"WORKSPACEPIVOTRELATION",
"WSPBOARD",
"WSPHIDENCHARTS"
};
}
}

View File

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6FA9CAE8-F5E8-4536-B141-4A7A9F2ADE05}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FICMigrator</RootNamespace>
<AssemblyName>FICMigrator</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Definitions.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Create.sql" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

437
FICMigrator/MainForm.Designer.cs generated Normal file
View File

@ -0,0 +1,437 @@
namespace FICMigrator
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.buttonTestTo = new System.Windows.Forms.Button();
this.buttonTestFrom = new System.Windows.Forms.Button();
this.textPassTo = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.textUserTo = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.textDBTo = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.textServerTo = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.textPassFrom = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.textUserFrom = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.textDBFrom = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.textServerFrom = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.listView1 = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.buttonReloadTables = new System.Windows.Forms.Button();
this.buttonMigrator = new System.Windows.Forms.Button();
this.textMessage = new System.Windows.Forms.TextBox();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.panel1 = new System.Windows.Forms.Panel();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.buttonTestTo);
this.groupBox1.Controls.Add(this.buttonTestFrom);
this.groupBox1.Controls.Add(this.textPassTo);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.textUserTo);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.textDBTo);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.textServerTo);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.textPassFrom);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.textUserFrom);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.textDBFrom);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.textServerFrom);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(909, 91);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Connections";
//
// buttonTestTo
//
this.buttonTestTo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonTestTo.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonTestTo.Location = new System.Drawing.Point(844, 51);
this.buttonTestTo.Name = "buttonTestTo";
this.buttonTestTo.Size = new System.Drawing.Size(59, 23);
this.buttonTestTo.TabIndex = 17;
this.buttonTestTo.Text = "Test";
this.buttonTestTo.UseVisualStyleBackColor = true;
this.buttonTestTo.Click += new System.EventHandler(this.buttonTestTo_Click);
//
// buttonTestFrom
//
this.buttonTestFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonTestFrom.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonTestFrom.Location = new System.Drawing.Point(844, 22);
this.buttonTestFrom.Name = "buttonTestFrom";
this.buttonTestFrom.Size = new System.Drawing.Size(59, 23);
this.buttonTestFrom.TabIndex = 8;
this.buttonTestFrom.Text = "Test";
this.buttonTestFrom.UseVisualStyleBackColor = true;
this.buttonTestFrom.Click += new System.EventHandler(this.buttonTestFrom_Click);
//
// textPassTo
//
this.textPassTo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.textPassTo.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textPassTo.Location = new System.Drawing.Point(762, 51);
this.textPassTo.Name = "textPassTo";
this.textPassTo.PasswordChar = '*';
this.textPassTo.Size = new System.Drawing.Size(76, 21);
this.textPassTo.TabIndex = 16;
this.textPassTo.Text = "database";
this.textPassTo.TextChanged += new System.EventHandler(this.textboxTo_TextChanged);
//
// label8
//
this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(686, 54);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(67, 17);
this.label8.TabIndex = 15;
this.label8.Text = "Password:";
//
// textUserTo
//
this.textUserTo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.textUserTo.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textUserTo.Location = new System.Drawing.Point(606, 51);
this.textUserTo.Name = "textUserTo";
this.textUserTo.Size = new System.Drawing.Size(74, 21);
this.textUserTo.TabIndex = 14;
this.textUserTo.Text = "fi";
this.textUserTo.TextChanged += new System.EventHandler(this.textboxTo_TextChanged);
//
// label7
//
this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(560, 54);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(38, 17);
this.label7.TabIndex = 13;
this.label7.Text = "User:";
//
// textDBTo
//
this.textDBTo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.textDBTo.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textDBTo.Location = new System.Drawing.Point(459, 51);
this.textDBTo.Name = "textDBTo";
this.textDBTo.Size = new System.Drawing.Size(95, 21);
this.textDBTo.TabIndex = 12;
this.textDBTo.Text = "IRONINTEL_IRONDEV_FIC";
this.textDBTo.TextChanged += new System.EventHandler(this.textboxTo_TextChanged);
//
// label6
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(422, 54);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(28, 17);
this.label6.TabIndex = 11;
this.label6.Text = "DB:";
//
// textServerTo
//
this.textServerTo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textServerTo.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textServerTo.Location = new System.Drawing.Point(105, 51);
this.textServerTo.Name = "textServerTo";
this.textServerTo.Size = new System.Drawing.Size(311, 21);
this.textServerTo.TabIndex = 10;
this.textServerTo.Text = "192.168.25.212";
this.textServerTo.TextChanged += new System.EventHandler(this.textboxTo_TextChanged);
//
// label5
//
this.label5.Location = new System.Drawing.Point(6, 54);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(90, 17);
this.label5.TabIndex = 9;
this.label5.Text = "To:";
this.label5.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// textPassFrom
//
this.textPassFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.textPassFrom.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textPassFrom.Location = new System.Drawing.Point(762, 22);
this.textPassFrom.Name = "textPassFrom";
this.textPassFrom.PasswordChar = '*';
this.textPassFrom.Size = new System.Drawing.Size(76, 21);
this.textPassFrom.TabIndex = 7;
this.textPassFrom.Text = "demo";
this.textPassFrom.TextChanged += new System.EventHandler(this.textbox_TextChanged);
//
// label4
//
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(686, 25);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(67, 17);
this.label4.TabIndex = 6;
this.label4.Text = "Password:";
//
// textUserFrom
//
this.textUserFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.textUserFrom.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textUserFrom.Location = new System.Drawing.Point(606, 22);
this.textUserFrom.Name = "textUserFrom";
this.textUserFrom.Size = new System.Drawing.Size(74, 21);
this.textUserFrom.TabIndex = 5;
this.textUserFrom.Text = "demo";
this.textUserFrom.TextChanged += new System.EventHandler(this.textbox_TextChanged);
//
// label3
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(560, 25);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 17);
this.label3.TabIndex = 4;
this.label3.Text = "User:";
//
// textDBFrom
//
this.textDBFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.textDBFrom.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textDBFrom.Location = new System.Drawing.Point(459, 22);
this.textDBFrom.Name = "textDBFrom";
this.textDBFrom.Size = new System.Drawing.Size(95, 21);
this.textDBFrom.TabIndex = 3;
this.textDBFrom.Text = "T02_0630_FIC";
this.textDBFrom.TextChanged += new System.EventHandler(this.textbox_TextChanged);
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(422, 25);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(28, 17);
this.label2.TabIndex = 2;
this.label2.Text = "DB:";
//
// textServerFrom
//
this.textServerFrom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textServerFrom.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textServerFrom.Location = new System.Drawing.Point(105, 22);
this.textServerFrom.Name = "textServerFrom";
this.textServerFrom.Size = new System.Drawing.Size(311, 21);
this.textServerFrom.TabIndex = 1;
this.textServerFrom.Text = "192.168.25.106";
this.textServerFrom.TextChanged += new System.EventHandler(this.textbox_TextChanged);
//
// label1
//
this.label1.Location = new System.Drawing.Point(6, 25);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(90, 17);
this.label1.TabIndex = 0;
this.label1.Text = "Connect from:";
this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox2.Controls.Add(this.listView1);
this.groupBox2.Controls.Add(this.buttonReloadTables);
this.groupBox2.Location = new System.Drawing.Point(12, 109);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(295, 402);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Check Tables";
//
// listView1
//
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
this.listView1.Location = new System.Drawing.Point(6, 29);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(283, 364);
this.listView1.TabIndex = 1;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "Table";
this.columnHeader1.Width = 200;
//
// columnHeader2
//
this.columnHeader2.Text = "";
//
// buttonReloadTables
//
this.buttonReloadTables.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonReloadTables.Font = new System.Drawing.Font("Microsoft YaHei UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonReloadTables.Location = new System.Drawing.Point(228, 0);
this.buttonReloadTables.Name = "buttonReloadTables";
this.buttonReloadTables.Size = new System.Drawing.Size(55, 23);
this.buttonReloadTables.TabIndex = 0;
this.buttonReloadTables.Text = "Load";
this.buttonReloadTables.UseVisualStyleBackColor = true;
this.buttonReloadTables.Click += new System.EventHandler(this.buttonReloadTables_Click);
//
// buttonMigrator
//
this.buttonMigrator.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.buttonMigrator.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonMigrator.Location = new System.Drawing.Point(316, 481);
this.buttonMigrator.Name = "buttonMigrator";
this.buttonMigrator.Size = new System.Drawing.Size(605, 30);
this.buttonMigrator.TabIndex = 3;
this.buttonMigrator.Text = "Copy tables";
this.buttonMigrator.UseVisualStyleBackColor = true;
this.buttonMigrator.Click += new System.EventHandler(this.buttonMigrator_Click);
//
// textMessage
//
this.textMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textMessage.Location = new System.Drawing.Point(316, 109);
this.textMessage.Multiline = true;
this.textMessage.Name = "textMessage";
this.textMessage.ReadOnly = true;
this.textMessage.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textMessage.Size = new System.Drawing.Size(605, 366);
this.textMessage.TabIndex = 2;
//
// progressBar1
//
this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.progressBar1.Location = new System.Drawing.Point(316, 455);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(605, 20);
this.progressBar1.TabIndex = 4;
this.progressBar1.Visible = false;
//
// panel1
//
this.panel1.Controls.Add(this.progressBar1);
this.panel1.Controls.Add(this.groupBox1);
this.panel1.Controls.Add(this.textMessage);
this.panel1.Controls.Add(this.groupBox2);
this.panel1.Controls.Add(this.buttonMigrator);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(933, 523);
this.panel1.TabIndex = 5;
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(933, 523);
this.Controls.Add(this.panel1);
this.DoubleBuffered = true;
this.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.MinimumSize = new System.Drawing.Size(690, 270);
this.Name = "MainForm";
this.Text = "Migrator - Foresight Intelligence Center";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
public System.Windows.Forms.TextBox textDBFrom;
private System.Windows.Forms.Label label2;
public System.Windows.Forms.TextBox textServerFrom;
private System.Windows.Forms.Label label1;
public System.Windows.Forms.TextBox textUserFrom;
private System.Windows.Forms.Label label3;
public System.Windows.Forms.TextBox textPassFrom;
private System.Windows.Forms.Label label4;
public System.Windows.Forms.TextBox textServerTo;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
public System.Windows.Forms.TextBox textDBTo;
public System.Windows.Forms.TextBox textUserTo;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
public System.Windows.Forms.TextBox textPassTo;
private System.Windows.Forms.Button buttonTestFrom;
private System.Windows.Forms.Button buttonTestTo;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button buttonReloadTables;
private System.Windows.Forms.Button buttonMigrator;
private System.Windows.Forms.TextBox textMessage;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Panel panel1;
}
}

432
FICMigrator/MainForm.cs Normal file
View File

@ -0,0 +1,432 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FICMigrator
{
public partial class MainForm : Form
{
private string _connFromString;
private string _connToString;
private bool _isFromTested;
private bool _isToTested;
public MainForm()
{
InitializeComponent();
}
private void textbox_TextChanged(object sender, EventArgs e)
{
_isFromTested = false;
}
private void textboxTo_TextChanged(object sender, EventArgs e)
{
_isToTested = false;
}
private string SafeString(string str)
{
if (string.IsNullOrEmpty(str))
return str;
return str.Replace(';', '_');
}
private void GetConnFromString()
{
_connFromString = string.Format("Data Source={0};Initial Catalog={1};Integrated Security=false;User ID={2};Password={3}",
SafeString(textServerFrom.Text),
SafeString(textDBFrom.Text),
SafeString(textUserFrom.Text),
SafeString(textPassFrom.Text));
}
private void GetConnToString()
{
_connToString = string.Format("Data Source={0};Initial Catalog={1};Integrated Security=false;User ID={2};Password={3}",
SafeString(textServerTo.Text),
SafeString(textDBTo.Text),
SafeString(textUserTo.Text),
SafeString(textPassTo.Text));
}
private void EnableUI(bool flag)
{
this.panel1.Enabled = flag;
this.Cursor = flag ? Cursors.Default : Cursors.AppStarting;
this.progressBar1.Visible = false;
}
private void buttonTestFrom_Click(object sender, EventArgs e)
{
EnableUI(false);
new Thread(new ThreadStart(async delegate
{
var result = await Task.Run(new Func<bool>(TestFromConnection));
if (result)
{
this.BeginInvoke(new Action(delegate
{
MessageBox.Show(this, "Test successfully.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}));
}
this.BeginInvoke(new Action(delegate
{
EnableUI(true);
}));
})).Start();
}
private void buttonTestTo_Click(object sender, EventArgs e)
{
EnableUI(false);
new Thread(new ThreadStart(async delegate
{
var result = await Task.Run(new Func<bool>(TestToConnection));
if (result)
{
this.BeginInvoke(new Action(delegate
{
MessageBox.Show(this, "Test successfully.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}));
}
this.BeginInvoke(new Action(delegate
{
EnableUI(true);
}));
})).Start();
}
private void buttonReloadTables_Click(object sender, EventArgs e)
{
listView1.Items.Clear();
EnableUI(false);
new Thread(LoadTables).Start();
}
private void buttonMigrator_Click(object sender, EventArgs e)
{
EnableUI(false);
textMessage.Text = "";
progressBar1.Visible = true;
progressBar1.Value = 0;
progressBar1.Maximum = Definitions.TABLES.Length;
new Thread(MigrateTables).Start();
}
private bool TestFromConnection()
{
try
{
GetConnFromString();
using (var conn = new SqlConnection(_connFromString))
{
conn.Open();
}
_isFromTested = true;
}
catch (Exception ex)
{
this.BeginInvoke(new Action<object>(o =>
{
MessageBox.Show(this, "Error occurs:\n" + o, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}), ex);
return false;
}
return true;
}
private bool TestToConnection()
{
try
{
GetConnToString();
using (var conn = new SqlConnection(_connToString))
{
conn.Open();
}
_isToTested = true;
}
catch (Exception ex)
{
this.BeginInvoke(new Action<object>(o =>
{
MessageBox.Show(this, "Error occurs:\n" + o, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}), ex);
return false;
}
return true;
}
private void LoadTables()
{
if (!_isFromTested)
{
this.BeginInvoke(new Action(delegate
{
MessageBox.Show(this, "Please test connection first.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
EnableUI(true);
}));
return;
}
try
{
var list = new List<ListViewItem>();
using (var conn = new SqlConnection(_connFromString))
{
conn.Open();
foreach (var tb in Definitions.TABLES)
{
var cmd = conn.CreateCommand();
cmd.CommandText = "select 1 from sys.objects where object_id=object_id(@tb) and type='U'";
cmd.Parameters.AddWithValue("@tb", tb);
var o = cmd.ExecuteScalar();
var notexist = (o == null || o == DBNull.Value);
list.Add(new ListViewItem(new[] { tb, notexist ? "×" : "" }));
}
}
var arr = list.ToArray();
this.BeginInvoke(new Action(delegate
{
this.listView1.Items.AddRange(arr);
}));
}
catch (Exception ex)
{
this.BeginInvoke(new Action<object>(o =>
{
MessageBox.Show(this, "Error occurs:\n" + o, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}), ex);
}
finally
{
this.BeginInvoke(new Action(delegate
{
EnableUI(true);
}));
}
}
private void MigrateTables()
{
var result = TestFromConnection();
if (!result)
{
return;
}
result = TestToConnection();
if (!result)
{
return;
}
if (!_isFromTested || !_isToTested)
{
this.BeginInvoke(new Action(delegate
{
MessageBox.Show(this, "Please test all connections first.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
EnableUI(true);
}));
return;
}
try
{
var exclude_tables = Properties.Settings.Default.ExcludeTables.Split(',');
// init structure
var fieldsDict = new Dictionary<string, string[]>();
using (var conn = new SqlConnection(_connToString))
{
conn.Open();
//using (var cmd = conn.CreateCommand())
//{
// cmd.CommandText = Properties.Resources.Create;
// cmd.CommandType = CommandType.Text;
// cmd.ExecuteNonQuery();
//}
var truncate = new StringBuilder();
foreach (var tb in Definitions.TABLES)
{
if (exclude_tables.Any(s => string.Compare(s, tb, true) == 0))
{
this.BeginInvoke(new Action<object>(o =>
{
textMessage.Text += string.Format("[{0:HH:mm:ss}] - {1}\r\n\r\n", DateTime.Now, o);
}), string.Format("Exclude truncate table \"{0}\"", tb));
continue;
}
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME=@pn";
cmd.Parameters.AddWithValue("@pn", tb);
using (var reader = cmd.ExecuteReader())
{
var fields = new List<string>();
while (reader.Read())
{
fields.Add(reader["COLUMN_NAME"].ToString());
}
fieldsDict[tb] = fields.ToArray();
}
}
truncate.AppendLine("truncate table " + tb);
}
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = truncate.ToString();
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
}
}
// copy data
this.BeginInvoke(new Action(delegate
{
progressBar1.Style = ProgressBarStyle.Blocks;
}));
var bulk = new SqlBulkCopy(_connToString);
bulk.BatchSize = 1000;
bulk.BulkCopyTimeout = 600;
var i = 0;
foreach (var tb in Definitions.TABLES)
{
if (exclude_tables.Any(s => string.Compare(s, tb, true) == 0))
{
this.BeginInvoke(new Action<object>(o =>
{
textMessage.Text += string.Format("[{0:HH:mm:ss}] - {1}\r\n\r\n", DateTime.Now, o);
}), string.Format("Exclude table \"{0}\"", tb));
continue;
}
using (var conn = new SqlConnection(_connFromString))
{
conn.Open();
using (var cmd = conn.CreateCommand())
{
var fields = fieldsDict[tb];
cmd.CommandText = string.Format("select [{0}] from [{1}]", string.Join("],[", fields), tb);
try
{
#if READER
var reader = cmd.ExecuteReader();
bulk.DestinationTableName = tb;
bulk.WriteToServer(reader);
#else
var ds = new DataSet();
using (var adapter = new SqlDataAdapter(cmd))
{
adapter.Fill(ds);
}
bulk.DestinationTableName = tb;
var table = ds.Tables[0];
bulk.ColumnMappings.Clear();
//foreach (DataColumn col in table.Columns)
foreach (var field in fields)
{
//bulk.ColumnMappings.Add(col.ColumnName, col.ColumnName.ToUpper());
bulk.ColumnMappings.Add(field, field);
}
bulk.WriteToServer(table);
#endif
this.BeginInvoke(new Action<object>(o =>
{
textMessage.Text += string.Format("[{0:HH:mm:ss}] table \"{1}\" copied.\r\n\r\n", DateTime.Now, o);
}), tb);
}
catch (Exception ex)
{
this.BeginInvoke(new Action<object, object>((o1, o2) =>
{
textMessage.Text += string.Format("[{0:HH:mm:ss}] table \"{1}\" - {2}\r\n\r\n", DateTime.Now, o2, o1);
}), ex, tb);
}
finally
{
this.BeginInvoke(new Action<int>(o =>
{
progressBar1.Value = o;
}), ++i);
}
}
}
}
bulk.Close();
// change the system params
using (var conn = new SqlConnection(_connToString))
{
conn.Open();
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = "update SYSTEMPARAMS set PARAMVALUE=@v where PARAMNAME='ExtDBName'";
cmd.Parameters.AddWithValue("@v", textDBTo.Text + "EXT"); //Properties.Settings.Default.ExtDBName
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
}
}
this.BeginInvoke(new Action(delegate
{
MessageBox.Show(this, "All done.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}));
}
catch (Exception ex)
{
this.BeginInvoke(new Action<object>(o =>
{
textMessage.Text = "Error occurs:\r\n" + o;
MessageBox.Show(this, "Error occurs, please see the detail.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}), ex);
}
finally
{
this.BeginInvoke(new Action(delegate
{
EnableUI(true);
}));
}
}
}
}

120
FICMigrator/MainForm.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

59
FICMigrator/Program.cs Normal file
View File

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FICMigrator
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
#if TEST
//var path = @"C:\Users\cl\Documents\Tencent Files\272001610\FileRecv\";
//var bs = System.IO.File.ReadAllBytes(path + "HttpHandler.lua.dream");
//var result = DecryptAES(bs);
//System.IO.File.WriteAllText(path + "HttpHandler.lua", result);
#endif
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var frm = new MainForm();
frm.textServerFrom.Text = @"FIIRONSQL01\IRONINTEL";
frm.textDBFrom.Text = "IronIntel001_FIC";
frm.textUserFrom.Text = "cc";
frm.textPassFrom.Text = "$hortPuma96";
frm.textServerTo.Text = @"FIIRONSQL01\IRONINTEL";
frm.textDBTo.Text = "IRONINTEL_09302016_TEST1_FIC";
frm.textUserTo.Text = "cc";
frm.textPassTo.Text = "$hortPuma96";
Application.Run(frm);
}
#if TEST
static string DecryptAES(byte[] to)
{
var keys = Encoding.UTF8.GetBytes("HAO_HAO_JIA=+=MI");
var r = new System.Security.Cryptography.RijndaelManaged
{
Key = keys,
Mode = System.Security.Cryptography.CipherMode.ECB,
Padding = System.Security.Cryptography.PaddingMode.None
};
var trans = r.CreateDecryptor();
var result = trans.TransformFinalBlock(to, 0, to.Length);
return Encoding.UTF8.GetString(result);
}
#endif
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FICMigrator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FICMigrator")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6fa9cae8-f5e8-4536-b141-4a7a9f2ade05")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,77 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FICMigrator.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FICMigrator.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to /****** Object: UserDefinedDataType [dbo].[Description] Script Date: 2017/1/5 15:14:17 ******/
///IF NOT EXISTS (SELECT * FROM sys.types st JOIN sys.schemas ss ON st.schema_id = ss.schema_id WHERE st.name = N&apos;Description&apos; AND ss.name = N&apos;dbo&apos;)
///CREATE TYPE [dbo].[Description] FROM [nvarchar](200) NULL
///
////****** Object: UserDefinedDataType [dbo].[GUID] Script Date: 2017/1/5 15:14:17 ******/
///IF NOT EXISTS (SELECT * FROM sys.types st JOIN sys.schemas ss ON st.schema_id = ss.schema_id WHERE st.name = N&apos; [rest of string was truncated]&quot;;.
/// </summary>
internal static string Create {
get {
return ResourceManager.GetString("Create", resourceCulture);
}
}
}
}

View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Create" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Create.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
</root>

View File

@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FICMigrator.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("EXPORTLOG")]
public string ExcludeTables {
get {
return ((string)(this["ExcludeTables"]));
}
}
}
}

View File

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="FICMigrator.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="ExcludeTables" Type="System.String" Scope="Application">
<Value Profile="(Default)">EXPORTLOG</Value>
</Setting>
</Settings>
</SettingsFile>

Binary file not shown.