Commit 50b51fd6 by mahaisong

feat:港股与非港股的编号相同的做规则,用于后期规避

parent b9ac6e02

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StockListingRelatedCode", "StockListingRelatedCode\StockListingRelatedCode.csproj", "{8C9BAAD2-628E-47B7-A104-90C270030EEB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8C9BAAD2-628E-47B7-A104-90C270030EEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C9BAAD2-628E-47B7-A104-90C270030EEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C9BAAD2-628E-47B7-A104-90C270030EEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C9BAAD2-628E-47B7-A104-90C270030EEB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
</configuration>
namespace StockListingRelatedCode
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button_OK = new System.Windows.Forms.Button();
this.listBox1 = new System.Windows.Forms.ListBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// button_OK
//
this.button_OK.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button_OK.Location = new System.Drawing.Point(47, 6);
this.button_OK.Name = "button_OK";
this.button_OK.Size = new System.Drawing.Size(116, 31);
this.button_OK.TabIndex = 1;
this.button_OK.Text = "开始执行";
this.button_OK.UseVisualStyleBackColor = true;
this.button_OK.Click += new System.EventHandler(this.button_OK_Click);
//
// listBox1
//
this.listBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 16;
this.listBox1.Location = new System.Drawing.Point(47, 49);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(319, 244);
this.listBox1.TabIndex = 2;
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(27, 306);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(368, 15);
this.label1.TabIndex = 3;
this.label1.Text = "此程序只能执行1次,否则大括号多次封装导致错误";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 21F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(407, 330);
this.Controls.Add(this.label1);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.button_OK);
this.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.Name = "Form1";
this.Text = "非港股相同编号排除规则--全量更新数据库";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button_OK;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Label label1;
}
}

using Dapper;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StockListingRelatedCode
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.listBox1.Text = "";
this.listBox1.HorizontalScrollbar = true;
}
private void button_OK_Click(object sender, EventArgs e)
{
this.listBox1.Items.Clear();
this.button_OK.Enabled = false;
this.button_OK.Visible = false;
this.listBox1.Items.Add("正在执行中……");
string filename = DateTime.Now.ToString("HH_mm_ss_fff");
//输出规则中间文件
string RulePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filename + "规则中间文件" + ".txt");
//输出原始全表数据备份
string OldTablePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filename + "原始全表数据备份" + ".txt");
//输出执行update规则的语句
string UpdateSQLPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filename + "执行update规则的SQL语句" + ".txt");
//暂存找到非港股的规则,后面作为SQL语句执行。
ConcurrentDictionary<string, string> updateDic = new ConcurrentDictionary<string, string>();
//声明mysql调用
//查询Organization 表中所有港股
//查询Organization 表中所有非港股
//for循环港股、查找非港股的包含港股编号的股票、输出
StringBuilder stb = new StringBuilder();
try
{
MySqlConnection con = new MySqlConnection("Server=pubtopic.org;uid=palas;pwd=lapas;Database=Palas_V5;charset=utf8;connection timeout=300;SslMode = none");
//查询数据---必须确保Organization类字段、顺序与数据库字段 一致
IEnumerable<Organization> list = con.Query<Organization>("select * from Organization");
con.Close();
IEnumerable<Organization> list12 = list.Where(x => { return x.StockListing == 12; });
IEnumerable<Organization> listNot12 = list.Where(x => { return x.StockListing != 12 && x.StockListing != 0; });
stb.AppendLine("操作的数据: 总行数" + list.Count() + "; 港股12的行数" + list12.Count() + ";除港股12、未上市的其他所有股票的行数" + listNot12.Count() + ";");
foreach (Organization item12 in list12)
{
//正则表达式提取数字
string number12 = Regex.Replace(item12.Code, @"[^0-9]+", "");
stb.AppendLine("港股12的编号-数字部分为:" + number12);
//查找非港股的包含港股编号的股票
IEnumerable<Organization> listNot12Number = listNot12.Where(x => { return x.Code.Contains(number12); });
if (null != listNot12Number && listNot12Number.Count() > 0)
{
string tempstr = "";
foreach (Organization Not12 in listNot12Number)
{
string numberNot12 = Regex.Replace(Not12.Code, @"[^0-9]+", "");
//另一个修正要求: 后缀相同。
if (int.Parse(numberNot12) == int.Parse(number12))
{
//string othernumberNot12 = Regex.Replace(Not12.Code, @"[^a-zA-Z]+", "", RegexOptions.IgnoreCase);
//tempstr += " (\"" + numberNot12 + "\" \"" + othernumberNot12 + "\")";
tempstr += "\"" + numberNot12 + "\" ";
}
else
{
}
}
if (!String.IsNullOrWhiteSpace(tempstr))
{
//移除最后1个空格
tempstr = "(" + tempstr.Remove(tempstr.Length - 1, 1) + ")";
stb.AppendLine("\t\t规则为:" + tempstr);
string newrule = "(" + item12.QueryRule + ")-" + tempstr;
stb.AppendLine("\t\t带原规则为:" + newrule);
updateDic.TryAdd(item12.OrganizationID, newrule.Replace("'", "")); //将数据中的单引号去除。 没办法,要执行update语句,就不能用单引号。
}
else
{
stb.AppendLine(" 其他股票没有相同的编号!");
//无关不做改动
}
}
else
{
stb.AppendLine(" 其他股票没有相同的编号!");
//无关不做改动
}
}
if (!File.Exists(RulePath))
{
FileStream fs = new FileStream(RulePath, FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
//开始写入
sw.Write(stb);
//清空缓冲区
sw.Flush();
//关闭流
sw.Close();
fs.Close();
this.Invoke(new MethodInvoker(() =>
{
this.listBox1.Items.Add("1:规则中间文件--生成完毕:" + RulePath);
}));
}
else
{
MessageBox.Show("文件已经存在重名" + RulePath + "。建议重新生成!");
return;
}
//更新数据库。
//1.将原有数据全表全量全部输出为txt文件。防止修改后找不到备份。
//OldTablePath
if (!File.Exists(OldTablePath))
{
FileStream fs = new FileStream(OldTablePath, FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
//标题行
Organization model = new Organization();
System.Reflection.PropertyInfo[] pArray = model.GetType().GetProperties(); //注意此方法是无序的。
string Oldtitle = "";
foreach (System.Reflection.PropertyInfo p in pArray)
{
Oldtitle += p.Name + ",";
}
Oldtitle = Oldtitle.Remove(Oldtitle.Length - 1, 1);
sw.WriteLine(Oldtitle);
//清空缓冲区
sw.Flush();
foreach (Organization old in list)
{
string row = "";
//每行的每列数据
foreach (System.Reflection.PropertyInfo p in pArray)
{
row += ((null == p.GetValue(old) ? "NULL" : p.GetValue(old)) + ",").Replace("\r\n", "").Replace("\r", "").Replace("\n", "").Replace("\t", "");
}
row = row.Remove(row.Length - 1, 1);
sw.WriteLine(row);
//清空缓冲区
sw.Flush();
}
//关闭流
sw.Close();
fs.Close();
this.Invoke(new MethodInvoker(() =>
{
this.listBox1.Items.Add("2:原始全表数据备份--生成完毕:" + OldTablePath);
}));
}
else
{
MessageBox.Show("文件已经存在重名" + OldTablePath + "。建议重新生成!");
return;
}
//2.将需要更新的数据,从执行的队列里面循环,进行update操作。
//组装update语句--100条执行1次。
//UpdateSQLPath
string formatsql = @"update Organization set QueryRule='@a' where OrganizationID='@b';";
if (!File.Exists(UpdateSQLPath))
{
FileStream fs = new FileStream(UpdateSQLPath, FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
for (int jindex = 0; jindex < updateDic.Count(); jindex++)
{
string OrganizationID = updateDic.ElementAt(jindex).Key.ToString();
string QueryRule = updateDic.ElementAt(jindex).Value.ToString();
//开始写入
sw.WriteLine(formatsql.Replace("@a", QueryRule).Replace("@b", OrganizationID));
//清空缓冲区
sw.Flush();
}
//关闭流
sw.Close();
fs.Close();
this.Invoke(new MethodInvoker(() =>
{
this.listBox1.Items.Add("3:执行update规则的SQL语句--生成完毕:" + UpdateSQLPath);
}));
}
else
{
MessageBox.Show("文件已经存在重名" + UpdateSQLPath + "。建议重新生成!");
return;
}
StringBuilder updatesqlstb = new StringBuilder();
con.Open();
int i = 0;
while (i < updateDic.Count())
{
string OrganizationID = updateDic.ElementAt(i).Key.ToString();
string QueryRule = updateDic.ElementAt(i).Value.ToString();
updatesqlstb.Append(formatsql.Replace("@a", QueryRule).Replace("@b", OrganizationID));
if (i % 10 == 0)
{
//提交执行
try
{
IDbTransaction transaction = con.BeginTransaction();
try
{
con.Execute(updatesqlstb.ToString(), null, transaction);
transaction.Commit();
}
catch (Exception exception)
{
transaction.Rollback();
MessageBox.Show("数据库错误--事务回滚!" + exception.ToString());
}
//
}
catch (Exception ext)
{
MessageBox.Show("数据库错误!" + ext.ToString());
}
updatesqlstb.Clear();
}
i++;
}
if (updatesqlstb.Length > 0)
{
try
{
IDbTransaction transaction = con.BeginTransaction();
try
{
con.Execute(updatesqlstb.ToString(), null, transaction);
transaction.Commit();
}
catch (Exception exception)
{
transaction.Rollback();
MessageBox.Show("数据库错误--事务回滚!" + exception.ToString());
}
//
}
catch (Exception ext)
{
MessageBox.Show("数据库错误!" + ext.ToString());
}
updatesqlstb.Clear();
}
con.Close();
con.Dispose();
this.Invoke(new MethodInvoker(() =>
{
this.listBox1.Items.Add("3:更新数据库完毕:" + UpdateSQLPath);
}));
}
catch (Exception ex)
{
MessageBox.Show("异常错误!" + ex.ToString());
}
finally
{
this.Invoke(new MethodInvoker(() =>
{
this.listBox1.Items.Add("执行完成");
this.button_OK.Enabled = true;
this.button_OK.Visible = true;
}));
}
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
ListControl ls = (ListControl)sender;
MessageBox.Show(ls.Text);
}
}
}
<?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>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StockListingRelatedCode
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("StockListingRelatedCode")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("StockListingRelatedCode")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("8c9baad2-628e-47b7-a104-90c270030eeb")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace StockListingRelatedCode.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[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>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("StockListingRelatedCode.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 使用此强类型资源类,为所有资源查找
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?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>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace StockListingRelatedCode.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
<?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>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8C9BAAD2-628E-47B7-A104-90C270030EEB}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>StockListingRelatedCode</RootNamespace>
<AssemblyName>StockListingRelatedCode</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Dapper, Version=1.50.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Dapper.1.50.5\lib\net451\Dapper.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Google.Protobuf, Version=3.5.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MySql.Data, Version=8.0.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.8.0.11\lib\net452\MySql.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing.Design" />
<Reference Include="System.Management" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Util.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>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<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>
\ No newline at end of file

using Dapper;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StockListingRelatedCode
{
/// <summary>
/// 企业上市情况
/// </summary>
public enum StockListing
{
/// <summary>
/// 未上市
/// </summary>
[Description("未上市")]
NonIPO = 0,
Shanghai_A = 1,
Shanghai_B = 2,
Shenzhen_A = 3,
Shenzhen_B = 4,
/// <summary>
/// 深圳:中小企业板
/// </summary>
[Description("深圳:中小企业板")]
Shenzhen_SMEs = 5,
/// <summary>
/// 深圳:创业板
/// </summary>
[Description("深圳:创业板")]
Shenzhen_GEM = 6,
/// <summary>
/// 新三板
/// </summary>
New_SB = 7,
Nasdaq = 10,
NewYork = 11,
Hongkong = 12,
Tokyo = 13,
London = 14,
Singapore = 15,
[Description("其他地区上市")]
Other = 100
}
public class Organization
{
public string OrganizationID { get; set; }
public string FullName { get; set; }
public string ShortName { get; set; }
public sbyte OrgLevel { get; set; }
public string RegionID { get; set; }
public sbyte RegionLevel { get; set; }
public sbyte SocialSystem { get; set; }
public string DepartmentID { get; set; }
public string IndustryID { get; set; }
public sbyte StockListing { get; set; }
public DateTime? ListedDate { get; set; }
public string ChiefPeopleID { get; set; }
public string Code { get; set; }
public string Homepage { get; set; }
public string OfficeAddress { get; set; }
public string MediaID { get; set; }
public string Weibo { get; set; }
public string WeChat { get; set; }
public string Summary { get; set; }
public string MainBusiness { get; set; }
public string BusinessScope { get; set; }
public string History { get; set; }
public string Email { get; set; }
public string Secretary { get; set; }
public string SecretaryTel { get; set; }
public string SecretaryFax { get; set; }
public string SecretaryEmail { get; set; }
public string SecurityConsultant { get; set; }
public string QueryRule { get; set; }
public bool IsDisabled { get; set; }
public string IssueID { get; set; }
public bool IsGlobal { get; set; }
public string Tags { get; set; }
public sbyte? Status { get; set; }
public DateTime? ModifyTime { get; set; }
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
</configuration>
<?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>
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\StockListingRelatedCode.exe.config
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\StockListingRelatedCode.exe
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\StockListingRelatedCode.pdb
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Dapper.dll
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Google.Protobuf.dll
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\MySql.Data.dll
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Dapper.xml
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Google.Protobuf.xml
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\MySql.Data.xml
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.csprojResolveAssemblyReference.cache
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.Organization.resources
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.Properties.Resources.resources
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.csproj.GenerateResource.Cache
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.exe
c:\users\admin\documents\visual studio 2015\Projects\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.pdb
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\StockListingRelatedCode.exe.config
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\StockListingRelatedCode.exe
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\StockListingRelatedCode.pdb
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Dapper.dll
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Google.Protobuf.dll
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\MySql.Data.dll
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Dapper.xml
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Google.Protobuf.xml
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\MySql.Data.xml
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.Form1.resources
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.Properties.Resources.resources
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.csproj.GenerateResource.Cache
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.exe
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.pdb
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Dapper" version="1.50.5" targetFramework="net451" />
<package id="Google.Protobuf" version="3.5.1" targetFramework="net452" />
<package id="MySql.Data" version="8.0.11" targetFramework="net452" />
</packages>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment