Commit 3d77630c by 陶然

优化交接人信息记录到本地方便下次直接选择

parent 8f6ab6a0
......@@ -10,6 +10,7 @@ namespace Kivii.Client
public const string DefaultBaseUrl = "http://k5.jst-gov.com";
public const string TableUiSetting = "ui_settings";
public const string TableUiHandover = "ui_Handovers";
public const string RouteLocationQuery = "/Restful/Kivii.Samples.Entities.Location/Query";
public const string RouteSampleQuery = "/Restful/Kivii.Samples.Entities.Sample/Query";
......
......@@ -19,4 +19,13 @@ namespace Kivii.Client.SampleInbounds.Entities
[Default("")]
public string ControlValue { get; set; }
}
[Api(Description ="移交人")]
[Alias(Configs.TableUiHandover)]
public class Handover : Entity
{
[Unique]
[StringLength(200)]
public string Name { get; set; }
}
}
......@@ -174,7 +174,7 @@
this.cbAssignOperatorName.Name = "cbAssignOperatorName";
this.cbAssignOperatorName.Size = new System.Drawing.Size(187, 35);
this.cbAssignOperatorName.TabIndex = 33;
this.cbAssignOperatorName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbAssignOperatorName_KeyDown);
this.cbAssignOperatorName.MouseLeave += new System.EventHandler(this.cbAssignOperatorName_MouseLeave);
//
// lbAssignOperatorName
//
......@@ -182,7 +182,7 @@
this.lbAssignOperatorName.Font = new System.Drawing.Font("宋体", 12F);
this.lbAssignOperatorName.Location = new System.Drawing.Point(8, 402);
this.lbAssignOperatorName.Name = "lbAssignOperatorName";
this.lbAssignOperatorName.Size = new System.Drawing.Size(72, 16);
this.lbAssignOperatorName.Size = new System.Drawing.Size(71, 16);
this.lbAssignOperatorName.TabIndex = 32;
this.lbAssignOperatorName.Text = "交接人:";
//
......@@ -213,7 +213,7 @@
this.lbCurrentPackage.Font = new System.Drawing.Font("宋体", 12F);
this.lbCurrentPackage.Location = new System.Drawing.Point(8, 288);
this.lbCurrentPackage.Name = "lbCurrentPackage";
this.lbCurrentPackage.Size = new System.Drawing.Size(80, 16);
this.lbCurrentPackage.Size = new System.Drawing.Size(79, 16);
this.lbCurrentPackage.TabIndex = 6;
this.lbCurrentPackage.Text = "当前箱号:";
//
......@@ -236,7 +236,7 @@
this.lbCurrentLocation.Font = new System.Drawing.Font("宋体", 12F);
this.lbCurrentLocation.Location = new System.Drawing.Point(8, 231);
this.lbCurrentLocation.Name = "lbCurrentLocation";
this.lbCurrentLocation.Size = new System.Drawing.Size(80, 16);
this.lbCurrentLocation.Size = new System.Drawing.Size(79, 16);
this.lbCurrentLocation.TabIndex = 5;
this.lbCurrentLocation.Text = "当前位置:";
//
......@@ -259,7 +259,7 @@
this.lbPackageDepartment.Font = new System.Drawing.Font("宋体", 12F);
this.lbPackageDepartment.Location = new System.Drawing.Point(8, 345);
this.lbPackageDepartment.Name = "lbPackageDepartment";
this.lbPackageDepartment.Size = new System.Drawing.Size(112, 16);
this.lbPackageDepartment.Size = new System.Drawing.Size(111, 16);
this.lbPackageDepartment.TabIndex = 4;
this.lbPackageDepartment.Text = "样品所属部门:";
//
......@@ -279,7 +279,7 @@
this.lblUrl.Font = new System.Drawing.Font("宋体", 12F);
this.lblUrl.Location = new System.Drawing.Point(8, 15);
this.lblUrl.Name = "lblUrl";
this.lblUrl.Size = new System.Drawing.Size(64, 16);
this.lblUrl.Size = new System.Drawing.Size(63, 16);
this.lblUrl.TabIndex = 21;
this.lblUrl.Text = "地 址:";
//
......@@ -289,7 +289,7 @@
this.lblUser.Font = new System.Drawing.Font("宋体", 12F);
this.lblUser.Location = new System.Drawing.Point(8, 72);
this.lblUser.Name = "lblUser";
this.lblUser.Size = new System.Drawing.Size(64, 16);
this.lblUser.Size = new System.Drawing.Size(63, 16);
this.lblUser.TabIndex = 22;
this.lblUser.Text = "用户名:";
//
......@@ -299,7 +299,7 @@
this.lblPassword.Font = new System.Drawing.Font("宋体", 12F);
this.lblPassword.Location = new System.Drawing.Point(8, 128);
this.lblPassword.Name = "lblPassword";
this.lblPassword.Size = new System.Drawing.Size(64, 16);
this.lblPassword.Size = new System.Drawing.Size(63, 16);
this.lblPassword.TabIndex = 23;
this.lblPassword.Text = "密 码:";
//
......@@ -838,7 +838,7 @@
this.Controls.Add(this.plLeft);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmMain";
this.Text = "样品入库交接客户端 1.3(23.7.18)";
this.Text = "样品入库交接客户端 1.4(23.7.19)";
this.Load += new System.EventHandler(this.FrmMain_Load);
this.plLeft.ResumeLayout(false);
this.gbInfo.ResumeLayout(false);
......
......@@ -93,6 +93,49 @@ namespace Kivii.Client.SampleInbounds
dgvRfidSamples.DataSource = null;
}
private void saveHandover()
{
if (cbAssignOperatorName.Text.IsNullOrEmpty()) return;
var existd = true;
try
{
using (var conn = KiviiContext.GetOpenedDbConnection<Handover>())
{
if (!conn.Exists<Handover>(o => o.Name.ToLower() == cbAssignOperatorName.Text.ToLower()))
{
existd = false;
var handover = new Handover();
handover.Name = cbAssignOperatorName.Text;
conn.Insert(handover);
}
}
if (!existd) loadHandover();
}
catch
{
}
}
private void loadHandover()
{
var textd = cbAssignOperatorName.Text;
try
{
using (var conn = KiviiContext.GetOpenedDbConnection<Handover>())
{
var query = conn.From<Handover>();
query.Select(o => o.Name);
var handovers = conn.Select<string>(query);
if (!handovers.IsNullOrEmpty()) cbAssignOperatorName.DataSource = handovers;
if (!textd.IsNullOrEmpty()) cbAssignOperatorName.Text = textd;
else cbAssignOperatorName.Text = string.Empty;
}
}
catch
{
}
}
private void loadDefault(params Control[] ctls)
{
try
......@@ -1068,6 +1111,7 @@ namespace Kivii.Client.SampleInbounds
tbxPassword.Enabled = btnLogin.Enabled;
//tbSetCurrentPackage.Enabled = !btnLogin.Enabled;
setDefault(tbxServiceUrl, tbxUserName, tbxPassword);
loadHandover();
outputMessage($"登录成功,登录人:{resp.DisplayName}", true);
if (!isConnected || reader == null)
{
......@@ -1283,6 +1327,7 @@ namespace Kivii.Client.SampleInbounds
MessageBox.Show("请先设置好交接人信息", "设置");
return;
}
saveHandover();
if (_currentScanSamples.IsNullOrEmpty()) return;
var assignSamples = _currentScanSamples.ToList();//new一个list不影响原来的数组
preSampleAssigning(assignSamples);
......@@ -1339,14 +1384,6 @@ namespace Kivii.Client.SampleInbounds
}));
}
private void cbAssignOperatorName_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
}
}
private void btnSetCurrentPackage_Click(object sender, EventArgs e)
{
if (tbSetCurrentPackage.Text.IsNullOrEmpty())
......@@ -1392,5 +1429,10 @@ namespace Kivii.Client.SampleInbounds
preSampleAssigning(new List<Sample> { currentRowSample });
//sampleAssigning(new List<Guid> { currentRowSample.Kvid });
}
private void cbAssignOperatorName_MouseLeave(object sender, EventArgs e)
{
saveHandover();
}
}
}
......@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2023.7180")]
[assembly: AssemblyFileVersion("5.4.2023.7180")]
[assembly: AssemblyVersion("5.4.2023.7190")]
[assembly: AssemblyFileVersion("5.4.2023.7190")]
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