Commit a0dc920b by mahaisong

fix:新增查询、按钮更新数据库功能

parent 50b51fd6
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
this.listBox1.ItemHeight = 16; this.listBox1.ItemHeight = 16;
this.listBox1.Location = new System.Drawing.Point(47, 49); this.listBox1.Location = new System.Drawing.Point(47, 49);
this.listBox1.Name = "listBox1"; this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(319, 244); this.listBox1.Size = new System.Drawing.Size(410, 244);
this.listBox1.TabIndex = 2; this.listBox1.TabIndex = 2;
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged); this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
// //
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 21F); this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 21F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(407, 330); this.ClientSize = new System.Drawing.Size(504, 331);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.listBox1); this.Controls.Add(this.listBox1);
this.Controls.Add(this.button_OK); this.Controls.Add(this.button_OK);
......
...@@ -82,7 +82,7 @@ namespace StockListingRelatedCode ...@@ -82,7 +82,7 @@ namespace StockListingRelatedCode
stb.AppendLine("港股12的编号-数字部分为:" + number12); stb.AppendLine("港股12的编号-数字部分为:" + number12);
//查找非港股的包含港股编号的股票 //查找非港股的包含港股编号的股票\顺序一样的。 (不要求编号一样,编号作为文本字符被包含即可)
IEnumerable<Organization> listNot12Number = listNot12.Where(x => { return x.Code.Contains(number12); }); IEnumerable<Organization> listNot12Number = listNot12.Where(x => { return x.Code.Contains(number12); });
if (null != listNot12Number && listNot12Number.Count() > 0) if (null != listNot12Number && listNot12Number.Count() > 0)
...@@ -91,19 +91,9 @@ namespace StockListingRelatedCode ...@@ -91,19 +91,9 @@ namespace StockListingRelatedCode
foreach (Organization Not12 in listNot12Number) foreach (Organization Not12 in listNot12Number)
{ {
string numberNot12 = Regex.Replace(Not12.Code, @"[^0-9]+", ""); 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); //string othernumberNot12 = Regex.Replace(Not12.Code, @"[^a-zA-Z]+", "", RegexOptions.IgnoreCase);
//tempstr += " (\"" + numberNot12 + "\" \"" + othernumberNot12 + "\")";
tempstr += "\"" + numberNot12 + "\" "; tempstr += "\"" + numberNot12 + "\" ";
} }
else
{
}
}
if (!String.IsNullOrWhiteSpace(tempstr)) if (!String.IsNullOrWhiteSpace(tempstr))
{ {
......
...@@ -16,7 +16,7 @@ namespace StockListingRelatedCode ...@@ -16,7 +16,7 @@ namespace StockListingRelatedCode
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); Application.Run(new MainForm());
} }
} }
} }
...@@ -71,12 +71,31 @@ ...@@ -71,12 +71,31 @@
<Compile Include="Form1.Designer.cs"> <Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Form2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form2.Designer.cs">
<DependentUpon>Form2.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Other.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Util.cs" /> <Compile Include="Util.cs" />
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Form2.resx">
<DependentUpon>Form2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
......
...@@ -15,6 +15,21 @@ using System.Windows.Forms; ...@@ -15,6 +15,21 @@ using System.Windows.Forms;
namespace StockListingRelatedCode namespace StockListingRelatedCode
{ {
public class Util
{
/// <summary>
/// 将规则拆解成2个部分,第一部分是主,第二部分是-减号后面的。
/// </summary>
/// <param name="rule"></param>
/// <returns></returns>
public static string[] DecodeRule(string rule)
{
return System.Text.RegularExpressions.Regex.Split(rule, @"\)\-\(");
}
}
/// <summary> /// <summary>
/// 企业上市情况 /// 企业上市情况
......
<?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>
...@@ -23,6 +23,8 @@ D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Dapper ...@@ -23,6 +23,8 @@ D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Dapper
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Google.Protobuf.xml D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\Google.Protobuf.xml
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\bin\Debug\MySql.Data.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.Form1.resources
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.Form2.resources
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.MainForm.resources
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.Properties.Resources.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.csproj.GenerateResource.Cache
D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.exe D:\smallproject\StockListingRelatedCode\StockListingRelatedCode\obj\Debug\StockListingRelatedCode.exe
......
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