| @@ -0,0 +1,56 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| namespace acc_pgsql | |||||
| { | |||||
| public enum DBTYPE | |||||
| { | |||||
| OLEDB = 1, | |||||
| SQLDB = 2, | |||||
| POSTGRESS = 3 | |||||
| } | |||||
| public static class DBGlobals | |||||
| { | |||||
| static string ACCESS_CONN = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\dspec\\RPM-97.mdb;User Id=admin;Password=;"; | |||||
| static string SQL_CONN = "Data Source=RPM-APP.prelub.com;Initial Catalog=access;Persist Security Info=True;User ID=mobilepmuser;Password=data4techs;"; | |||||
| static string POSTGRESS_CONN = "Server={0};Database=accessdb_v2;Port={1};User Id=mcarman;Password=@ng31F@rm0823262;"; | |||||
| public static System.Data.DataSet SelectDS(DBTYPE db, string sql) | |||||
| { | |||||
| System.Data.DataSet obj = new System.Data.DataSet(); | |||||
| switch (db) | |||||
| { | |||||
| case DBTYPE.OLEDB: | |||||
| using (System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(ACCESS_CONN)) | |||||
| { | |||||
| conn.Open(); | |||||
| System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand(sql); | |||||
| cmd.Connection = conn; | |||||
| System.Data.OleDb.OleDbDataAdapter accAdapter = new System.Data.OleDb.OleDbDataAdapter(cmd); | |||||
| accAdapter.Fill(obj); | |||||
| conn.Close(); | |||||
| conn.Dispose(); | |||||
| } | |||||
| return obj; | |||||
| case DBTYPE.SQLDB: | |||||
| using (System.Data.SqlClient.SqlConnection sqlconn = new System.Data.SqlClient.SqlConnection(SQL_CONN)) | |||||
| { | |||||
| sqlconn.Open(); | |||||
| System.Data.SqlClient.SqlCommand sqlcmd = new System.Data.SqlClient.SqlCommand(sql); | |||||
| sqlcmd.Connection = sqlconn; | |||||
| sqlcmd.CommandType = System.Data.CommandType.Text; | |||||
| System.Data.SqlClient.SqlDataAdapter sqlAdapter = new System.Data.SqlClient.SqlDataAdapter(sqlcmd); | |||||
| sqlAdapter.Fill(obj); | |||||
| sqlconn.Close(); | |||||
| sqlconn.Dispose(); | |||||
| } | |||||
| return obj; | |||||
| default: | |||||
| return obj; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,91 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Data; | |||||
| namespace acc_pgsql | |||||
| { | |||||
| public static class PGSqlGenerator | |||||
| { | |||||
| static string _tblDescription = @"select column_name, data_type, character_maximum_length, column_default, is_nullable from INFORMATION_SCHEMA.COLUMNS where table_name = '{0}' order by ordinal_position;"; | |||||
| public struct PGColumn | |||||
| { | |||||
| public string name { get; set; } | |||||
| public bool singlequotesneeded { get; set; }//This is for the value when selecting | |||||
| } | |||||
| public static void GenerateSeedData(string tblName) | |||||
| { | |||||
| StringBuilder sb = new StringBuilder(); | |||||
| string sql = string.Format(_tblDescription, tblName); | |||||
| List<string> list = new List<string>(); | |||||
| list.Add(sql); | |||||
| list.Add(string.Format("select * from \"{0}\"", tblName)); | |||||
| System.Data.DataSet ds = PGSqlHelper.RunPGSql(list); | |||||
| string insert = "Insert Into \"" + tblName + "\"("; | |||||
| List<PGColumn> fields = new List<PGColumn>(); | |||||
| foreach (DataRow row in ds.Tables[0].Rows) | |||||
| { | |||||
| PGColumn clmn = new PGColumn(); | |||||
| clmn.name = row.ItemArray[0].ToString(); | |||||
| switch (row.ItemArray[1].ToString()) | |||||
| { | |||||
| case "bigint": | |||||
| clmn.singlequotesneeded = false; | |||||
| break; | |||||
| case "timestamp with time zone": | |||||
| clmn.singlequotesneeded = true; | |||||
| break; | |||||
| case "text": | |||||
| clmn.singlequotesneeded = true; | |||||
| break; | |||||
| case "boolean": | |||||
| clmn.singlequotesneeded = false; | |||||
| break; | |||||
| default: | |||||
| clmn.singlequotesneeded = true; | |||||
| break; | |||||
| } | |||||
| fields.Add(clmn); | |||||
| } | |||||
| string topline = string.Format("Insert Into \"{0}\"(", tblName); | |||||
| string bottomline = "values("; | |||||
| for(int i = 0; i < fields.Count; i++) | |||||
| { | |||||
| if (i == 0) | |||||
| { | |||||
| topline = topline + "\"" + fields[i].name + "\""; | |||||
| if (fields[i].singlequotesneeded) | |||||
| bottomline = bottomline + string.Format("'{0}'", "|"+i+"|"); | |||||
| else bottomline = bottomline + string.Format("{0}", "|" + i + "|"); | |||||
| } | |||||
| else | |||||
| { | |||||
| topline = topline + ", \"" + fields[i].name + "\""; | |||||
| if (fields[i].singlequotesneeded) | |||||
| bottomline = bottomline + string.Format(", '{0}'", "|" + i + "|"); | |||||
| else bottomline = bottomline + string.Format(", {0}", "|" + i + "|"); | |||||
| } | |||||
| } | |||||
| topline = topline + ")"; | |||||
| bottomline = bottomline + ");"; | |||||
| string statment = string.Format("{0} {1}", topline, bottomline); | |||||
| List<string> insertstatements = new List<string>(); | |||||
| foreach (DataRow row2 in ds.Tables[1].Rows) | |||||
| { | |||||
| for(int c = 0; c < ds.Tables[1].Columns.Count; c++) | |||||
| { | |||||
| string rep = string.Format("|{0}|", c); | |||||
| statment = statment.Replace(rep, row2.ItemArray[c].ToString()); | |||||
| } | |||||
| insertstatements.Add(statment); | |||||
| sb.AppendLine(statment); | |||||
| } | |||||
| Console.WriteLine(sb.ToString()); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,67 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using Renci.SshNet; | |||||
| using Npgsql; | |||||
| namespace acc_pgsql | |||||
| { | |||||
| public static class PGSqlHelper | |||||
| { | |||||
| static string _ipaddress = "192.168.0.108"; | |||||
| static string _username = "mcarman"; | |||||
| static string _pwd = "@ng31F@rm0823262"; | |||||
| static string _localip = "127.0.0.1"; | |||||
| static uint _port = (uint)5432; | |||||
| static string _connString = "Server={0};Database=accessdb_v2;Port={1};User Id={2};Password={3};"; | |||||
| public static System.Data.DataSet RunPGSql( List<string> sql) | |||||
| { | |||||
| uint port = (uint)_port; | |||||
| using (SshClient client = new SshClient(_ipaddress, _username, _pwd)) | |||||
| { | |||||
| System.Data.DataSet ds = new System.Data.DataSet(); | |||||
| client.Connect(); | |||||
| ForwardedPortLocal tunnel = new ForwardedPortLocal(_localip, _localip, _port); | |||||
| client.AddForwardedPort(tunnel); | |||||
| if (client.IsConnected) | |||||
| { | |||||
| tunnel.Start(); | |||||
| string connStr = string.Format(_connString, tunnel.BoundHost, tunnel.BoundPort, _username, _pwd); | |||||
| try | |||||
| { | |||||
| using (NpgsqlConnection conn = new NpgsqlConnection(connStr)) | |||||
| { | |||||
| conn.Open(); | |||||
| NpgsqlCommand cmd = conn.CreateCommand(); | |||||
| cmd.CommandType = System.Data.CommandType.Text; | |||||
| foreach (string s in sql) | |||||
| { | |||||
| System.Data.DataTable tbl = new System.Data.DataTable(); | |||||
| cmd.CommandText = s; | |||||
| NpgsqlDataAdapter adapter = new NpgsqlDataAdapter(cmd); | |||||
| adapter.Fill(tbl); | |||||
| ds.Tables.Add(tbl); | |||||
| } | |||||
| return ds; | |||||
| } | |||||
| } | |||||
| catch (Exception ex) | |||||
| { | |||||
| Console.WriteLine(ex.Message); | |||||
| throw ex; | |||||
| } | |||||
| } | |||||
| else | |||||
| { | |||||
| return ds; | |||||
| //kill program | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,12 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| namespace acc_pgsql | |||||
| { | |||||
| public static class PGSqlQueries | |||||
| { | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,15 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| namespace acc_pgsql | |||||
| { | |||||
| class Program | |||||
| { | |||||
| static void Main(string[] args) | |||||
| { | |||||
| PGSqlGenerator.GenerateSeedData("Status"); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -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("acc_pgsql")] | |||||
| [assembly: AssemblyDescription("")] | |||||
| [assembly: AssemblyConfiguration("")] | |||||
| [assembly: AssemblyCompany("")] | |||||
| [assembly: AssemblyProduct("acc_pgsql")] | |||||
| [assembly: AssemblyCopyright("Copyright © 2024")] | |||||
| [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("31df6e0c-49ae-4696-8362-f212faf3d62b")] | |||||
| // 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")] | |||||
| @@ -0,0 +1,87 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||||
| <PropertyGroup> | |||||
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |||||
| <Platform Condition=" '$(Platform)' == '' ">x86</Platform> | |||||
| <ProductVersion>8.0.30703</ProductVersion> | |||||
| <SchemaVersion>2.0</SchemaVersion> | |||||
| <ProjectGuid>{5F9533DE-6CC6-4131-A85C-203ECFB92FBE}</ProjectGuid> | |||||
| <OutputType>Exe</OutputType> | |||||
| <AppDesignerFolder>Properties</AppDesignerFolder> | |||||
| <RootNamespace>acc_pgsql</RootNamespace> | |||||
| <AssemblyName>acc_pgsql</AssemblyName> | |||||
| <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | |||||
| <TargetFrameworkProfile>Client</TargetFrameworkProfile> | |||||
| <FileAlignment>512</FileAlignment> | |||||
| </PropertyGroup> | |||||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | |||||
| <PlatformTarget>x86</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|x86' "> | |||||
| <PlatformTarget>x86</PlatformTarget> | |||||
| <DebugType>pdbonly</DebugType> | |||||
| <Optimize>true</Optimize> | |||||
| <OutputPath>bin\Release\</OutputPath> | |||||
| <DefineConstants>TRACE</DefineConstants> | |||||
| <ErrorReport>prompt</ErrorReport> | |||||
| <WarningLevel>4</WarningLevel> | |||||
| </PropertyGroup> | |||||
| <ItemGroup> | |||||
| <Reference Include="Microsoft.Web.XmlTransform"> | |||||
| <HintPath>..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll</HintPath> | |||||
| </Reference> | |||||
| <Reference Include="Mono.Security"> | |||||
| <HintPath>..\packages\Npgsql.2.2.7\lib\net40\Mono.Security.dll</HintPath> | |||||
| </Reference> | |||||
| <Reference Include="Newtonsoft.Json"> | |||||
| <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net40\Newtonsoft.Json.dll</HintPath> | |||||
| </Reference> | |||||
| <Reference Include="Npgsql"> | |||||
| <HintPath>..\packages\Npgsql.2.2.7\lib\net40\Npgsql.dll</HintPath> | |||||
| </Reference> | |||||
| <Reference Include="NuGet.Core"> | |||||
| <HintPath>..\packages\NuGet.Core.2.14.0\lib\net40-Client\NuGet.Core.dll</HintPath> | |||||
| </Reference> | |||||
| <Reference Include="Renci.SshNet"> | |||||
| <HintPath>..\packages\SSH.NET.2014.4.6-beta2\lib\net40\Renci.SshNet.dll</HintPath> | |||||
| </Reference> | |||||
| <Reference Include="System" /> | |||||
| <Reference Include="System.Core" /> | |||||
| <Reference Include="System.Net" /> | |||||
| <Reference Include="System.Net.Http.Formatting"> | |||||
| <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath> | |||||
| </Reference> | |||||
| <Reference Include="System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | |||||
| <SpecificVersion>False</SpecificVersion> | |||||
| <HintPath>..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.WebRequest.dll</HintPath> | |||||
| </Reference> | |||||
| <Reference Include="System.Xml.Linq" /> | |||||
| <Reference Include="System.Data.DataSetExtensions" /> | |||||
| <Reference Include="Microsoft.CSharp" /> | |||||
| <Reference Include="System.Data" /> | |||||
| <Reference Include="System.Xml" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <Compile Include="DBGlobals.cs" /> | |||||
| <Compile Include="PGSqlGenerator.cs" /> | |||||
| <Compile Include="PGSqlHelper.cs" /> | |||||
| <Compile Include="Program.cs" /> | |||||
| <Compile Include="Properties\AssemblyInfo.cs" /> | |||||
| <Compile Include="PGSqlQueries.cs" /> | |||||
| </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> | |||||
| @@ -0,0 +1,63 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <doc> | |||||
| <assembly> | |||||
| <name>System.Net.Http.WebRequest</name> | |||||
| </assembly> | |||||
| <members> | |||||
| <member name="T:System.Net.Http.RtcRequestFactory"> | |||||
| <summary>Represents the class that is used to create special <see cref="T:System.Net.Http.HttpRequestMessage" /> for use with the Real-Time-Communications (RTC) background notification infrastructure.</summary> | |||||
| </member> | |||||
| <member name="M:System.Net.Http.RtcRequestFactory.Create(System.Net.Http.HttpMethod,System.Uri)"> | |||||
| <summary>Creates a special <see cref="T:System.Net.Http.HttpRequestMessage" /> for use with the Real-Time-Communications (RTC) background notification infrastructure.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Http.HttpRequestMessage" />.An HTTP request message for use with the RTC background notification infrastructure.</returns> | |||||
| <param name="method">The HTTP method.</param> | |||||
| <param name="uri">The Uri the request is sent to.</param> | |||||
| </member> | |||||
| <member name="T:System.Net.Http.WebRequestHandler"> | |||||
| <summary>Provides desktop-specific features not available to Windows Store apps or other environments. </summary> | |||||
| </member> | |||||
| <member name="M:System.Net.Http.WebRequestHandler.#ctor"> | |||||
| <summary>Initializes a new instance of the <see cref="T:System.Net.Http.WebRequestHandler" /> class.</summary> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.AllowPipelining"> | |||||
| <summary> Gets or sets a value that indicates whether to pipeline the request to the Internet resource.</summary> | |||||
| <returns>Returns <see cref="T:System.Boolean" />.true if the request should be pipelined; otherwise, false. The default is true. </returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.AuthenticationLevel"> | |||||
| <summary>Gets or sets a value indicating the level of authentication and impersonation used for this request.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Security.AuthenticationLevel" />.A bitwise combination of the <see cref="T:System.Net.Security.AuthenticationLevel" /> values. The default value is <see cref="F:System.Net.Security.AuthenticationLevel.MutualAuthRequested" />.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.CachePolicy"> | |||||
| <summary>Gets or sets the cache policy for this request.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Cache.RequestCachePolicy" />.A <see cref="T:System.Net.Cache.RequestCachePolicy" /> object that defines a cache policy. The default is <see cref="P:System.Net.WebRequest.DefaultCachePolicy" />.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ClientCertificates"> | |||||
| <summary>Gets or sets the collection of security certificates that are associated with this request.</summary> | |||||
| <returns>Returns <see cref="T:System.Security.Cryptography.X509Certificates.X509CertificateCollection" />.The collection of security certificates associated with this request.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ContinueTimeout"> | |||||
| <summary>Gets or sets the amount of time, in milliseconds, the application will wait for 100-continue from the server before uploading data.</summary> | |||||
| <returns>Returns <see cref="T:System.TimeSpan" />.The amount of time, in milliseconds, the application will wait for 100-continue from the server before uploading data. The default value is 350 milliseconds.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ImpersonationLevel"> | |||||
| <summary>Gets or sets the impersonation level for the current request.</summary> | |||||
| <returns>Returns <see cref="T:System.Security.Principal.TokenImpersonationLevel" />.The impersonation level for the request. The default is <see cref="F:System.Security.Principal.TokenImpersonationLevel.Delegation" />.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.MaxResponseHeadersLength"> | |||||
| <summary>Gets or sets the maximum allowed length of the response headers.</summary> | |||||
| <returns>Returns <see cref="T:System.Int32" />.The length, in kilobytes (1024 bytes), of the response headers.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ReadWriteTimeout"> | |||||
| <summary>Gets or sets a time-out in milliseconds when writing a request to or reading a response from a server.</summary> | |||||
| <returns>Returns <see cref="T:System.Int32" />.The number of milliseconds before the writing or reading times out. The default value is 300,000 milliseconds (5 minutes). </returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ServerCertificateValidationCallback"> | |||||
| <summary>Gets or sets a callback method to validate the server certificate.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Security.RemoteCertificateValidationCallback" />.A callback method to validate the server certificate.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.UnsafeAuthenticatedConnectionSharing"> | |||||
| <summary>Gets or sets a value that indicates whether to allow high-speed NTLM-authenticated connection sharing.</summary> | |||||
| <returns>Returns <see cref="T:System.Boolean" />.true to keep the authenticated connection open; otherwise, false.</returns> | |||||
| </member> | |||||
| </members> | |||||
| </doc> | |||||
| @@ -0,0 +1,11 @@ | |||||
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |||||
| <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> | |||||
| <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> | |||||
| <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | |||||
| <security> | |||||
| <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | |||||
| <requestedExecutionLevel level="asInvoker" uiAccess="false"/> | |||||
| </requestedPrivileges> | |||||
| </security> | |||||
| </trustInfo> | |||||
| </assembly> | |||||
| @@ -0,0 +1,26 @@ | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\acc_pgsql.exe | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\acc_pgsql.pdb | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\obj\x86\Debug\acc_pgsql.exe | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\obj\x86\Debug\acc_pgsql.pdb | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\obj\x86\Debug\acc_pgsql.csprojResolveAssemblyReference.cache | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\Microsoft.Web.XmlTransform.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\Mono.Security.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\Newtonsoft.Json.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\Npgsql.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\NuGet.Core.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\Renci.SshNet.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\System.Net.Http.Formatting.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\System.Net.Http.WebRequest.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\System.Net.Http.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\Newtonsoft.Json.xml | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\Npgsql.xml | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\Renci.SshNet.xml | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\System.Net.Http.Formatting.xml | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\System.Net.Http.WebRequest.xml | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\System.Net.Http.xml | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\de\Npgsql.resources.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\es\Npgsql.resources.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\fi\Npgsql.resources.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\fr\Npgsql.resources.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\ja\Npgsql.resources.dll | |||||
| C:\dspec\datamigrate\migrate_data\acc_pgsql\bin\Debug\zh-CN\Npgsql.resources.dll | |||||
| @@ -0,0 +1,26 @@ | |||||
| | |||||
| Microsoft Visual Studio Solution File, Format Version 11.00 | |||||
| # Visual Studio 2010 | |||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "migrate_data", "migrate_data\migrate_data.csproj", "{D6163919-3063-4FC2-9C9B-3A1474D0B93F}" | |||||
| EndProject | |||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "acc_pgsql", "acc_pgsql\acc_pgsql.csproj", "{5F9533DE-6CC6-4131-A85C-203ECFB92FBE}" | |||||
| EndProject | |||||
| Global | |||||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||||
| Debug|x86 = Debug|x86 | |||||
| Release|x86 = Release|x86 | |||||
| EndGlobalSection | |||||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | |||||
| {D6163919-3063-4FC2-9C9B-3A1474D0B93F}.Debug|x86.ActiveCfg = Debug|x86 | |||||
| {D6163919-3063-4FC2-9C9B-3A1474D0B93F}.Debug|x86.Build.0 = Debug|x86 | |||||
| {D6163919-3063-4FC2-9C9B-3A1474D0B93F}.Release|x86.ActiveCfg = Release|x86 | |||||
| {D6163919-3063-4FC2-9C9B-3A1474D0B93F}.Release|x86.Build.0 = Release|x86 | |||||
| {5F9533DE-6CC6-4131-A85C-203ECFB92FBE}.Debug|x86.ActiveCfg = Debug|x86 | |||||
| {5F9533DE-6CC6-4131-A85C-203ECFB92FBE}.Debug|x86.Build.0 = Debug|x86 | |||||
| {5F9533DE-6CC6-4131-A85C-203ECFB92FBE}.Release|x86.ActiveCfg = Release|x86 | |||||
| {5F9533DE-6CC6-4131-A85C-203ECFB92FBE}.Release|x86.Build.0 = Release|x86 | |||||
| EndGlobalSection | |||||
| GlobalSection(SolutionProperties) = preSolution | |||||
| HideSolutionNode = FALSE | |||||
| EndGlobalSection | |||||
| EndGlobal | |||||
| @@ -0,0 +1,11 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| namespace migrate_data | |||||
| { | |||||
| class APIHelper | |||||
| { | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,21 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Data; | |||||
| namespace migrate_data | |||||
| { | |||||
| public class Bom | |||||
| { | |||||
| private string _sql = "Insert Into z_bom(dspecId, old, [new], partNumber, viewLocation) values({0}, '{1}', '{2}', '{3}', '{4}')"; | |||||
| public string InsertStatement(DataRow row) | |||||
| { | |||||
| return string.Format(_sql, row.ItemArray[0].ToString().Replace("'", ""), row.ItemArray[1].ToString().Replace("'", ""), row.ItemArray[2].ToString().Replace("'", ""), row.ItemArray[3].ToString().Replace("'", ""), row.ItemArray[4].ToString().Replace("'", "")); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,174 @@ | |||||
| namespace migrate_data | |||||
| { | |||||
| partial class Form1 | |||||
| { | |||||
| /// <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.btn_FetchParts = new System.Windows.Forms.Button(); | |||||
| this.button1 = new System.Windows.Forms.Button(); | |||||
| this.txt_Success = new System.Windows.Forms.TextBox(); | |||||
| this.txt_fail = new System.Windows.Forms.TextBox(); | |||||
| this.label1 = new System.Windows.Forms.Label(); | |||||
| this.label2 = new System.Windows.Forms.Label(); | |||||
| this.btn_mspec = new System.Windows.Forms.Button(); | |||||
| this.button2 = new System.Windows.Forms.Button(); | |||||
| this.button3 = new System.Windows.Forms.Button(); | |||||
| this.button4 = new System.Windows.Forms.Button(); | |||||
| this.SuspendLayout(); | |||||
| // | |||||
| // btn_FetchParts | |||||
| // | |||||
| this.btn_FetchParts.Location = new System.Drawing.Point(12, 12); | |||||
| this.btn_FetchParts.Name = "btn_FetchParts"; | |||||
| this.btn_FetchParts.Size = new System.Drawing.Size(304, 56); | |||||
| this.btn_FetchParts.TabIndex = 4; | |||||
| this.btn_FetchParts.Text = "Fetch Parts(Step 1)"; | |||||
| this.btn_FetchParts.UseVisualStyleBackColor = true; | |||||
| this.btn_FetchParts.Click += new System.EventHandler(this.btn_FetchParts_Click); | |||||
| // | |||||
| // button1 | |||||
| // | |||||
| this.button1.Location = new System.Drawing.Point(12, 101); | |||||
| this.button1.Name = "button1"; | |||||
| this.button1.Size = new System.Drawing.Size(304, 56); | |||||
| this.button1.TabIndex = 5; | |||||
| this.button1.Text = "Fix g Numbs(Step 2)"; | |||||
| this.button1.UseVisualStyleBackColor = true; | |||||
| this.button1.Click += new System.EventHandler(this.button1_Click); | |||||
| // | |||||
| // txt_Success | |||||
| // | |||||
| this.txt_Success.Location = new System.Drawing.Point(354, 54); | |||||
| this.txt_Success.Multiline = true; | |||||
| this.txt_Success.Name = "txt_Success"; | |||||
| this.txt_Success.Size = new System.Drawing.Size(676, 813); | |||||
| this.txt_Success.TabIndex = 6; | |||||
| // | |||||
| // txt_fail | |||||
| // | |||||
| this.txt_fail.Location = new System.Drawing.Point(1072, 54); | |||||
| this.txt_fail.Multiline = true; | |||||
| this.txt_fail.Name = "txt_fail"; | |||||
| this.txt_fail.Size = new System.Drawing.Size(676, 813); | |||||
| this.txt_fail.TabIndex = 7; | |||||
| // | |||||
| // label1 | |||||
| // | |||||
| this.label1.AutoSize = true; | |||||
| this.label1.Location = new System.Drawing.Point(566, 12); | |||||
| this.label1.Name = "label1"; | |||||
| this.label1.Size = new System.Drawing.Size(94, 25); | |||||
| this.label1.TabIndex = 8; | |||||
| this.label1.Text = "Success"; | |||||
| // | |||||
| // label2 | |||||
| // | |||||
| this.label2.AutoSize = true; | |||||
| this.label2.Location = new System.Drawing.Point(1381, 12); | |||||
| this.label2.Name = "label2"; | |||||
| this.label2.Size = new System.Drawing.Size(78, 25); | |||||
| this.label2.TabIndex = 9; | |||||
| this.label2.Text = "Failure"; | |||||
| // | |||||
| // btn_mspec | |||||
| // | |||||
| this.btn_mspec.Location = new System.Drawing.Point(12, 191); | |||||
| this.btn_mspec.Name = "btn_mspec"; | |||||
| this.btn_mspec.Size = new System.Drawing.Size(304, 63); | |||||
| this.btn_mspec.TabIndex = 10; | |||||
| this.btn_mspec.Text = "Fix m Numbers(Step 3)"; | |||||
| this.btn_mspec.UseVisualStyleBackColor = true; | |||||
| this.btn_mspec.Click += new System.EventHandler(this.btn_mspec_Click); | |||||
| // | |||||
| // button2 | |||||
| // | |||||
| this.button2.Location = new System.Drawing.Point(12, 287); | |||||
| this.button2.Name = "button2"; | |||||
| this.button2.Size = new System.Drawing.Size(304, 63); | |||||
| this.button2.TabIndex = 11; | |||||
| this.button2.Text = "Fix BOM(Step 4)"; | |||||
| this.button2.UseVisualStyleBackColor = true; | |||||
| this.button2.Click += new System.EventHandler(this.button2_Click); | |||||
| // | |||||
| // button3 | |||||
| // | |||||
| this.button3.Location = new System.Drawing.Point(12, 373); | |||||
| this.button3.Name = "button3"; | |||||
| this.button3.Size = new System.Drawing.Size(304, 63); | |||||
| this.button3.TabIndex = 12; | |||||
| this.button3.Text = "Generate Postgres SQL file (Step 5)"; | |||||
| this.button3.UseVisualStyleBackColor = true; | |||||
| this.button3.Click += new System.EventHandler(this.button3_Click); | |||||
| // | |||||
| // button4 | |||||
| // | |||||
| this.button4.Location = new System.Drawing.Point(12, 470); | |||||
| this.button4.Name = "button4"; | |||||
| this.button4.Size = new System.Drawing.Size(304, 55); | |||||
| this.button4.TabIndex = 13; | |||||
| this.button4.Text = "button4"; | |||||
| this.button4.UseVisualStyleBackColor = true; | |||||
| this.button4.Click += new System.EventHandler(this.button4_Click); | |||||
| // | |||||
| // Form1 | |||||
| // | |||||
| this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); | |||||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||||
| this.ClientSize = new System.Drawing.Size(1797, 904); | |||||
| this.Controls.Add(this.button4); | |||||
| this.Controls.Add(this.button3); | |||||
| this.Controls.Add(this.button2); | |||||
| this.Controls.Add(this.btn_mspec); | |||||
| this.Controls.Add(this.label2); | |||||
| this.Controls.Add(this.label1); | |||||
| this.Controls.Add(this.txt_fail); | |||||
| this.Controls.Add(this.txt_Success); | |||||
| this.Controls.Add(this.button1); | |||||
| this.Controls.Add(this.btn_FetchParts); | |||||
| this.Name = "Form1"; | |||||
| this.Text = "Form1"; | |||||
| this.Load += new System.EventHandler(this.Form1_Load); | |||||
| this.ResumeLayout(false); | |||||
| this.PerformLayout(); | |||||
| } | |||||
| #endregion | |||||
| private System.Windows.Forms.Button btn_FetchParts; | |||||
| private System.Windows.Forms.Button button1; | |||||
| private System.Windows.Forms.TextBox txt_Success; | |||||
| private System.Windows.Forms.TextBox txt_fail; | |||||
| private System.Windows.Forms.Label label1; | |||||
| private System.Windows.Forms.Label label2; | |||||
| private System.Windows.Forms.Button btn_mspec; | |||||
| private System.Windows.Forms.Button button2; | |||||
| private System.Windows.Forms.Button button3; | |||||
| private System.Windows.Forms.Button button4; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,464 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.ComponentModel; | |||||
| using System.Data; | |||||
| using System.Data.OleDb; | |||||
| using System.Data.SqlClient; | |||||
| using System.Drawing; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Windows.Forms; | |||||
| using System.Reflection; | |||||
| using System.IO; | |||||
| namespace migrate_data | |||||
| { | |||||
| enum dbtype | |||||
| { | |||||
| OLEDB = 1, | |||||
| SQLDB = 2 | |||||
| } | |||||
| public partial class Form1 : Form | |||||
| { | |||||
| string ACCESS_CONN = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\dspec\\RPM-97.mdb;User Id=admin;Password=;"; | |||||
| string SQL_CONN = "Data Source=RPM-APP.prelub.com;Initial Catalog=access;Persist Security Info=True;User ID=mobilepmuser;Password=data4techs;"; | |||||
| //string SQL_CONN = "Server=RPM-APP.prelub.com;Database=access;Username=mobilepmuser;Password=data4techs;"; | |||||
| string SQL_Tables = "SELECT name FROM SYSOBJECTS WHERE xtype = 'U'"; | |||||
| private DataSet data = new DataSet(); | |||||
| public Form1() | |||||
| { | |||||
| InitializeComponent(); | |||||
| } | |||||
| private object SqlInsert(dbtype db, string sql) | |||||
| { | |||||
| object obj = new object(); | |||||
| switch (db) | |||||
| { | |||||
| case dbtype.OLEDB: | |||||
| using (OleDbConnection conn = new OleDbConnection(ACCESS_CONN)) | |||||
| { | |||||
| conn.Open(); | |||||
| OleDbCommand cmd = new OleDbCommand(sql); | |||||
| cmd.Connection = conn; | |||||
| obj = cmd.ExecuteNonQuery(); | |||||
| conn.Close(); | |||||
| conn.Dispose(); | |||||
| } | |||||
| return obj; | |||||
| case dbtype.SQLDB: | |||||
| using (SqlConnection sqlconn = new SqlConnection(SQL_CONN)) | |||||
| { | |||||
| sqlconn.Open(); | |||||
| SqlCommand sqlcmd = new SqlCommand(sql); | |||||
| sqlcmd.Connection = sqlconn; | |||||
| sqlcmd.CommandType = CommandType.Text; | |||||
| obj = sqlcmd.ExecuteNonQuery(); | |||||
| sqlconn.Close(); | |||||
| sqlconn.Dispose(); | |||||
| } | |||||
| return obj; | |||||
| default: | |||||
| return obj; | |||||
| } | |||||
| } | |||||
| private object getval(dbtype db, string sql) | |||||
| { | |||||
| object obj = new object(); | |||||
| switch (db) | |||||
| { | |||||
| case dbtype.OLEDB: | |||||
| using (OleDbConnection conn = new OleDbConnection(ACCESS_CONN)) | |||||
| { | |||||
| conn.Open(); | |||||
| OleDbCommand cmd = new OleDbCommand(sql); | |||||
| cmd.Connection = conn; | |||||
| obj = cmd.ExecuteScalar(); | |||||
| conn.Close(); | |||||
| conn.Dispose(); | |||||
| } | |||||
| return obj; | |||||
| case dbtype.SQLDB: | |||||
| using (SqlConnection sqlconn = new SqlConnection(SQL_CONN)) | |||||
| { | |||||
| sqlconn.Open(); | |||||
| SqlCommand sqlcmd = new SqlCommand(sql); | |||||
| sqlcmd.Connection = sqlconn; | |||||
| sqlcmd.CommandType = CommandType.Text; | |||||
| obj = sqlcmd.ExecuteScalar(); | |||||
| sqlconn.Close(); | |||||
| sqlconn.Dispose(); | |||||
| } | |||||
| return obj; | |||||
| default: | |||||
| return obj; | |||||
| } | |||||
| } | |||||
| private DataSet getdata(dbtype db, string sql) | |||||
| { | |||||
| DataSet ds = new DataSet(); | |||||
| switch (db) | |||||
| { | |||||
| case dbtype.OLEDB: | |||||
| using (OleDbConnection conn = new OleDbConnection(ACCESS_CONN)) | |||||
| { | |||||
| DataTable tble = new DataTable(); | |||||
| conn.Open(); | |||||
| OleDbCommand cmd = new OleDbCommand(sql); | |||||
| cmd.Connection = conn; | |||||
| OleDbDataAdapter adapter = new OleDbDataAdapter(cmd); | |||||
| adapter.Fill(tble); | |||||
| ds.Tables.Add(tble); | |||||
| conn.Close(); | |||||
| conn.Dispose(); | |||||
| } | |||||
| return ds; | |||||
| case dbtype.SQLDB: | |||||
| using (SqlConnection sqlconn = new SqlConnection(SQL_CONN)) | |||||
| { | |||||
| sqlconn.Open(); | |||||
| SqlCommand sqlcmd = new SqlCommand(sql); | |||||
| sqlcmd.Connection = sqlconn; | |||||
| sqlcmd.CommandType = CommandType.Text; | |||||
| SqlDataAdapter sqladapter = new SqlDataAdapter(sqlcmd); | |||||
| sqladapter.Fill(ds); | |||||
| sqlconn.Close(); | |||||
| sqlconn.Dispose(); | |||||
| } | |||||
| return ds; | |||||
| default: | |||||
| return ds; | |||||
| } | |||||
| } | |||||
| private void Form1_Load(object sender, EventArgs e) | |||||
| { | |||||
| //DataTable schema = null; | |||||
| //DataSet ds_sqltables = getdata(dbtype.SQLDB, SQL_Tables); | |||||
| //cb_sqltables.DataSource = ds_sqltables.Tables[0]; | |||||
| //cb_sqltables.DisplayMember = ds_sqltables.Tables[0].Columns[0].ColumnName; | |||||
| //cb_sqltables.ValueMember = ds_sqltables.Tables[0].Columns[0].ColumnName; | |||||
| //using (OleDbConnection conn = new OleDbConnection(ACCESS_CONN)) | |||||
| //{ | |||||
| // conn.Open(); | |||||
| // schema = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); | |||||
| // //dg_data.DataSource = schema; | |||||
| // cb_tables.DataSource = schema; | |||||
| // cb_tables.DisplayMember = "TABLE_NAME"; | |||||
| // cb_tables.ValueMember = "TABLE_NAME"; | |||||
| // conn.Close(); | |||||
| // conn.Dispose(); | |||||
| //} | |||||
| } | |||||
| //private void btn_fetch_Click(object sender, EventArgs e) | |||||
| //{ | |||||
| // using (OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\dspec\\db.mdb;User Id=admin;Password=;")) | |||||
| // { | |||||
| // DataTable schema = null; | |||||
| // DataSet ds = new DataSet(); | |||||
| // conn.Open(); | |||||
| // OleDbCommand cmd = new OleDbCommand(string.Format("select * from {0}", cb_tables.SelectedValue.ToString())); | |||||
| // cmd.Connection = conn; | |||||
| // cmd.CommandType = CommandType.Text; | |||||
| // OleDbDataAdapter adapter = new OleDbDataAdapter(cmd); | |||||
| // adapter.Fill(ds); | |||||
| // dg_data.DataSource = ds.Tables[0]; | |||||
| // cb_tables.DataSource = schema; | |||||
| // cb_tables.DisplayMember = "TABLE_NAME"; | |||||
| // cb_tables.ValueMember = "TABLE_NAME"; | |||||
| // } | |||||
| //} | |||||
| public class MyObj | |||||
| { | |||||
| public MyObj() { } | |||||
| public MyObj(string strdate, int MyInt, string strError) | |||||
| { | |||||
| date = strdate; | |||||
| myid = MyInt; | |||||
| error = strError; | |||||
| } | |||||
| public string date { get; set; } | |||||
| public int myid { get; set; } | |||||
| public string error { get; set; } | |||||
| } | |||||
| private void btn_FetchParts_Click(object sender, EventArgs e) | |||||
| { | |||||
| string sql = "Update z_parts set createDate = '{0}' where myid = {1}"; | |||||
| DataSet ds = getdata(dbtype.SQLDB, "Select [Date], myid from z_parts where [Date] is not null"); | |||||
| List<MyObj> list = new List<MyObj>(); | |||||
| foreach (DataRow row in ds.Tables[0].Rows) | |||||
| { | |||||
| string val = row.ItemArray[0].ToString(); | |||||
| try | |||||
| { | |||||
| DateTime dt = DateTime.Parse(row.ItemArray[0].ToString()); | |||||
| using (SqlConnection conn = new SqlConnection(SQL_CONN)) | |||||
| { | |||||
| conn.Open(); | |||||
| SqlCommand sqlcmd = new SqlCommand(string.Format(sql, dt, Convert.ToInt32(row.ItemArray[1]))); | |||||
| sqlcmd.Connection = conn; | |||||
| sqlcmd.CommandType = CommandType.Text; | |||||
| sqlcmd.ExecuteNonQuery(); | |||||
| conn.Close(); | |||||
| conn.Dispose(); | |||||
| } | |||||
| } | |||||
| catch (Exception ex) | |||||
| { | |||||
| list.Add(new MyObj(val, Convert.ToInt32(row.ItemArray[1]), ex.Message)); | |||||
| } | |||||
| } | |||||
| Console.Write(list.ToString()); | |||||
| } | |||||
| private struct dspec | |||||
| { | |||||
| public int id { get; set; } | |||||
| public string number { get; set; } | |||||
| public string rev { get; set; } | |||||
| public string error { get; set; } | |||||
| public string qry { get; set; } | |||||
| } | |||||
| private void button1_Click(object sender, EventArgs e) | |||||
| { | |||||
| int counter = 1; | |||||
| string sql = "select ID, [RPM Part Number], [General Design Specs].ERN as ERN from [General Design Specs] where [RPM Part Number] > 0 and ERN > -1 and ID in (10253,21872,31531,32342,36717,36277,36642,38719,39439,39822);"; | |||||
| List<DataRow> rows = new List<DataRow>(); | |||||
| List<dspec> dspecs = new List<dspec>(); | |||||
| DataSet ids = getdata(dbtype.OLEDB, sql); | |||||
| foreach (DataRow row in ids.Tables[0].Rows) | |||||
| { | |||||
| GDSpecObj obj = new GDSpecObj(); | |||||
| try | |||||
| { | |||||
| DataSet ds = getdata(dbtype.OLEDB, string.Format("select * from [General Design Specs] where ID = {0};", row.ItemArray[0])); | |||||
| foreach (DataRow r in ds.Tables[0].Rows) | |||||
| { | |||||
| rows.Add(r); | |||||
| obj.SetVals(r); | |||||
| string query = obj.ReturnQuery(); | |||||
| object retObj = SqlInsert(dbtype.SQLDB, query); | |||||
| Console.WriteLine(query); | |||||
| } | |||||
| Console.WriteLine(string.Format("{0} Success", counter)); | |||||
| } | |||||
| catch (Exception ex) | |||||
| { | |||||
| dspecs.Add(new dspec() { id = Convert.ToInt32(row.ItemArray[0]), number = row.ItemArray[1].ToString(), rev = row.ItemArray[2].ToString(), error = ex.Message, qry = obj.ReturnQuery() }); | |||||
| Console.WriteLine(string.Format("{0} Fail", counter)); | |||||
| } | |||||
| counter += 1; | |||||
| } | |||||
| StringBuilder sb = new StringBuilder(); | |||||
| foreach (dspec d in dspecs) | |||||
| { | |||||
| sb.AppendLine(string.Format("\"{0}\", \"{1}\", \"{2}\", \"{3}\"", d.id.ToString(), d.number.ToString(), d.rev.ToString(), d.error)); | |||||
| } | |||||
| using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"c:\dspec\errors.csv")) | |||||
| { | |||||
| file.WriteLine(sb.ToString()); // "sb" is the StringBuilder | |||||
| } | |||||
| Console.Write(dspecs.ToString()); | |||||
| } | |||||
| private void btn_mspec_Click(object sender, EventArgs e) | |||||
| { | |||||
| string query = string.Empty; | |||||
| StringBuilder success = new StringBuilder(); | |||||
| StringBuilder fail = new StringBuilder(); | |||||
| int counter = 1; | |||||
| string sql = "select ID, [RPM Part Number], [Motor Specs].ERN as ERN from [Motor Specs] WHERE [RPM Part Number] > -1 and [Motor Specs].ERN > -1 and [Motor Specs].ID in (1712,1666,1675,1679,1688,1690,1692,1697,1698) ;"; | |||||
| List<DataRow> rows = new List<DataRow>(); | |||||
| List<dspec> dspecs = new List<dspec>(); | |||||
| DataSet ids = getdata(dbtype.OLEDB, sql); | |||||
| foreach (DataRow row in ids.Tables[0].Rows) | |||||
| { | |||||
| MDspecObj obj = new MDspecObj(); | |||||
| try | |||||
| { | |||||
| DataSet ds = getdata(dbtype.OLEDB, string.Format("select * from [Motor Specs] where ID = {0};", row.ItemArray[0])); | |||||
| foreach (DataRow r in ds.Tables[0].Rows) | |||||
| { | |||||
| obj.SetVals(r); | |||||
| query = obj.Qry(); | |||||
| object retObj = SqlInsert(dbtype.SQLDB, query); | |||||
| string successMsg = string.Format("Try #: {0} Success for Part#: {1}, ID={2}", counter, row.ItemArray[1], row.ItemArray[0]); | |||||
| success.AppendLine(successMsg); | |||||
| txt_Success.Text = success.ToString(); | |||||
| Console.WriteLine(successMsg); | |||||
| counter += 1; | |||||
| } | |||||
| } | |||||
| catch (Exception ex) | |||||
| { | |||||
| string failMsg = string.Format("Try #: {0} Failed for Part#: {1}, ID={2}, ERROR: {3}", counter, row.ItemArray[1], row.ItemArray[0], ex.Message); | |||||
| fail.AppendLine(failMsg); | |||||
| txt_fail.Text = fail.ToString(); | |||||
| Console.WriteLine(failMsg); | |||||
| counter += 1; | |||||
| } | |||||
| } | |||||
| } | |||||
| struct fieldinfo | |||||
| { | |||||
| public string name { get; set; } | |||||
| public Type type { get; set; } | |||||
| } | |||||
| private void button2_Click(object sender, EventArgs e) | |||||
| { | |||||
| StringBuilder errors = new StringBuilder(); | |||||
| DateTime start, finish; | |||||
| start = DateTime.Now; | |||||
| int counter = 1; | |||||
| string msg = "Try: {0}, Status: {1}, index{2}"; | |||||
| Bom bom = new Bom(); | |||||
| string sql = "select * from BOM where ID is not null;"; | |||||
| DataSet ds = getdata(dbtype.OLEDB, sql); | |||||
| Console.WriteLine(start); | |||||
| for(int i = 0; i < ds.Tables[0].Rows.Count; i++) | |||||
| { | |||||
| try | |||||
| { | |||||
| sql = bom.InsertStatement(ds.Tables[0].Rows[i]); | |||||
| SqlInsert(dbtype.SQLDB, sql); | |||||
| Console.WriteLine(string.Format(msg, counter, "success", i)); | |||||
| } | |||||
| catch (Exception ex) | |||||
| { | |||||
| Console.WriteLine(string.Format(msg, counter, "fail: " + ex.Message, i)); | |||||
| errors.AppendLine(string.Format(msg, counter, "fail: " + ex.Message, i) + " " + sql); | |||||
| } | |||||
| } | |||||
| finish = DateTime.Now; | |||||
| Console.WriteLine(errors.ToString()); | |||||
| Console.WriteLine("Started: " + start + " finished: " + finish); | |||||
| } | |||||
| private void button3_Click(object sender, EventArgs e) | |||||
| { | |||||
| string sql = "select 'Insert Into \"Bom\"(\"old\", \"new\", \"partNumberId\", \"viewLocationId\", \"designSpecId\", \"createDate\", \"createUserId\", \"updateDate\", \"updateUserId\")' + 'values(' " | |||||
| + "+ case when b.[old] IS null then 'null' else '''' + b.[old] + '''' end + ', ' " | |||||
| + "+ case when b.[new] IS null then 'null' else '''' + b.[new] + '''' end + ', ' " | |||||
| + "+ case when b.[partId] IS null then 'null' else cast(b.[partId] as varchar(50)) end + ', ' " | |||||
| + "+ case when b.[viewLocationId] IS null then 'null' else cast(b.[viewLocationId] as varchar(50)) end + ', '" | |||||
| + "+ case when b.[dspecId] IS null then 'null' else cast(b.[dspecId] as varchar(50)) end " | |||||
| + "+ ', now(), -1, now(), -1);' " | |||||
| + " from z_bom b" | |||||
| + " inner join tempdspec gd on gd.id = b.dspecId"; | |||||
| string basePath = "\\\\192.168.0.220\\mcarman\\dspec\\boms\\insertboms{0}.sql"; | |||||
| int batch = 1; | |||||
| string myfile = string.Format(basePath, batch); | |||||
| DataSet sqlDs = getdata(dbtype.SQLDB, sql); | |||||
| int counter = 1; | |||||
| Console.WriteLine(string.Format("Batch: {0}", batch)); | |||||
| foreach (DataRow row in sqlDs.Tables[0].Rows) | |||||
| { | |||||
| if (counter > 25000) | |||||
| { | |||||
| counter = 1; | |||||
| batch = batch + 1; | |||||
| myfile = string.Format(basePath, batch); | |||||
| Console.WriteLine(string.Format("Batch: {0}", batch)); | |||||
| } | |||||
| using (StreamWriter sw = File.AppendText(myfile)) | |||||
| { | |||||
| sw.WriteLine(row.ItemArray[0].ToString()); | |||||
| Console.Write(string.Format("Counter: {0};", counter)); | |||||
| } | |||||
| counter += 1; | |||||
| } | |||||
| } | |||||
| /* | |||||
| Index: 0, Name: RPM Part Number | |||||
| Index: 1, Name: Customer cust | |||||
| Index: 2, Name: Customer Part Number custpn | |||||
| Index: 3, Name: Primary Vendor pvend | |||||
| Index: 4, Name: Primary Vendor Part # pvendpn | |||||
| Index: 5, Name: Secondary Vendor secvend | |||||
| Index: 6, Name: Secondary Vendor Part # secvendpn | |||||
| Index: 7, Name: RPM PART UNFIN rpmptunfin | |||||
| Index: 8, Name: DELCO PART UNFIN delcoptunfin | |||||
| Index: 9, Name: DELCO PART FIN delcoptfin | |||||
| Index: 10, Name: CAT PART catpt | |||||
| Index: 11, Name: CUM PART cumpt | |||||
| Index: 12, Name: D R PART drpt | |||||
| Index: 13, Name: DDC PART ddcpt | |||||
| Index: 14, Name: PARKER PART parkerpt | |||||
| Index: 15, Name: Parker Part Description parkerptdescription | |||||
| Index: 16, Name: Komatsu Part komatsupt | |||||
| Index: 17, Name: OTHER PART otherpt | |||||
| */ | |||||
| private void button4_Click(object sender, EventArgs e) | |||||
| { | |||||
| List<string> list = new List<string>(); | |||||
| string accesssql = "SELECT [Part Numbers].[RPM Part Number], [Part Numbers].Customer, [Part Numbers].[Customer Part Number], [Part Numbers].[Primary Vendor], [Part Numbers].[Primary Vendor Part #], [Part Numbers].[Secondary Vendor], [Part Numbers].[Secondary Vendor Part #], [Part Numbers].[RPM PART UNFIN], [Part Numbers].[DELCO PART UNFIN], [Part Numbers].[DELCO PART FIN], [Part Numbers].[CAT PART], [Part Numbers].[CUM PART], [Part Numbers].[D R PART], [Part Numbers].[DDC PART], [Part Numbers].[PARKER PART], [Part Numbers].[Parker Part Description], [Part Numbers].[Komatsu Part], [Part Numbers].[OTHER PART] FROM [Part Numbers];"; | |||||
| DataTable accesstable = getdata(dbtype.OLEDB, accesssql).Tables[0]; | |||||
| string pgsql = "Update \"PartNumber\" set \"cust\" = {0}, \"custpn\" = {1}, \"pvend\" = {2}, \"pvendpn\" = {3}, \"secvend\" = {4}, \"secvendpn\" = {5}, \"rpmptunfin\" = {6}, \"delcoptunfin\" = {7}, \"delcoptfin\" = {8}, \"catpt\" = {9}, \"cumpt\" = {10}, \"drpt\" = {11}, \"ddcpt\" = {12}, \"parkerpt\" = {13}, \"pakerptdescription\" = {14}, \"komatsupt\" = {15}, \"otherpt\" = {16} where \"partNumber1\" = '{17}';"; | |||||
| for (int i = 0; i < accesstable.Rows.Count; i++) | |||||
| { | |||||
| DataRow row = accesstable.Rows[i]; | |||||
| string sql = string.Format(pgsql | |||||
| , row.ItemArray[1].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[1].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[2].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[2].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[3].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[3].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[4].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[4].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[5].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[5].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[6].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[6].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[7].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[7].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[8].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[8].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[9].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[9].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[10].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[10].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[11].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[11].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[12].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[12].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[13].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[13].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[14].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[14].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[15].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[15].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[16].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[16].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[17].ToString().Trim().Length == 0 ? "null" : "'" + row.ItemArray[17].ToString().Trim().Replace("'", "") + "'" | |||||
| , row.ItemArray[0].ToString().Trim().Length == 0 ? "null" : row.ItemArray[0].ToString().Trim()); | |||||
| list.Add(sql); | |||||
| } | |||||
| string pathtonewfile = @"\\NAS35939B.prelub.com\mcarman\Access_to_Postgres_sql_files\UpdatePartNumbers.sql"; | |||||
| string newsqlfile = string.Join("\r\n", list); | |||||
| using (StreamWriter output = new StreamWriter(pathtonewfile)) | |||||
| { | |||||
| foreach (string line in list) | |||||
| output.WriteLine(line); | |||||
| } | |||||
| //Insert Statement read into string list | |||||
| string sqlFile = @"\\NAS35939B.prelub.com\mcarman\Access_to_Postgres_sql_files\XCustomerParts.sql"; | |||||
| string sqlTxt = File.ReadAllText(sqlFile); | |||||
| Console.WriteLine(sqlTxt); | |||||
| list.Add(sqlTxt); | |||||
| PGHelper helper = new PGHelper(); | |||||
| helper.MakeSSHTunnel("pn", list); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -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> | |||||
| @@ -0,0 +1,105 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Data; | |||||
| namespace migrate_data | |||||
| { | |||||
| public class GDSpecObj | |||||
| { | |||||
| private string gDspecInsert = "insert into z_gdspec(ID, [RPM Part Number], ERN, Application, Notes, Signed, [Date Signed], Checked, [Date Checked], [Effective Date], Obsolete, [Reason for change], [Work Instruction], [Customer Notification], [FAC Required], [FAC Completed], Validation, Replaces) values({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17})"; | |||||
| public string ReturnQuery() | |||||
| { | |||||
| string signedD, chkD, effectiveD; | |||||
| if (this.datesigned == null) signedD = string.Format("null"); | |||||
| else signedD = string.Format("'{0}'", this.datesigned); | |||||
| if (this.chkdate == null) chkD = string.Format("null"); | |||||
| else chkD = string.Format("'{0}'", this.chkdate); | |||||
| if (this.effectivedate == null) effectiveD = string.Format("null"); | |||||
| else effectiveD = string.Format("'{0}'", effectivedate); | |||||
| return string.Format(gDspecInsert | |||||
| , this.id | |||||
| , this.number | |||||
| , this.ern | |||||
| , this.app | |||||
| , this.notes | |||||
| , this.signed | |||||
| , signedD | |||||
| , this.chkd | |||||
| , chkD | |||||
| , effectiveD | |||||
| , this.obsolete | |||||
| , this.rsfc | |||||
| , this.wrkinst | |||||
| , this.custnot | |||||
| , this.facreq | |||||
| , this.faccomp | |||||
| , this.valid | |||||
| , this.replaces); | |||||
| } | |||||
| public int id { get; set; } | |||||
| public string number{get;set;} | |||||
| public string ern { get; set; } | |||||
| public string app { get; set; } | |||||
| public string notes { get; set; } | |||||
| public string signed { get; set; } | |||||
| public DateTime? datesigned { get; set; } | |||||
| public string chkd { get; set; } | |||||
| public DateTime? chkdate { get; set; } | |||||
| public DateTime? effectivedate { get; set; } | |||||
| public int obsolete { get; set; } | |||||
| public string rsfc { get; set; } | |||||
| public string wrkinst { get; set; } | |||||
| public int custnot { get; set; } | |||||
| public int facreq { get; set; } | |||||
| public int faccomp { get; set; } | |||||
| public string valid { get; set; } | |||||
| public string replaces { get; set; } | |||||
| public string SingleQuotes(string str) | |||||
| { | |||||
| if (string.IsNullOrEmpty(str)) | |||||
| return "null"; | |||||
| else return string.Format("'{0}'", str); | |||||
| } | |||||
| public int ConvertBit(int i) | |||||
| { | |||||
| if (i < 0) return 1; | |||||
| else return 0; | |||||
| } | |||||
| public DateTime? DateVal(string dt) | |||||
| { | |||||
| bool isValid = false; | |||||
| DateTime date; | |||||
| isValid = DateTime.TryParse(dt, out date); | |||||
| if (isValid) return date; | |||||
| else return null; | |||||
| } | |||||
| public void SetVals(DataRow row) | |||||
| { | |||||
| this.id = Convert.ToInt32(row.ItemArray[0]); | |||||
| this.number = SingleQuotes(row.ItemArray[1].ToString()); | |||||
| this.ern = SingleQuotes(row.ItemArray[2].ToString().Replace("'", "")); | |||||
| this.app = SingleQuotes(row.ItemArray[4].ToString().Replace("'", "")); | |||||
| this.replaces = SingleQuotes(row.ItemArray[3].ToString().Replace("'", "")); | |||||
| this.notes = SingleQuotes(row.ItemArray[5].ToString().Replace("'", "")); | |||||
| this.signed = SingleQuotes(row.ItemArray[6].ToString().Replace("'", "")); | |||||
| this.datesigned = DateVal(row.ItemArray[7].ToString()); | |||||
| this.chkd = SingleQuotes(row.ItemArray[8].ToString().Replace("'", "")); | |||||
| this.chkdate = DateVal(row.ItemArray[9].ToString()); | |||||
| this.effectivedate = DateVal(row.ItemArray[10].ToString()); | |||||
| this.obsolete = ConvertBit(Convert.ToInt32(row.ItemArray[11])); | |||||
| this.rsfc = SingleQuotes(row.ItemArray[12].ToString().Replace("'", "")); | |||||
| this.wrkinst = SingleQuotes(row.ItemArray[13].ToString().Replace("'", "")); | |||||
| this.custnot = ConvertBit(Convert.ToInt32(row.ItemArray[14])); | |||||
| this.facreq = ConvertBit(Convert.ToInt32(row.ItemArray[15])); | |||||
| this.faccomp = ConvertBit(Convert.ToInt32(row.ItemArray[16])); | |||||
| this.valid = SingleQuotes(row.ItemArray[17].ToString().Replace("'", "")); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,235 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Data; | |||||
| namespace migrate_data | |||||
| { | |||||
| public class MDspecObj | |||||
| { | |||||
| private string mDspecInsert = "Insert Into z_mdspec(ID, [RPM Part Number], [ERN], [Replaces], [Application], [OE/Reman], [Basic Class], [Status], [Same As], [Except], [Make From], [Float], [Volts], [Rot], [TermP], [Drive], [Pinion], [Pitch], [Switch], [SwP], [HO], [SAE], [MtgH], [FTF], [Opening], [Treatment], [Curve], [Remarks], [JSP], [Suction Port], [Pressure Port], [Suction Fitting], [Pressure Fitting], [Additional Parts], [Gasket], [Change], [Service Type], [Notes], [Service Replacement Ref], [SRR Except], [Metal Tag], [Tag Number], [Paper Tag], [Other Tag], [Signed], [Date Signed], [Checked], [Date Checked], [Effective Date], [Obsolete], [Box], [Reason for change], [Work Instruction], [PLRV], [Bracket], [RTV], [Hz], [Weight], [FAC Required], [FAC Completed], [Validation])" | |||||
| + "values({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {20}, {21}, {22}, {23}, {24}, {25}, {26}, {27}, {28}, {29}, {30}, {31}, {32}, {33}, {34}, {35}, {36}, {37}, {38}, {39}, {40}, {41}, {42}, {43}, {44}, {45}, {46}, {47}, {48}, {49}, {50}, {51}, {52}, {53}, {54}, {55}, {56}, {57}, {58}, {59}, {60})"; | |||||
| #region Properties | |||||
| public int id { get; set; }//0 | |||||
| public string number { get; set; }//1 | |||||
| public string ern { get; set; }//2 | |||||
| public string replaces { get; set; }//3 | |||||
| public string application { get; set; }//4 | |||||
| public string oereman { get; set; }//5 | |||||
| public string basicclass { get; set; }//6 | |||||
| public string status { get; set; }//7 | |||||
| public string sameas { get; set; }//8 | |||||
| public string except { get; set; }//9 | |||||
| public string makefrom { get; set; }//10 | |||||
| public string floatStr { get; set; }//11 | |||||
| public string volts { get; set; }//12 | |||||
| public string rot { get; set; }//13 | |||||
| public string termp { get; set; }//14 | |||||
| public string drive { get; set; }//15 | |||||
| public string pinion { get; set; }//16 | |||||
| public string pitch { get; set; }//17 | |||||
| public string swtch { get; set; }//18 | |||||
| public string swp { get; set; }//19 | |||||
| public string ho { get; set; }//20 | |||||
| public string sae { get; set; }//21 | |||||
| public string mtgh { get; set; }//22 | |||||
| public string ftf { get; set; }//23 | |||||
| public string opening { get; set; }//24 | |||||
| public string treatment { get; set; }//25 | |||||
| public string curve { get; set; }//26 | |||||
| public string remarks { get; set; }//27 | |||||
| public int? jsp { get; set; }//28 | |||||
| public string suctionport { get; set; }//29 | |||||
| public string pressureport { get; set; }//30 | |||||
| public string suctionfitting { get; set; }//31 | |||||
| public string pressurefitting { get; set; }//32 | |||||
| public string additionalparts { get; set; }//33 | |||||
| public string gasket { get; set; }//34 | |||||
| public int? change { get; set; }//35 | |||||
| public string servicetype { get; set; }//36 | |||||
| public string notes { get; set; }//37 | |||||
| public string servicereplacementref { get; set; }//38 | |||||
| public string srrexcept { get; set; }//39 | |||||
| public string metaltag { get; set; }//40 | |||||
| public string tagnumber { get; set; }//41 | |||||
| public string papertag { get; set; }//42 | |||||
| public string othertag { get; set; }//43 | |||||
| public string signed { get; set; }//44 | |||||
| public DateTime? datesigned { get; set; }//45 | |||||
| public string chkd { get; set; }//46 | |||||
| public DateTime? datechecked { get; set; }//47 | |||||
| public DateTime? effectivedate { get; set; }//48 | |||||
| public int? obsolete { get; set; }//49 | |||||
| public string box { get; set; }//50 | |||||
| public string reasonforchange { get; set; }//51 | |||||
| public string workinstruction { get; set; }//52 | |||||
| public int? plrv { get; set; }//53 | |||||
| public int? bracket { get; set; }//54 | |||||
| public int? rtv { get; set; }//55 | |||||
| public string hz { get; set; }//56 | |||||
| public string weight { get; set; }//57 | |||||
| public int? facrequired { get; set; }//58 | |||||
| public int? faccompleted { get; set; }//59 | |||||
| public string validation { get; set; }//60 | |||||
| #endregion | |||||
| public string SingleQuotes(string str) | |||||
| { | |||||
| if (string.IsNullOrEmpty(str)) | |||||
| return "null"; | |||||
| else return string.Format("'{0}'", str); | |||||
| } | |||||
| public int? ConvertBit(int? i) | |||||
| { | |||||
| if (i == null) return null; | |||||
| else if (i < 0) return 1; | |||||
| else return 0; | |||||
| } | |||||
| public DateTime? DateVal(string dt) | |||||
| { | |||||
| bool isValid = false; | |||||
| DateTime date; | |||||
| isValid = DateTime.TryParse(dt, out date); | |||||
| if (isValid) return date; | |||||
| else return null; | |||||
| } | |||||
| public void SetVals(DataRow row) | |||||
| { | |||||
| int i = 0; | |||||
| this.id = Convert.ToInt32(row.ItemArray[i]); i = i + 1;//0 | |||||
| this.number = SingleQuotes(row.ItemArray[i].ToString());i = i + 1;//1 | |||||
| this.ern = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//2 | |||||
| this.replaces = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//3 | |||||
| this.application = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//4 | |||||
| this.oereman = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//5 | |||||
| this.basicclass = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//6 | |||||
| this.status = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//7 | |||||
| this.sameas = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//8 | |||||
| this.except = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//9 | |||||
| this.makefrom = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//10 | |||||
| this.floatStr = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//11 | |||||
| this.volts = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//12 | |||||
| this.rot = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//13 | |||||
| this.termp = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//14 | |||||
| this.drive = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//15 | |||||
| this.pinion = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//16 | |||||
| this.pitch = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//17 | |||||
| this.swtch = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//18 | |||||
| this.swp = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//19 | |||||
| this.ho = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//20 | |||||
| this.sae = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//21 | |||||
| this.mtgh = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//22 | |||||
| this.ftf = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//23 | |||||
| this.opening = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//24 | |||||
| this.treatment = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//25 | |||||
| this.curve = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//26 | |||||
| this.remarks = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//27 | |||||
| this.jsp = row.ItemArray[i] == DBNull.Value ? null : ConvertBit((int?)Convert.ToInt32(row.ItemArray[i])); | |||||
| i = i + 1;//28 | |||||
| this.suctionport = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//29 | |||||
| this.pressureport = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//30 | |||||
| this.suctionfitting = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//31 | |||||
| this.pressurefitting = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//32 | |||||
| this.additionalparts = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//33 | |||||
| this.gasket = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//34 | |||||
| this.change = row.ItemArray[i] == DBNull.Value ? null : ConvertBit((int?)Convert.ToInt32(row.ItemArray[i])); i = i + 1;//35 | |||||
| this.servicetype = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//36 | |||||
| this.notes = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//37 | |||||
| this.servicereplacementref = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//38 | |||||
| this.srrexcept = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//39 | |||||
| this.metaltag = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//40 | |||||
| this.tagnumber = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//41 | |||||
| this.papertag = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//42 | |||||
| this.othertag = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//43 | |||||
| this.signed = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//44 | |||||
| this.datesigned = DateVal(row.ItemArray[9].ToString()); i = i + 1;//45 | |||||
| this.chkd = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//46 | |||||
| this.datechecked = DateVal(row.ItemArray[9].ToString()); i = i + 1;//47 | |||||
| this.effectivedate = DateVal(row.ItemArray[9].ToString()); i = i + 1;//48 | |||||
| this.obsolete = row.ItemArray[i] == DBNull.Value ? null : ConvertBit((int?)Convert.ToInt32(row.ItemArray[i]));i = i + 1;//49 | |||||
| this.box = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//50 | |||||
| this.reasonforchange = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//51 | |||||
| this.workinstruction = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//52 | |||||
| this.plrv = row.ItemArray[i] == DBNull.Value ? null : ConvertBit((int?)Convert.ToInt32(row.ItemArray[i])); i = i + 1;//53 | |||||
| this.bracket = row.ItemArray[i] == DBNull.Value ? null : ConvertBit((int?)Convert.ToInt32(row.ItemArray[i])); i = i + 1;//54 | |||||
| this.rtv = row.ItemArray[i] == DBNull.Value ? null :ConvertBit((int?)Convert.ToInt32(row.ItemArray[i])); i = i + 1;//55 | |||||
| this.hz = SingleQuotes(row.ItemArray[i].ToString().Replace("'", "")); i = i + 1;//56 | |||||
| this.weight = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));i = i + 1;//57 | |||||
| this.facrequired = row.ItemArray[i] == DBNull.Value ? null : ConvertBit((int?)Convert.ToInt32(row.ItemArray[i])); i = i + 1;//58 | |||||
| this.faccompleted = row.ItemArray[i] == DBNull.Value ? null : ConvertBit((int?)Convert.ToInt32(row.ItemArray[i])); i = i + 1;//59 | |||||
| this.validation = SingleQuotes(row.ItemArray[i].ToString().Replace("'", ""));//60 | |||||
| } | |||||
| public string Qry() | |||||
| { | |||||
| return string.Format(mDspecInsert, | |||||
| this.id //0 | |||||
| , this.number//1 | |||||
| , this.ern//2 | |||||
| , this.replaces//3 | |||||
| , this.application//4 | |||||
| , this.oereman//5 | |||||
| , this.basicclass//6 | |||||
| , this.status//7 | |||||
| , this.sameas//8 | |||||
| , this.except//9 | |||||
| , this.makefrom//10 | |||||
| , this.floatStr//11 | |||||
| , this.volts//12 | |||||
| , this.rot//13 | |||||
| , this.termp//14 | |||||
| , this.drive//15 | |||||
| , this.pinion//16 | |||||
| , this.pitch//17 | |||||
| , this.swtch//18 | |||||
| , this.swp//19 | |||||
| , this.ho//20 | |||||
| , this.sae//21 | |||||
| , this.mtgh//22 | |||||
| , this.ftf//23 | |||||
| , this.opening//24 | |||||
| , this.treatment//25 | |||||
| , this.curve//26 | |||||
| , this.remarks//27 | |||||
| , this.jsp == null ? "null" : jsp.ToString()//28 | |||||
| , this.suctionport//29 | |||||
| , this.pressureport//30 | |||||
| , this.suctionfitting//31 | |||||
| , this.pressurefitting//32 | |||||
| , this.additionalparts//33 | |||||
| , this.gasket//34 | |||||
| , this.change//35 | |||||
| , this.servicetype//36 | |||||
| , this.notes//37 | |||||
| , this.servicereplacementref//38 | |||||
| , this.srrexcept//39 | |||||
| , this.metaltag//40 | |||||
| , this.tagnumber//41 | |||||
| , this.papertag//42 | |||||
| , this.othertag//43 | |||||
| , this.signed//44 | |||||
| , this.datesigned == null ? "null" : this.datesigned.ToString()//45 | |||||
| , this.chkd//46 | |||||
| , this.datechecked == null ? "null" : this.datechecked.ToString()//47 | |||||
| , this.effectivedate == null ? "null" : this.effectivedate.ToString()//48 | |||||
| , this.obsolete == null ? "null" : this.obsolete.ToString()//49 | |||||
| , this.box//50 | |||||
| , this.reasonforchange//51 | |||||
| , this.workinstruction//52 | |||||
| , this.plrv == null ? "null" : this.plrv.ToString()//53 | |||||
| , this.bracket == null ? "null" : this.bracket.ToString()//54 | |||||
| , this.rtv == null ? "null" : this.rtv.ToString()//55 | |||||
| , this.hz//56 | |||||
| , this.weight//57 | |||||
| , this.facrequired//58 | |||||
| , this.faccompleted//59 | |||||
| , this.validation//60 | |||||
| ); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,63 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using Renci.SshNet; | |||||
| using Npgsql; | |||||
| namespace migrate_data | |||||
| { | |||||
| public class PGHelper | |||||
| { | |||||
| public void MakeSSHTunnel(string tblName = null, List<string> sql = null ) | |||||
| { | |||||
| using (SshClient client = new SshClient("192.168.0.108", "mcarman", "@ng31F@rm0823262")) | |||||
| { | |||||
| int index = 0; | |||||
| client.Connect(); | |||||
| var tunnel = new ForwardedPortLocal("127.0.0.1", "127.0.0.1", 5432); | |||||
| client.AddForwardedPort(tunnel); | |||||
| if (client.IsConnected) | |||||
| { | |||||
| tunnel.Start(); | |||||
| string connString = string.Format("Server={0};Database=accessdb_v2;Port={1};User Id=mcarman;Password=@ng31F@rm0823262;", tunnel.BoundHost, tunnel.BoundPort ); | |||||
| try | |||||
| { | |||||
| using (var conn = new NpgsqlConnection(connString)) | |||||
| { | |||||
| System.Data.DataTable tbl = new System.Data.DataTable("user"); | |||||
| conn.Open(); | |||||
| NpgsqlCommand cmd = conn.CreateCommand();// new NpgsqlCommand(); | |||||
| cmd.CommandType = System.Data.CommandType.Text; | |||||
| foreach (string s in sql) | |||||
| { | |||||
| cmd.CommandText = s; | |||||
| int cmdInt = cmd.ExecuteNonQuery(); | |||||
| Console.WriteLine(string.Format("Row {0} Updatede - Command Result: {1}", index, cmdInt)); | |||||
| index += 1; | |||||
| } | |||||
| //("select * from \"User\";", conn); | |||||
| // cmd.CommandType = System.Data.CommandType.Text; | |||||
| //NpgsqlDataAdapter adapter = new NpgsqlDataAdapter(cmd); | |||||
| //adapter.Fill(tbl); | |||||
| Console.Write("Yes"); | |||||
| } | |||||
| } | |||||
| catch (Exception ex) | |||||
| { | |||||
| Console.Write(ex.Message); | |||||
| } | |||||
| } | |||||
| else Console.Write("Broken"); | |||||
| } | |||||
| } | |||||
| public void CloseSSHTunnel(SshClient client) | |||||
| { | |||||
| client.Disconnect(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,21 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Windows.Forms; | |||||
| namespace migrate_data | |||||
| { | |||||
| static class Program | |||||
| { | |||||
| /// <summary> | |||||
| /// The main entry point for the application. | |||||
| /// </summary> | |||||
| [STAThread] | |||||
| static void Main() | |||||
| { | |||||
| Application.EnableVisualStyles(); | |||||
| Application.SetCompatibleTextRenderingDefault(false); | |||||
| Application.Run(new Form1()); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -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("migrate_data")] | |||||
| [assembly: AssemblyDescription("")] | |||||
| [assembly: AssemblyConfiguration("")] | |||||
| [assembly: AssemblyCompany("")] | |||||
| [assembly: AssemblyProduct("migrate_data")] | |||||
| [assembly: AssemblyCopyright("Copyright © 2024")] | |||||
| [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("3bfc0341-3112-482c-9e3e-d03bede7983e")] | |||||
| // 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")] | |||||
| @@ -0,0 +1,71 @@ | |||||
| //------------------------------------------------------------------------------ | |||||
| // <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 migrate_data.Properties | |||||
| { | |||||
| /// <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 ((resourceMan == null)) | |||||
| { | |||||
| global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("migrate_data.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; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,117 @@ | |||||
| <?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.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: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" type="xsd:string" /> | |||||
| <xsd:attribute name="type" type="xsd:string" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" /> | |||||
| </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" msdata:Ordinal="1" /> | |||||
| <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
| </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| <resheader name="writer"> | |||||
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| </root> | |||||
| @@ -0,0 +1,30 @@ | |||||
| //------------------------------------------------------------------------------ | |||||
| // <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 migrate_data.Properties | |||||
| { | |||||
| [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] | |||||
| [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,7 @@ | |||||
| <?xml version='1.0' encoding='utf-8'?> | |||||
| <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> | |||||
| <Profiles> | |||||
| <Profile Name="(Default)" /> | |||||
| </Profiles> | |||||
| <Settings /> | |||||
| </SettingsFile> | |||||
| @@ -0,0 +1,43 @@ | |||||
| using System; | |||||
| using System.Net; | |||||
| using System.Net.Http; | |||||
| using System.Net.Http.Headers; | |||||
| using System.Threading.Tasks; | |||||
| using Newtonsoft.Json; | |||||
| using System.IO; | |||||
| namespace migrate_data | |||||
| { | |||||
| public class RESTHelper | |||||
| { | |||||
| public string restUrl; | |||||
| public void GetRequest(string url, object obj) | |||||
| { | |||||
| HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); | |||||
| request.Method = "POST"; | |||||
| request.ContentType = "application/json"; | |||||
| string json = JsonConvert.SerializeObject(obj); | |||||
| request.ContentLength = json.Length; | |||||
| StreamWriter requestWriter = new StreamWriter(request.GetRequestStream(), System.Text.Encoding.ASCII); | |||||
| requestWriter.Write(json); | |||||
| requestWriter.Close(); | |||||
| try | |||||
| { | |||||
| WebResponse webResponse = request.GetResponse(); | |||||
| Stream webStream = webResponse.GetResponseStream(); | |||||
| StreamReader responseReader = new StreamReader(webStream); | |||||
| string response = responseReader.ReadToEnd(); | |||||
| Console.Out.WriteLine(response); | |||||
| responseReader.Close(); | |||||
| } | |||||
| catch (Exception e) | |||||
| { | |||||
| Console.Out.WriteLine("-----------------"); | |||||
| Console.Out.WriteLine(e.Message); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,91 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Reflection; | |||||
| namespace migrate_data | |||||
| { | |||||
| public class SQLCreator | |||||
| { | |||||
| public List<string> GetProperties<T>(T obj) | |||||
| { | |||||
| List<string> list = new List<string>(); | |||||
| foreach (PropertyInfo pi in obj.GetType().GetProperties()) | |||||
| { | |||||
| list.Add(string.Format("\"{0}\"", pi.Name)); | |||||
| } | |||||
| return list; | |||||
| } | |||||
| } | |||||
| public class pgdspec | |||||
| { | |||||
| public int id { get; set; } | |||||
| public string reasonForChange { get; set; } | |||||
| public string workInstruction { get; set; } | |||||
| public bool? customerNotification { get; set; } | |||||
| public bool? facRequired { get; set; } | |||||
| public string validation { get; set; } | |||||
| public string approvedUserId { get; set; } | |||||
| public DateTime? approvedDate { get; set; } | |||||
| public string oereman { get; set; } | |||||
| public string basicClass { get; set; } | |||||
| public string built { get; set; } | |||||
| public int? sameAsId { get; set; } | |||||
| public string except { get; set; } | |||||
| public int? makeFrom { get; set; } | |||||
| public string floatStock { get; set; } | |||||
| public string voltage { get; set; } | |||||
| public string rotation { get; set; } | |||||
| public string terminalPosition { get; set; } | |||||
| public string drive { get; set; } | |||||
| public string pinion { get; set; } | |||||
| public string switchPosition { get; set; } | |||||
| public string ho { get; set; } | |||||
| public string sae { get; set; } | |||||
| public string ftf { get; set; } | |||||
| public string opening { get; set; } | |||||
| public string treatment { get; set; } | |||||
| public string curve { get; set; } | |||||
| public string remarks { get; set; } | |||||
| public bool? jsp { get; set; } | |||||
| public string suctionPort { get; set; } | |||||
| public string pressurePort { get; set; } | |||||
| public string suctionFitting { get; set; } | |||||
| public string pressureFitting { get; set; } | |||||
| public string serviceReplacementRef { get; set; } | |||||
| public string tagNumber { get; set; } | |||||
| public bool? plrv { get; set; } | |||||
| public bool? rtv { get; set; } | |||||
| public string frequency { get; set; } | |||||
| public string note { get; set; } | |||||
| public string additionalParts { get; set; } | |||||
| public string gasket { get; set; } | |||||
| public string metalTag { get; set; } | |||||
| public string paperTag { get; set; } | |||||
| public string otherTag { get; set; } | |||||
| public string bracket { get; set; } | |||||
| public string box { get; set; } | |||||
| public DateTime? createDate { get; set; } | |||||
| public int? createUserId { get; set; } | |||||
| public DateTime? updateDate { get; set; } | |||||
| public int? updateUserId { get; set; } | |||||
| public int partNumberId { get; set; } | |||||
| public int statusId { get; set; } | |||||
| public string application { get; set; } | |||||
| public string swtch { get; set; } | |||||
| public string mtgh { get; set; } | |||||
| public string pitch { get; set; } | |||||
| public bool? facCompleted { get; set; } | |||||
| public string revisionLevel { get; set; } | |||||
| public DateTime? effectiveDate { get; set; } | |||||
| public string signed { get; set; } | |||||
| public string chked { get; set; } | |||||
| public string weight { get; set; } | |||||
| public DateTime? signedDate { get; set; } | |||||
| public DateTime? checkedDate { get; set; } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,11 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <configuration> | |||||
| <runtime> | |||||
| <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | |||||
| <dependentAssembly> | |||||
| <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | |||||
| <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> | |||||
| </dependentAssembly> | |||||
| </assemblyBinding> | |||||
| </runtime> | |||||
| </configuration> | |||||
| @@ -0,0 +1,63 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <doc> | |||||
| <assembly> | |||||
| <name>System.Net.Http.WebRequest</name> | |||||
| </assembly> | |||||
| <members> | |||||
| <member name="T:System.Net.Http.RtcRequestFactory"> | |||||
| <summary>Represents the class that is used to create special <see cref="T:System.Net.Http.HttpRequestMessage" /> for use with the Real-Time-Communications (RTC) background notification infrastructure.</summary> | |||||
| </member> | |||||
| <member name="M:System.Net.Http.RtcRequestFactory.Create(System.Net.Http.HttpMethod,System.Uri)"> | |||||
| <summary>Creates a special <see cref="T:System.Net.Http.HttpRequestMessage" /> for use with the Real-Time-Communications (RTC) background notification infrastructure.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Http.HttpRequestMessage" />.An HTTP request message for use with the RTC background notification infrastructure.</returns> | |||||
| <param name="method">The HTTP method.</param> | |||||
| <param name="uri">The Uri the request is sent to.</param> | |||||
| </member> | |||||
| <member name="T:System.Net.Http.WebRequestHandler"> | |||||
| <summary>Provides desktop-specific features not available to Windows Store apps or other environments. </summary> | |||||
| </member> | |||||
| <member name="M:System.Net.Http.WebRequestHandler.#ctor"> | |||||
| <summary>Initializes a new instance of the <see cref="T:System.Net.Http.WebRequestHandler" /> class.</summary> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.AllowPipelining"> | |||||
| <summary> Gets or sets a value that indicates whether to pipeline the request to the Internet resource.</summary> | |||||
| <returns>Returns <see cref="T:System.Boolean" />.true if the request should be pipelined; otherwise, false. The default is true. </returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.AuthenticationLevel"> | |||||
| <summary>Gets or sets a value indicating the level of authentication and impersonation used for this request.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Security.AuthenticationLevel" />.A bitwise combination of the <see cref="T:System.Net.Security.AuthenticationLevel" /> values. The default value is <see cref="F:System.Net.Security.AuthenticationLevel.MutualAuthRequested" />.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.CachePolicy"> | |||||
| <summary>Gets or sets the cache policy for this request.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Cache.RequestCachePolicy" />.A <see cref="T:System.Net.Cache.RequestCachePolicy" /> object that defines a cache policy. The default is <see cref="P:System.Net.WebRequest.DefaultCachePolicy" />.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ClientCertificates"> | |||||
| <summary>Gets or sets the collection of security certificates that are associated with this request.</summary> | |||||
| <returns>Returns <see cref="T:System.Security.Cryptography.X509Certificates.X509CertificateCollection" />.The collection of security certificates associated with this request.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ContinueTimeout"> | |||||
| <summary>Gets or sets the amount of time, in milliseconds, the application will wait for 100-continue from the server before uploading data.</summary> | |||||
| <returns>Returns <see cref="T:System.TimeSpan" />.The amount of time, in milliseconds, the application will wait for 100-continue from the server before uploading data. The default value is 350 milliseconds.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ImpersonationLevel"> | |||||
| <summary>Gets or sets the impersonation level for the current request.</summary> | |||||
| <returns>Returns <see cref="T:System.Security.Principal.TokenImpersonationLevel" />.The impersonation level for the request. The default is <see cref="F:System.Security.Principal.TokenImpersonationLevel.Delegation" />.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.MaxResponseHeadersLength"> | |||||
| <summary>Gets or sets the maximum allowed length of the response headers.</summary> | |||||
| <returns>Returns <see cref="T:System.Int32" />.The length, in kilobytes (1024 bytes), of the response headers.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ReadWriteTimeout"> | |||||
| <summary>Gets or sets a time-out in milliseconds when writing a request to or reading a response from a server.</summary> | |||||
| <returns>Returns <see cref="T:System.Int32" />.The number of milliseconds before the writing or reading times out. The default value is 300,000 milliseconds (5 minutes). </returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ServerCertificateValidationCallback"> | |||||
| <summary>Gets or sets a callback method to validate the server certificate.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Security.RemoteCertificateValidationCallback" />.A callback method to validate the server certificate.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.UnsafeAuthenticatedConnectionSharing"> | |||||
| <summary>Gets or sets a value that indicates whether to allow high-speed NTLM-authenticated connection sharing.</summary> | |||||
| <returns>Returns <see cref="T:System.Boolean" />.true to keep the authenticated connection open; otherwise, false.</returns> | |||||
| </member> | |||||
| </members> | |||||
| </doc> | |||||
| @@ -0,0 +1,11 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <configuration> | |||||
| <runtime> | |||||
| <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | |||||
| <dependentAssembly> | |||||
| <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | |||||
| <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> | |||||
| </dependentAssembly> | |||||
| </assemblyBinding> | |||||
| </runtime> | |||||
| </configuration> | |||||
| @@ -0,0 +1,11 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <configuration> | |||||
| <runtime> | |||||
| <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | |||||
| <dependentAssembly> | |||||
| <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | |||||
| <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> | |||||
| </dependentAssembly> | |||||
| </assemblyBinding> | |||||
| </runtime> | |||||
| </configuration> | |||||
| @@ -0,0 +1,11 @@ | |||||
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |||||
| <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> | |||||
| <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> | |||||
| <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | |||||
| <security> | |||||
| <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | |||||
| <requestedExecutionLevel level="asInvoker" uiAccess="false"/> | |||||
| </requestedPrivileges> | |||||
| </security> | |||||
| </trustInfo> | |||||
| </assembly> | |||||
| @@ -0,0 +1,134 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||||
| <PropertyGroup> | |||||
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |||||
| <Platform Condition=" '$(Platform)' == '' ">x86</Platform> | |||||
| <ProductVersion>8.0.30703</ProductVersion> | |||||
| <SchemaVersion>2.0</SchemaVersion> | |||||
| <ProjectGuid>{D6163919-3063-4FC2-9C9B-3A1474D0B93F}</ProjectGuid> | |||||
| <OutputType>WinExe</OutputType> | |||||
| <AppDesignerFolder>Properties</AppDesignerFolder> | |||||
| <RootNamespace>migrate_data</RootNamespace> | |||||
| <AssemblyName>migrate_data</AssemblyName> | |||||
| <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | |||||
| <TargetFrameworkProfile>Client</TargetFrameworkProfile> | |||||
| <FileAlignment>512</FileAlignment> | |||||
| </PropertyGroup> | |||||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | |||||
| <PlatformTarget>x86</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|x86' "> | |||||
| <PlatformTarget>x86</PlatformTarget> | |||||
| <DebugType>pdbonly</DebugType> | |||||
| <Optimize>true</Optimize> | |||||
| <OutputPath>bin\Release\</OutputPath> | |||||
| <DefineConstants>TRACE</DefineConstants> | |||||
| <ErrorReport>prompt</ErrorReport> | |||||
| <WarningLevel>4</WarningLevel> | |||||
| </PropertyGroup> | |||||
| <ItemGroup> | |||||
| <Reference Include="Microsoft.Web.XmlTransform, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | |||||
| <HintPath>..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll</HintPath> | |||||
| <Private>True</Private> | |||||
| </Reference> | |||||
| <Reference Include="Mono.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL"> | |||||
| <HintPath>..\packages\Npgsql.2.2.7\lib\net40\Mono.Security.dll</HintPath> | |||||
| <Private>True</Private> | |||||
| </Reference> | |||||
| <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | |||||
| <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net40\Newtonsoft.Json.dll</HintPath> | |||||
| <Private>True</Private> | |||||
| </Reference> | |||||
| <Reference Include="Npgsql, Version=2.2.7.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7, processorArchitecture=MSIL"> | |||||
| <HintPath>..\packages\Npgsql.2.2.7\lib\net40\Npgsql.dll</HintPath> | |||||
| <Private>True</Private> | |||||
| </Reference> | |||||
| <Reference Include="NuGet.Core, Version=2.14.0.832, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||||
| <HintPath>..\packages\NuGet.Core.2.14.0\lib\net40-Client\NuGet.Core.dll</HintPath> | |||||
| <Private>True</Private> | |||||
| </Reference> | |||||
| <Reference Include="Renci.SshNet, Version=2014.4.6.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL"> | |||||
| <HintPath>..\packages\SSH.NET.2014.4.6-beta2\lib\net40\Renci.SshNet.dll</HintPath> | |||||
| <Private>True</Private> | |||||
| </Reference> | |||||
| <Reference Include="System" /> | |||||
| <Reference Include="System.Core" /> | |||||
| <Reference Include="System.Net" /> | |||||
| <Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | |||||
| <HintPath>..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.dll</HintPath> | |||||
| <Private>True</Private> | |||||
| </Reference> | |||||
| <Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||||
| <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath> | |||||
| <Private>True</Private> | |||||
| </Reference> | |||||
| <Reference Include="System.Net.Http.WebRequest, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | |||||
| <HintPath>..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.WebRequest.dll</HintPath> | |||||
| <Private>True</Private> | |||||
| </Reference> | |||||
| <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.Windows.Forms" /> | |||||
| <Reference Include="System.Xml" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <Compile Include="Bom.cs" /> | |||||
| <Compile Include="Form1.cs"> | |||||
| <SubType>Form</SubType> | |||||
| </Compile> | |||||
| <Compile Include="Form1.Designer.cs"> | |||||
| <DependentUpon>Form1.cs</DependentUpon> | |||||
| </Compile> | |||||
| <Compile Include="GDSpecObj.cs" /> | |||||
| <Compile Include="MDspecObj.cs" /> | |||||
| <Compile Include="PGHelper.cs" /> | |||||
| <Compile Include="Program.cs" /> | |||||
| <Compile Include="Properties\AssemblyInfo.cs" /> | |||||
| <Compile Include="RESTHelper.cs" /> | |||||
| <Compile Include="SQLCreator.cs" /> | |||||
| <EmbeddedResource Include="Form1.resx"> | |||||
| <DependentUpon>Form1.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> | |||||
| </Compile> | |||||
| <None Include="app.config" /> | |||||
| <None Include="packages.config"> | |||||
| <SubType>Designer</SubType> | |||||
| </None> | |||||
| <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> | |||||
| <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> | |||||
| @@ -0,0 +1,30 @@ | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\migrate_data.exe | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\migrate_data.pdb | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\obj\x86\Debug\migrate_data.Form1.resources | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\obj\x86\Debug\migrate_data.Properties.Resources.resources | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\obj\x86\Debug\migrate_data.csproj.GenerateResource.Cache | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\obj\x86\Debug\migrate_data.exe | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\obj\x86\Debug\migrate_data.pdb | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\obj\x86\Debug\migrate_data.csprojResolveAssemblyReference.cache | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\migrate_data.exe.config | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\Microsoft.Web.XmlTransform.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\Newtonsoft.Json.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\NuGet.Core.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\System.Net.Http.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\System.Net.Http.Formatting.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\System.Net.Http.WebRequest.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\Newtonsoft.Json.xml | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\System.Net.Http.xml | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\System.Net.Http.Formatting.xml | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\System.Net.Http.WebRequest.xml | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\Renci.SshNet.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\Renci.SshNet.xml | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\Mono.Security.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\Npgsql.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\Npgsql.xml | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\de\Npgsql.resources.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\es\Npgsql.resources.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\fi\Npgsql.resources.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\fr\Npgsql.resources.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\ja\Npgsql.resources.dll | |||||
| C:\dspec\datamigrate\migrate_data\migrate_data\bin\Debug\zh-CN\Npgsql.resources.dll | |||||
| @@ -0,0 +1,10 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <packages> | |||||
| <package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net40-Client" /> | |||||
| <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net40-Client" /> | |||||
| <package id="Microsoft.Web.Xdt" version="2.1.1" targetFramework="net40-Client" /> | |||||
| <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net40-Client" /> | |||||
| <package id="Npgsql" version="2.2.7" targetFramework="net40-Client" /> | |||||
| <package id="NuGet.Core" version="2.14.0" targetFramework="net40-Client" /> | |||||
| <package id="SSH.NET" version="2014.4.6-beta2" targetFramework="net40-Client" /> | |||||
| </packages> | |||||
| @@ -0,0 +1,63 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <doc> | |||||
| <assembly> | |||||
| <name>System.Net.Http.WebRequest</name> | |||||
| </assembly> | |||||
| <members> | |||||
| <member name="T:System.Net.Http.RtcRequestFactory"> | |||||
| <summary>Represents the class that is used to create special <see cref="T:System.Net.Http.HttpRequestMessage" /> for use with the Real-Time-Communications (RTC) background notification infrastructure.</summary> | |||||
| </member> | |||||
| <member name="M:System.Net.Http.RtcRequestFactory.Create(System.Net.Http.HttpMethod,System.Uri)"> | |||||
| <summary>Creates a special <see cref="T:System.Net.Http.HttpRequestMessage" /> for use with the Real-Time-Communications (RTC) background notification infrastructure.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Http.HttpRequestMessage" />.An HTTP request message for use with the RTC background notification infrastructure.</returns> | |||||
| <param name="method">The HTTP method.</param> | |||||
| <param name="uri">The Uri the request is sent to.</param> | |||||
| </member> | |||||
| <member name="T:System.Net.Http.WebRequestHandler"> | |||||
| <summary>Provides desktop-specific features not available to Windows Store apps or other environments. </summary> | |||||
| </member> | |||||
| <member name="M:System.Net.Http.WebRequestHandler.#ctor"> | |||||
| <summary>Initializes a new instance of the <see cref="T:System.Net.Http.WebRequestHandler" /> class.</summary> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.AllowPipelining"> | |||||
| <summary> Gets or sets a value that indicates whether to pipeline the request to the Internet resource.</summary> | |||||
| <returns>Returns <see cref="T:System.Boolean" />.true if the request should be pipelined; otherwise, false. The default is true. </returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.AuthenticationLevel"> | |||||
| <summary>Gets or sets a value indicating the level of authentication and impersonation used for this request.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Security.AuthenticationLevel" />.A bitwise combination of the <see cref="T:System.Net.Security.AuthenticationLevel" /> values. The default value is <see cref="F:System.Net.Security.AuthenticationLevel.MutualAuthRequested" />.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.CachePolicy"> | |||||
| <summary>Gets or sets the cache policy for this request.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Cache.RequestCachePolicy" />.A <see cref="T:System.Net.Cache.RequestCachePolicy" /> object that defines a cache policy. The default is <see cref="P:System.Net.WebRequest.DefaultCachePolicy" />.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ClientCertificates"> | |||||
| <summary>Gets or sets the collection of security certificates that are associated with this request.</summary> | |||||
| <returns>Returns <see cref="T:System.Security.Cryptography.X509Certificates.X509CertificateCollection" />.The collection of security certificates associated with this request.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ContinueTimeout"> | |||||
| <summary>Gets or sets the amount of time, in milliseconds, the application will wait for 100-continue from the server before uploading data.</summary> | |||||
| <returns>Returns <see cref="T:System.TimeSpan" />.The amount of time, in milliseconds, the application will wait for 100-continue from the server before uploading data. The default value is 350 milliseconds.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ImpersonationLevel"> | |||||
| <summary>Gets or sets the impersonation level for the current request.</summary> | |||||
| <returns>Returns <see cref="T:System.Security.Principal.TokenImpersonationLevel" />.The impersonation level for the request. The default is <see cref="F:System.Security.Principal.TokenImpersonationLevel.Delegation" />.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.MaxResponseHeadersLength"> | |||||
| <summary>Gets or sets the maximum allowed length of the response headers.</summary> | |||||
| <returns>Returns <see cref="T:System.Int32" />.The length, in kilobytes (1024 bytes), of the response headers.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ReadWriteTimeout"> | |||||
| <summary>Gets or sets a time-out in milliseconds when writing a request to or reading a response from a server.</summary> | |||||
| <returns>Returns <see cref="T:System.Int32" />.The number of milliseconds before the writing or reading times out. The default value is 300,000 milliseconds (5 minutes). </returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.ServerCertificateValidationCallback"> | |||||
| <summary>Gets or sets a callback method to validate the server certificate.</summary> | |||||
| <returns>Returns <see cref="T:System.Net.Security.RemoteCertificateValidationCallback" />.A callback method to validate the server certificate.</returns> | |||||
| </member> | |||||
| <member name="P:System.Net.Http.WebRequestHandler.UnsafeAuthenticatedConnectionSharing"> | |||||
| <summary>Gets or sets a value that indicates whether to allow high-speed NTLM-authenticated connection sharing.</summary> | |||||
| <returns>Returns <see cref="T:System.Boolean" />.true to keep the authenticated connection open; otherwise, false.</returns> | |||||
| </member> | |||||
| </members> | |||||
| </doc> | |||||