Commit 6db5993c by 施晓雨

update

parent fea1794b
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14 # Visual Studio 15
VisualStudioVersion = 14.0.25420.1 VisualStudioVersion = 15.0.28307.329
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kivii.Client.Test", "Kivii.Client.Test\Kivii.Client.Test.csproj", "{0327117D-548C-4EB4-AD86-13F914BD4D1F}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kivii.Client.Test.V4.5", "Kivii.Client.Test\Kivii.Client.Test.V4.5.csproj", "{0327117D-548C-4EB4-AD86-13F914BD4D1F}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup> </startup>
</configuration> <connectionStrings>
<!--<add name="Database" providerName="Sqlite" connectionString="$ROOT\AppData\primary.sqlite"/>-->
</connectionStrings></configuration>
using System; using Kivii.DataAnnotations;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
...@@ -8,6 +9,7 @@ using System.Threading.Tasks; ...@@ -8,6 +9,7 @@ using System.Threading.Tasks;
/// </summary> /// </summary>
namespace Kivii.Organizations.Entities namespace Kivii.Organizations.Entities
{ {
[Alias("Members")]
//类中的属性不一定要全,需要多少属性就写多少属性 //类中的属性不一定要全,需要多少属性就写多少属性
public class Member:EntityWithMetadata public class Member:EntityWithMetadata
{ {
......
...@@ -39,16 +39,25 @@ ...@@ -39,16 +39,25 @@
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.tbxDisplayName = new System.Windows.Forms.TextBox(); this.tbxDisplayName = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tbxFullNameContains = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.btnQueryMember = new System.Windows.Forms.Button();
this.tbxFirstNameIn = new System.Windows.Forms.TextBox(); this.tbxFirstNameIn = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.btnQueryMember = new System.Windows.Forms.Button();
this.tbxFullNameContains = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.panel2 = new System.Windows.Forms.Panel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.dgvResults = new System.Windows.Forms.DataGridView();
this.btnSave = new System.Windows.Forms.Button();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.panel2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvResults)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// label1 // label1
...@@ -150,26 +159,6 @@ ...@@ -150,26 +159,6 @@
this.panel1.Size = new System.Drawing.Size(319, 450); this.panel1.Size = new System.Drawing.Size(319, 450);
this.panel1.TabIndex = 3; this.panel1.TabIndex = 3;
// //
// groupBox1
//
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.btnLogout);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.btnLogin);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.tbxDisplayName);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.tbxPassword);
this.groupBox1.Controls.Add(this.tbxServiceUrl);
this.groupBox1.Controls.Add(this.tbxUserName);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox1.Location = new System.Drawing.Point(0, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(319, 205);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "配置及登陆信息";
//
// groupBox2 // groupBox2
// //
this.groupBox2.Controls.Add(this.tbxFirstNameIn); this.groupBox2.Controls.Add(this.tbxFirstNameIn);
...@@ -185,6 +174,32 @@ ...@@ -185,6 +174,32 @@
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
this.groupBox2.Text = "查询人员示例"; this.groupBox2.Text = "查询人员示例";
// //
// tbxFirstNameIn
//
this.tbxFirstNameIn.Location = new System.Drawing.Point(106, 73);
this.tbxFirstNameIn.Name = "tbxFirstNameIn";
this.tbxFirstNameIn.Size = new System.Drawing.Size(183, 21);
this.tbxFirstNameIn.TabIndex = 7;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(12, 78);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(71, 12);
this.label6.TabIndex = 4;
this.label6.Text = "FirstNameIn";
//
// btnQueryMember
//
this.btnQueryMember.Location = new System.Drawing.Point(31, 210);
this.btnQueryMember.Name = "btnQueryMember";
this.btnQueryMember.Size = new System.Drawing.Size(75, 23);
this.btnQueryMember.TabIndex = 8;
this.btnQueryMember.Text = "Query";
this.btnQueryMember.UseVisualStyleBackColor = true;
this.btnQueryMember.Click += new System.EventHandler(this.btnQueryMember_Click);
//
// tbxFullNameContains // tbxFullNameContains
// //
this.tbxFullNameContains.Location = new System.Drawing.Point(106, 36); this.tbxFullNameContains.Location = new System.Drawing.Point(106, 36);
...@@ -201,45 +216,96 @@ ...@@ -201,45 +216,96 @@
this.label5.TabIndex = 0; this.label5.TabIndex = 0;
this.label5.Text = "FullNameContains"; this.label5.Text = "FullNameContains";
// //
// btnQueryMember // groupBox1
//
this.btnQueryMember.Location = new System.Drawing.Point(31, 210);
this.btnQueryMember.Name = "btnQueryMember";
this.btnQueryMember.Size = new System.Drawing.Size(75, 23);
this.btnQueryMember.TabIndex = 8;
this.btnQueryMember.Text = "Query";
this.btnQueryMember.UseVisualStyleBackColor = true;
this.btnQueryMember.Click += new System.EventHandler(this.btnQueryMember_Click);
//
// tbxFirstNameIn
//
this.tbxFirstNameIn.Location = new System.Drawing.Point(106, 73);
this.tbxFirstNameIn.Name = "tbxFirstNameIn";
this.tbxFirstNameIn.Size = new System.Drawing.Size(183, 21);
this.tbxFirstNameIn.TabIndex = 7;
// //
// label6 this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.btnLogout);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.btnLogin);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.tbxDisplayName);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.tbxPassword);
this.groupBox1.Controls.Add(this.tbxServiceUrl);
this.groupBox1.Controls.Add(this.tbxUserName);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox1.Location = new System.Drawing.Point(0, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(319, 205);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "配置及登陆信息";
// //
this.label6.AutoSize = true; // panel2
this.label6.Location = new System.Drawing.Point(12, 78); //
this.label6.Name = "label6"; this.panel2.Controls.Add(this.groupBox4);
this.label6.Size = new System.Drawing.Size(71, 12); this.panel2.Controls.Add(this.groupBox3);
this.label6.TabIndex = 4; this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label6.Text = "FirstNameIn"; this.panel2.Location = new System.Drawing.Point(319, 0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(481, 450);
this.panel2.TabIndex = 4;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.btnSave);
this.groupBox3.Dock = System.Windows.Forms.DockStyle.Bottom;
this.groupBox3.Location = new System.Drawing.Point(0, 381);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(481, 69);
this.groupBox3.TabIndex = 0;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "操作";
//
// groupBox4
//
this.groupBox4.Controls.Add(this.dgvResults);
this.groupBox4.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox4.Location = new System.Drawing.Point(0, 0);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(481, 381);
this.groupBox4.TabIndex = 1;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "查询人员结果";
//
// dgvResults
//
this.dgvResults.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvResults.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvResults.Location = new System.Drawing.Point(3, 17);
this.dgvResults.Name = "dgvResults";
this.dgvResults.RowTemplate.Height = 23;
this.dgvResults.Size = new System.Drawing.Size(475, 361);
this.dgvResults.TabIndex = 0;
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(15, 34);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(75, 23);
this.btnSave.TabIndex = 0;
this.btnSave.Text = "保存结果";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
// //
// FrmMain // FrmMain
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450); this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1); this.Controls.Add(this.panel1);
this.Name = "FrmMain"; this.Name = "FrmMain";
this.Text = "FrmMain"; this.Text = "客户端示例";
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout(); this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.panel2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvResults)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
...@@ -264,5 +330,10 @@ ...@@ -264,5 +330,10 @@
private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox tbxFirstNameIn; private System.Windows.Forms.TextBox tbxFirstNameIn;
private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label6;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.DataGridView dgvResults;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Button btnSave;
} }
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ using System.Linq; ...@@ -8,6 +8,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using Kivii.Linq;
namespace Kivii.Client.Test.Forms namespace Kivii.Client.Test.Forms
{ {
...@@ -68,17 +69,30 @@ namespace Kivii.Client.Test.Forms ...@@ -68,17 +69,30 @@ namespace Kivii.Client.Test.Forms
private void btnQueryMember_Click(object sender, EventArgs e) private void btnQueryMember_Click(object sender, EventArgs e)
{ {
if (_client == null) return; if (_client == null) return;
dgvResults.DataSource = null;
var queryMember = new MemberQuery(); var queryMember = new MemberQuery();
queryMember.FullNameContains = tbxFullNameContains.Text; queryMember.FullNameContains = tbxFullNameContains.Text;
queryMember.FirstNameIn = tbxFirstNameIn.Text; queryMember.FirstNameIn = tbxFirstNameIn.Text;
var tasks = _client.PostAsync(queryMember); var tasks = _client.PostAsync(queryMember);
tasks.Success(resp => { tasks.Success(resp => {
var x = ""; dgvResults.DataSource = resp.Results;
}); });
tasks.Error(ex => { tasks.Error(ex => {
var x = ""; var x = "";
}); });
} }
private void btnSave_Click(object sender, EventArgs e)
{
var results=dgvResults.DataSource as List<Member>;
if (results == null||results.Count==0) return;
var conn = KiviiContext.GetOpenedDbConnection<Member>();
foreach (var member in results)
{
if (conn.Exists<Member>(o => o.Kvid == member.Kvid)) continue;
conn.Insert(member);
}
}
} }
} }
...@@ -36,6 +36,12 @@ ...@@ -36,6 +36,12 @@
<Reference Include="Kivii.Common.V4.5, Version=5.4.2019.3150, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Kivii.Common.V4.5, Version=5.4.2019.3150, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kivii.Common.5.4.2019.3150\lib\net45\Kivii.Common.V4.5.dll</HintPath> <HintPath>..\packages\Kivii.Common.5.4.2019.3150\lib\net45\Kivii.Common.V4.5.dll</HintPath>
</Reference> </Reference>
<Reference Include="Kivii.Linq.Sqlite.V4.5, Version=5.4.2019.3120, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kivii.Linq.Sqlite.5.4.2019.3120\lib\net45\Kivii.Linq.Sqlite.V4.5.dll</HintPath>
</Reference>
<Reference Include="Kivii.Linq.V4.5, Version=5.4.2019.3150, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kivii.Linq.5.4.2019.3150\lib\net45\Kivii.Linq.V4.5.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Kivii.Common" version="5.4.2019.3150" targetFramework="net45" /> <package id="Kivii.Common" version="5.4.2019.3150" targetFramework="net45" />
<package id="Kivii.Linq" version="5.4.2019.3150" targetFramework="net45" />
<package id="Kivii.Linq.Sqlite" version="5.4.2019.3120" targetFramework="net45" />
</packages> </packages>
\ No newline at end of file
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