Commit ff1dd3b5 by Neo Turing

优化

parent be462c93
...@@ -7,30 +7,28 @@ using System.Threading.Tasks; ...@@ -7,30 +7,28 @@ using System.Threading.Tasks;
namespace Kivii.Sample.ImageUploader.Entities namespace Kivii.Sample.ImageUploader.Entities
{ {
internal class Report:EntityWithMetadata internal class Report
{ {
[ApiMember(Description = "报告号")]
public string ReportId { get; set; } public string ReportId { get; set; }
public string SupplierName { get; set; }
public string DemanderName { get; set; }
public string PayerName { get; set; }
#region 样品相关,和sample冗余 #region 样品相关,和sample冗余
[ApiMember(Description = "样品Kvid")] [ApiMember(Description = "样品名称")]
[StringLength(200), Required]
public string SampleName { get; set; }
//[ApiMember(Description = "样品Kvid")]
[IgnoreUpdate] [IgnoreUpdate]
[Required] [Required]
public Guid SampleKvid { get; set; } public Guid SampleKvid { get; set; }
/// <summary> /// <summary>
/// 样品名称 /// 样品名称
/// </summary> /// </summary>
[ApiMember(Description = "样品名称")]
[StringLength(200), Required]
public string SampleName { get; set; }
/// <summary> /// <summary>
/// 样品名称 /// 样品名称
/// </summary> /// </summary>
[ApiMember(Description = "样品编号")] //[ApiMember(Description = "样品编号")]
//[SerialNumber] //[SerialNumber]
[StringLength(50), Default("")] [StringLength(50), Default("")]
public string SampleSerialNumber { get; set; } public string SampleSerialNumber { get; set; }
...@@ -38,35 +36,35 @@ namespace Kivii.Sample.ImageUploader.Entities ...@@ -38,35 +36,35 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary> /// <summary>
/// 样品批次号 /// 样品批次号
/// </summary> /// </summary>
[ApiMember(Description = "样品批次号")] //[ApiMember(Description = "样品批次号")]
[StringLength(200), Default("")] [StringLength(200), Default("")]
public string SampleBatchNumber { get; set; } public string SampleBatchNumber { get; set; }
/// <summary> /// <summary>
/// 样品品牌 /// 样品品牌
/// </summary> /// </summary>
[ApiMember(Description = "样品品牌")] [ApiMember(Description = "品牌")]
[StringLength(200), Default("")] [StringLength(200), Default("")]
public string SampleBrand { get; set; } public string SampleBrand { get; set; }
/// <summary> /// <summary>
/// 样品规格型号 /// 样品规格型号
/// </summary> /// </summary>
[ApiMember(Description = "样品规格型号")] [ApiMember(Description = "规格型号")]
[StringLength(200), Default("")] [StringLength(200), Default("")]
public string SampleModel { get; set; } public string SampleModel { get; set; }
/// <summary> /// <summary>
/// 样品数量 /// 样品数量
/// </summary> /// </summary>
[ApiMember(Description = "样品数量")] //[ApiMember(Description = "样品数量")]
[DecimalLength(10, 2), Default(0)] [DecimalLength(10, 2), Default(0)]
public decimal SampleQuantity { get; set; } public decimal SampleQuantity { get; set; }
/// <summary> /// <summary>
/// 数量单位,老数据的样品数量和单位记到metadata中了 /// 数量单位,老数据的样品数量和单位记到metadata中了
/// </summary> /// </summary>
[ApiMember(Description = "样品数量单位")] [ApiMember(Description = "数量单位")]
[StringLength(50), Default("")] [StringLength(50), Default("")]
public string SampleQuantityUnit { get; set; } public string SampleQuantityUnit { get; set; }
...@@ -91,7 +89,13 @@ namespace Kivii.Sample.ImageUploader.Entities ...@@ -91,7 +89,13 @@ namespace Kivii.Sample.ImageUploader.Entities
[StringLength(200), Default("")] [StringLength(200), Default("")]
public string SampleGradeFunction { get; set; } public string SampleGradeFunction { get; set; }
[ApiMember(Description = "生产单位Kvid")] public string SupplierName { get; set; }
[ApiMember(Description = "委托单位")]
public string DemanderName { get; set; }
public string PayerName { get; set; }
//[ApiMember(Description = "生产单位Kvid")]
[DefaultEmptyGuid] [DefaultEmptyGuid]
public Guid SampleManufacturerKvid { get; set; } public Guid SampleManufacturerKvid { get; set; }
...@@ -99,21 +103,17 @@ namespace Kivii.Sample.ImageUploader.Entities ...@@ -99,21 +103,17 @@ namespace Kivii.Sample.ImageUploader.Entities
[StringLength(100), Default("")] [StringLength(100), Default("")]
public string SampleManufacturerName { get; set; } public string SampleManufacturerName { get; set; }
[ApiMember(Description = "生产单位联系人Kvid")]
[DefaultEmptyGuid] [DefaultEmptyGuid]
[IgnoreUpdate] [IgnoreUpdate]
public Guid SampleManufacturerContactKvid { get; set; } public Guid SampleManufacturerContactKvid { get; set; }
[ApiMember(Description = "生产单位联系人姓名")]
[StringLength(50), Default("")] [StringLength(50), Default("")]
public string SampleManufacturerContactName { get; set; } public string SampleManufacturerContactName { get; set; }
[ApiMember(Description = "生产单位联系人电话")]
[StringLength(50), Default("")] [StringLength(50), Default("")]
//正则表达式验证:(^(\d{3,4}-)?\d{7,8})$|(13[0-9]{9}) //正则表达式验证:(^(\d{3,4}-)?\d{7,8})$|(13[0-9]{9})
public string SampleManufacturerContactNumber { get; set; } public string SampleManufacturerContactNumber { get; set; }
[ApiMember(Description = "生产单位地址")]
[StringLength(200), Default("")] [StringLength(200), Default("")]
public string SampleManufacturerAddress { get; set; } public string SampleManufacturerAddress { get; set; }
#endregion #endregion
...@@ -125,7 +125,7 @@ namespace Kivii.Sample.ImageUploader.Entities ...@@ -125,7 +125,7 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary> /// <summary>
/// 样品来源编号,计划编号,快递号等 /// 样品来源编号,计划编号,快递号等
/// </summary> /// </summary>
[ApiMember(Description = "来源编号")] [ApiMember(Description = "批号/货号")]
[StringLength(200), Default("")] [StringLength(200), Default("")]
public string SampleSourceBatchNumber { get; set; } public string SampleSourceBatchNumber { get; set; }
#endregion #endregion
...@@ -146,7 +146,6 @@ namespace Kivii.Sample.ImageUploader.Entities ...@@ -146,7 +146,6 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary> /// <summary>
/// 主检人 /// 主检人
/// </summary> /// </summary>
[ApiMember(Description = "主检人")]
[StringLength(50), Default("")] [StringLength(50), Default("")]
public string ManagerName { get; set; } public string ManagerName { get; set; }
...@@ -165,7 +164,6 @@ namespace Kivii.Sample.ImageUploader.Entities ...@@ -165,7 +164,6 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary> /// <summary>
/// 编制人姓名 /// 编制人姓名
/// </summary> /// </summary>
[ApiMember(Description = "编制人")]
[StringLength(50), Default("")] [StringLength(50), Default("")]
public string PreparerName { get; set; } public string PreparerName { get; set; }
...@@ -178,7 +176,6 @@ namespace Kivii.Sample.ImageUploader.Entities ...@@ -178,7 +176,6 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary> /// <summary>
/// 审核人姓名 /// 审核人姓名
/// </summary> /// </summary>
[ApiMember(Description = "审核人")]
[StringLength(50), Default("")] [StringLength(50), Default("")]
public string ReviewerName { get; set; } public string ReviewerName { get; set; }
...@@ -191,10 +188,10 @@ namespace Kivii.Sample.ImageUploader.Entities ...@@ -191,10 +188,10 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary> /// <summary>
/// 签发人姓名 /// 签发人姓名
/// </summary> /// </summary>
[ApiMember(Description = "签发人")]
[StringLength(50), Default("")] [StringLength(50), Default("")]
public string IssuerName { get; set; } public string IssuerName { get; set; }
public int Status { get; set; }
#endregion #endregion
} }
} }
...@@ -30,18 +30,10 @@ ...@@ -30,18 +30,10 @@
{ {
this.plLeft = new System.Windows.Forms.Panel(); this.plLeft = new System.Windows.Forms.Panel();
this.gbSample = new System.Windows.Forms.GroupBox(); this.gbSample = new System.Windows.Forms.GroupBox();
this.lbCurrentSampleQuantity = new System.Windows.Forms.Label(); this.rtbMessage = new System.Windows.Forms.RichTextBox();
this.lbSampleQuantity = new System.Windows.Forms.Label(); this.plSearchReport = new System.Windows.Forms.Panel();
this.lbCurrentBrand = new System.Windows.Forms.Label();
this.lbBrand = new System.Windows.Forms.Label();
this.lbCurrentBatchNumber = new System.Windows.Forms.Label();
this.lbBatchNumber = new System.Windows.Forms.Label();
this.lbCurrentSampleName = new System.Windows.Forms.Label();
this.lbSampleName = new System.Windows.Forms.Label();
this.lbCurrentReportId = new System.Windows.Forms.Label();
this.lbReportId = new System.Windows.Forms.Label();
this.btnReportId = new System.Windows.Forms.Button();
this.tbxReportId = new System.Windows.Forms.TextBox(); this.tbxReportId = new System.Windows.Forms.TextBox();
this.btnReportId = new System.Windows.Forms.Button();
this.gbLogin = new System.Windows.Forms.GroupBox(); this.gbLogin = new System.Windows.Forms.GroupBox();
this.btnLogout = new System.Windows.Forms.Button(); this.btnLogout = new System.Windows.Forms.Button();
this.btnLogin = new System.Windows.Forms.Button(); this.btnLogin = new System.Windows.Forms.Button();
...@@ -55,21 +47,21 @@ ...@@ -55,21 +47,21 @@
this.btnSwitch = new System.Windows.Forms.Button(); this.btnSwitch = new System.Windows.Forms.Button();
this.cbxResolution = new System.Windows.Forms.ComboBox(); this.cbxResolution = new System.Windows.Forms.ComboBox();
this.plVsp = new System.Windows.Forms.Panel(); this.plVsp = new System.Windows.Forms.Panel();
this.vspCamView = new Kivii.Sample.ImageUploader.Controls.VideoSourcePlayer();
this.plRight = new System.Windows.Forms.Panel(); this.plRight = new System.Windows.Forms.Panel();
this.gbPhotoList = new System.Windows.Forms.GroupBox(); this.gbPhotoList = new System.Windows.Forms.GroupBox();
this.flpPhotos = new System.Windows.Forms.FlowLayoutPanel(); this.flpPhotos = new System.Windows.Forms.FlowLayoutPanel();
this.gbUploading = new System.Windows.Forms.GroupBox(); this.gbUploading = new System.Windows.Forms.GroupBox();
this.btnUpload = new System.Windows.Forms.Button(); this.btnUpload = new System.Windows.Forms.Button();
this.ckbCompress = new System.Windows.Forms.CheckBox();
this.plMain = new System.Windows.Forms.Panel(); this.plMain = new System.Windows.Forms.Panel();
this.gbPhotoView = new System.Windows.Forms.GroupBox(); this.gbPhotoView = new System.Windows.Forms.GroupBox();
this.ptbPhotoDisplay = new System.Windows.Forms.PictureBox(); this.ptbPhotoDisplay = new System.Windows.Forms.PictureBox();
this.gbOperating = new System.Windows.Forms.GroupBox(); this.gbOperating = new System.Windows.Forms.GroupBox();
this.btnDelete = new System.Windows.Forms.Button();
this.btnShot = new System.Windows.Forms.Button(); this.btnShot = new System.Windows.Forms.Button();
this.vspCamView = new Kivii.Sample.ImageUploader.Controls.VideoSourcePlayer(); this.btnDelete = new System.Windows.Forms.Button();
this.plLeft.SuspendLayout(); this.plLeft.SuspendLayout();
this.gbSample.SuspendLayout(); this.gbSample.SuspendLayout();
this.plSearchReport.SuspendLayout();
this.gbLogin.SuspendLayout(); this.gbLogin.SuspendLayout();
this.gbCamView.SuspendLayout(); this.gbCamView.SuspendLayout();
this.plVsp.SuspendLayout(); this.plVsp.SuspendLayout();
...@@ -95,18 +87,8 @@ ...@@ -95,18 +87,8 @@
// //
// gbSample // gbSample
// //
this.gbSample.Controls.Add(this.lbCurrentSampleQuantity); this.gbSample.Controls.Add(this.rtbMessage);
this.gbSample.Controls.Add(this.lbSampleQuantity); this.gbSample.Controls.Add(this.plSearchReport);
this.gbSample.Controls.Add(this.lbCurrentBrand);
this.gbSample.Controls.Add(this.lbBrand);
this.gbSample.Controls.Add(this.lbCurrentBatchNumber);
this.gbSample.Controls.Add(this.lbBatchNumber);
this.gbSample.Controls.Add(this.lbCurrentSampleName);
this.gbSample.Controls.Add(this.lbSampleName);
this.gbSample.Controls.Add(this.lbCurrentReportId);
this.gbSample.Controls.Add(this.lbReportId);
this.gbSample.Controls.Add(this.btnReportId);
this.gbSample.Controls.Add(this.tbxReportId);
this.gbSample.Dock = System.Windows.Forms.DockStyle.Fill; this.gbSample.Dock = System.Windows.Forms.DockStyle.Fill;
this.gbSample.Location = new System.Drawing.Point(0, 287); this.gbSample.Location = new System.Drawing.Point(0, 287);
this.gbSample.Name = "gbSample"; this.gbSample.Name = "gbSample";
...@@ -115,128 +97,51 @@ ...@@ -115,128 +97,51 @@
this.gbSample.TabStop = false; this.gbSample.TabStop = false;
this.gbSample.Text = "查询样品"; this.gbSample.Text = "查询样品";
// //
// lbCurrentSampleQuantity // rtbMessage
//
this.lbCurrentSampleQuantity.AutoSize = true;
this.lbCurrentSampleQuantity.Font = new System.Drawing.Font("宋体", 12F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbCurrentSampleQuantity.Location = new System.Drawing.Point(56, 157);
this.lbCurrentSampleQuantity.Name = "lbCurrentSampleQuantity";
this.lbCurrentSampleQuantity.Size = new System.Drawing.Size(97, 16);
this.lbCurrentSampleQuantity.TabIndex = 18;
this.lbCurrentSampleQuantity.Text = "__________";
//
// lbSampleQuantity
//
this.lbSampleQuantity.AutoSize = true;
this.lbSampleQuantity.Font = new System.Drawing.Font("宋体", 9F);
this.lbSampleQuantity.Location = new System.Drawing.Point(3, 161);
this.lbSampleQuantity.Name = "lbSampleQuantity";
this.lbSampleQuantity.Size = new System.Drawing.Size(59, 12);
this.lbSampleQuantity.TabIndex = 17;
this.lbSampleQuantity.Text = "样品数量:";
//
// lbCurrentBrand
//
this.lbCurrentBrand.AutoSize = true;
this.lbCurrentBrand.Font = new System.Drawing.Font("宋体", 12F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbCurrentBrand.Location = new System.Drawing.Point(56, 132);
this.lbCurrentBrand.Name = "lbCurrentBrand";
this.lbCurrentBrand.Size = new System.Drawing.Size(97, 16);
this.lbCurrentBrand.TabIndex = 16;
this.lbCurrentBrand.Text = "__________";
//
// lbBrand
//
this.lbBrand.AutoSize = true;
this.lbBrand.Font = new System.Drawing.Font("宋体", 9F);
this.lbBrand.Location = new System.Drawing.Point(3, 136);
this.lbBrand.Name = "lbBrand";
this.lbBrand.Size = new System.Drawing.Size(47, 12);
this.lbBrand.TabIndex = 15;
this.lbBrand.Text = "商 标:";
//
// lbCurrentBatchNumber
//
this.lbCurrentBatchNumber.AutoSize = true;
this.lbCurrentBatchNumber.Font = new System.Drawing.Font("宋体", 12F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbCurrentBatchNumber.Location = new System.Drawing.Point(56, 108);
this.lbCurrentBatchNumber.Name = "lbCurrentBatchNumber";
this.lbCurrentBatchNumber.Size = new System.Drawing.Size(97, 16);
this.lbCurrentBatchNumber.TabIndex = 14;
this.lbCurrentBatchNumber.Text = "__________";
//
// lbBatchNumber
//
this.lbBatchNumber.AutoSize = true;
this.lbBatchNumber.Font = new System.Drawing.Font("宋体", 9F);
this.lbBatchNumber.Location = new System.Drawing.Point(3, 112);
this.lbBatchNumber.Name = "lbBatchNumber";
this.lbBatchNumber.Size = new System.Drawing.Size(59, 12);
this.lbBatchNumber.TabIndex = 13;
this.lbBatchNumber.Text = "批号货号:";
//
// lbCurrentSampleName
//
this.lbCurrentSampleName.AutoSize = true;
this.lbCurrentSampleName.Font = new System.Drawing.Font("宋体", 12F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbCurrentSampleName.Location = new System.Drawing.Point(56, 82);
this.lbCurrentSampleName.Name = "lbCurrentSampleName";
this.lbCurrentSampleName.Size = new System.Drawing.Size(97, 16);
this.lbCurrentSampleName.TabIndex = 12;
this.lbCurrentSampleName.Text = "__________";
//
// lbSampleName
//
this.lbSampleName.AutoSize = true;
this.lbSampleName.Font = new System.Drawing.Font("宋体", 9F);
this.lbSampleName.Location = new System.Drawing.Point(3, 86);
this.lbSampleName.Name = "lbSampleName";
this.lbSampleName.Size = new System.Drawing.Size(59, 12);
this.lbSampleName.TabIndex = 11;
this.lbSampleName.Text = "样品名称:";
//
// lbCurrentReportId
//
this.lbCurrentReportId.AutoSize = true;
this.lbCurrentReportId.Font = new System.Drawing.Font("宋体", 12F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbCurrentReportId.Location = new System.Drawing.Point(56, 58);
this.lbCurrentReportId.Name = "lbCurrentReportId";
this.lbCurrentReportId.Size = new System.Drawing.Size(97, 16);
this.lbCurrentReportId.TabIndex = 10;
this.lbCurrentReportId.Text = "__________";
//
// lbReportId
//
this.lbReportId.AutoSize = true;
this.lbReportId.Font = new System.Drawing.Font("宋体", 9F);
this.lbReportId.Location = new System.Drawing.Point(3, 62);
this.lbReportId.Name = "lbReportId";
this.lbReportId.Size = new System.Drawing.Size(47, 12);
this.lbReportId.TabIndex = 9;
this.lbReportId.Text = "报告号:";
// //
// btnReportId this.rtbMessage.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtbMessage.Font = new System.Drawing.Font("宋体", 16F);
this.rtbMessage.Location = new System.Drawing.Point(3, 59);
this.rtbMessage.Margin = new System.Windows.Forms.Padding(2);
this.rtbMessage.Name = "rtbMessage";
this.rtbMessage.Size = new System.Drawing.Size(281, 120);
this.rtbMessage.TabIndex = 20;
this.rtbMessage.Text = "";
// //
this.btnReportId.BackColor = System.Drawing.SystemColors.ButtonHighlight; // plSearchReport
this.btnReportId.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); //
this.btnReportId.Location = new System.Drawing.Point(201, 21); this.plSearchReport.Controls.Add(this.tbxReportId);
this.btnReportId.Name = "btnReportId"; this.plSearchReport.Controls.Add(this.btnReportId);
this.btnReportId.Size = new System.Drawing.Size(83, 35); this.plSearchReport.Dock = System.Windows.Forms.DockStyle.Top;
this.btnReportId.TabIndex = 8; this.plSearchReport.Location = new System.Drawing.Point(3, 17);
this.btnReportId.Text = "查询报告"; this.plSearchReport.Name = "plSearchReport";
this.btnReportId.UseVisualStyleBackColor = false; this.plSearchReport.Size = new System.Drawing.Size(281, 42);
this.btnReportId.Click += new System.EventHandler(this.btnReportId_Click); this.plSearchReport.TabIndex = 19;
// //
// tbxReportId // tbxReportId
// //
this.tbxReportId.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.tbxReportId.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbxReportId.Location = new System.Drawing.Point(3, 20); this.tbxReportId.Font = new System.Drawing.Font("宋体", 14F);
this.tbxReportId.Location = new System.Drawing.Point(0, 0);
this.tbxReportId.Multiline = true; this.tbxReportId.Multiline = true;
this.tbxReportId.Name = "tbxReportId"; this.tbxReportId.Name = "tbxReportId";
this.tbxReportId.Size = new System.Drawing.Size(193, 35); this.tbxReportId.Size = new System.Drawing.Size(207, 42);
this.tbxReportId.TabIndex = 7; this.tbxReportId.TabIndex = 7;
this.tbxReportId.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbxReportId_KeyPress); this.tbxReportId.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbxReportId_KeyPress);
// //
// btnReportId
//
this.btnReportId.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.btnReportId.Dock = System.Windows.Forms.DockStyle.Right;
this.btnReportId.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReportId.Location = new System.Drawing.Point(207, 0);
this.btnReportId.Name = "btnReportId";
this.btnReportId.Size = new System.Drawing.Size(74, 42);
this.btnReportId.TabIndex = 8;
this.btnReportId.Text = "查询";
this.btnReportId.UseVisualStyleBackColor = false;
this.btnReportId.Click += new System.EventHandler(this.btnReportId_Click);
//
// gbLogin // gbLogin
// //
this.gbLogin.Controls.Add(this.btnLogout); this.gbLogin.Controls.Add(this.btnLogout);
...@@ -383,6 +288,16 @@ ...@@ -383,6 +288,16 @@
this.plVsp.Size = new System.Drawing.Size(281, 223); this.plVsp.Size = new System.Drawing.Size(281, 223);
this.plVsp.TabIndex = 0; this.plVsp.TabIndex = 0;
// //
// vspCamView
//
this.vspCamView.Dock = System.Windows.Forms.DockStyle.Fill;
this.vspCamView.Location = new System.Drawing.Point(0, 0);
this.vspCamView.Name = "vspCamView";
this.vspCamView.Size = new System.Drawing.Size(281, 223);
this.vspCamView.TabIndex = 0;
this.vspCamView.Text = "vspCamView";
this.vspCamView.VideoSource = null;
//
// plRight // plRight
// //
this.plRight.Controls.Add(this.gbPhotoList); this.plRight.Controls.Add(this.gbPhotoList);
...@@ -420,7 +335,6 @@ ...@@ -420,7 +335,6 @@
// gbUploading // gbUploading
// //
this.gbUploading.Controls.Add(this.btnUpload); this.gbUploading.Controls.Add(this.btnUpload);
this.gbUploading.Controls.Add(this.ckbCompress);
this.gbUploading.Dock = System.Windows.Forms.DockStyle.Bottom; this.gbUploading.Dock = System.Windows.Forms.DockStyle.Bottom;
this.gbUploading.Location = new System.Drawing.Point(0, 582); this.gbUploading.Location = new System.Drawing.Point(0, 582);
this.gbUploading.Name = "gbUploading"; this.gbUploading.Name = "gbUploading";
...@@ -432,27 +346,16 @@ ...@@ -432,27 +346,16 @@
// btnUpload // btnUpload
// //
this.btnUpload.BackColor = System.Drawing.SystemColors.ButtonHighlight; this.btnUpload.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.btnUpload.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnUpload.Font = new System.Drawing.Font("宋体", 25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnUpload.Font = new System.Drawing.Font("宋体", 25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUpload.Location = new System.Drawing.Point(54, 42); this.btnUpload.Location = new System.Drawing.Point(3, 17);
this.btnUpload.Name = "btnUpload"; this.btnUpload.Name = "btnUpload";
this.btnUpload.Size = new System.Drawing.Size(115, 49); this.btnUpload.Size = new System.Drawing.Size(227, 79);
this.btnUpload.TabIndex = 3; this.btnUpload.TabIndex = 3;
this.btnUpload.Text = "上传"; this.btnUpload.Text = "上传";
this.btnUpload.UseVisualStyleBackColor = false; this.btnUpload.UseVisualStyleBackColor = false;
this.btnUpload.Click += new System.EventHandler(this.btnUpload_Click); this.btnUpload.Click += new System.EventHandler(this.btnUpload_Click);
// //
// ckbCompress
//
this.ckbCompress.AutoSize = true;
this.ckbCompress.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ckbCompress.Location = new System.Drawing.Point(54, 8);
this.ckbCompress.Name = "ckbCompress";
this.ckbCompress.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.ckbCompress.Size = new System.Drawing.Size(125, 28);
this.ckbCompress.TabIndex = 2;
this.ckbCompress.Text = "图片压缩";
this.ckbCompress.UseVisualStyleBackColor = true;
//
// plMain // plMain
// //
this.plMain.Controls.Add(this.gbPhotoView); this.plMain.Controls.Add(this.gbPhotoView);
...@@ -488,8 +391,8 @@ ...@@ -488,8 +391,8 @@
// //
// gbOperating // gbOperating
// //
this.gbOperating.Controls.Add(this.btnDelete);
this.gbOperating.Controls.Add(this.btnShot); this.gbOperating.Controls.Add(this.btnShot);
this.gbOperating.Controls.Add(this.btnDelete);
this.gbOperating.Dock = System.Windows.Forms.DockStyle.Bottom; this.gbOperating.Dock = System.Windows.Forms.DockStyle.Bottom;
this.gbOperating.Location = new System.Drawing.Point(0, 582); this.gbOperating.Location = new System.Drawing.Point(0, 582);
this.gbOperating.Name = "gbOperating"; this.gbOperating.Name = "gbOperating";
...@@ -498,43 +401,33 @@ ...@@ -498,43 +401,33 @@
this.gbOperating.TabStop = false; this.gbOperating.TabStop = false;
this.gbOperating.Text = "操作台"; this.gbOperating.Text = "操作台";
// //
// btnDelete
//
this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnDelete.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.btnDelete.Font = new System.Drawing.Font("宋体", 25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelete.Location = new System.Drawing.Point(269, 28);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(138, 65);
this.btnDelete.TabIndex = 2;
this.btnDelete.Text = "删除";
this.btnDelete.UseVisualStyleBackColor = false;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// btnShot // btnShot
// //
this.btnShot.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255))))); this.btnShot.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
this.btnShot.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnShot.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnShot.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.btnShot.Font = new System.Drawing.Font("宋体", 25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnShot.Font = new System.Drawing.Font("宋体", 25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnShot.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255))))); this.btnShot.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
this.btnShot.Location = new System.Drawing.Point(24, 28); this.btnShot.Location = new System.Drawing.Point(3, 17);
this.btnShot.Name = "btnShot"; this.btnShot.Name = "btnShot";
this.btnShot.Size = new System.Drawing.Size(138, 65); this.btnShot.Size = new System.Drawing.Size(238, 79);
this.btnShot.TabIndex = 1; this.btnShot.TabIndex = 3;
this.btnShot.Text = "拍照"; this.btnShot.Text = "拍照";
this.btnShot.UseVisualStyleBackColor = false; this.btnShot.UseVisualStyleBackColor = false;
this.btnShot.Click += new System.EventHandler(this.btnShot_Click); this.btnShot.Click += new System.EventHandler(this.btnShot_Click);
// //
// vspCamView // btnDelete
// //
this.vspCamView.Dock = System.Windows.Forms.DockStyle.Fill; this.btnDelete.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.vspCamView.Location = new System.Drawing.Point(0, 0); this.btnDelete.Dock = System.Windows.Forms.DockStyle.Right;
this.vspCamView.Name = "vspCamView"; this.btnDelete.Font = new System.Drawing.Font("宋体", 25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.vspCamView.Size = new System.Drawing.Size(281, 223); this.btnDelete.Location = new System.Drawing.Point(241, 17);
this.vspCamView.TabIndex = 0; this.btnDelete.Name = "btnDelete";
this.vspCamView.Text = "vspCamView"; this.btnDelete.Size = new System.Drawing.Size(180, 79);
this.vspCamView.VideoSource = null; this.btnDelete.TabIndex = 2;
this.btnDelete.Text = "删除";
this.btnDelete.UseVisualStyleBackColor = false;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
// //
// FrmMain // FrmMain
// //
...@@ -550,7 +443,8 @@ ...@@ -550,7 +443,8 @@
this.Load += new System.EventHandler(this.FrmMain_Load); this.Load += new System.EventHandler(this.FrmMain_Load);
this.plLeft.ResumeLayout(false); this.plLeft.ResumeLayout(false);
this.gbSample.ResumeLayout(false); this.gbSample.ResumeLayout(false);
this.gbSample.PerformLayout(); this.plSearchReport.ResumeLayout(false);
this.plSearchReport.PerformLayout();
this.gbLogin.ResumeLayout(false); this.gbLogin.ResumeLayout(false);
this.gbLogin.PerformLayout(); this.gbLogin.PerformLayout();
this.gbCamView.ResumeLayout(false); this.gbCamView.ResumeLayout(false);
...@@ -558,7 +452,6 @@ ...@@ -558,7 +452,6 @@
this.plRight.ResumeLayout(false); this.plRight.ResumeLayout(false);
this.gbPhotoList.ResumeLayout(false); this.gbPhotoList.ResumeLayout(false);
this.gbUploading.ResumeLayout(false); this.gbUploading.ResumeLayout(false);
this.gbUploading.PerformLayout();
this.plMain.ResumeLayout(false); this.plMain.ResumeLayout(false);
this.gbPhotoView.ResumeLayout(false); this.gbPhotoView.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ptbPhotoDisplay)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ptbPhotoDisplay)).EndInit();
...@@ -581,16 +474,6 @@ ...@@ -581,16 +474,6 @@
private System.Windows.Forms.GroupBox gbSample; private System.Windows.Forms.GroupBox gbSample;
private System.Windows.Forms.TextBox tbxReportId; private System.Windows.Forms.TextBox tbxReportId;
private System.Windows.Forms.Button btnReportId; private System.Windows.Forms.Button btnReportId;
private System.Windows.Forms.Label lbCurrentReportId;
private System.Windows.Forms.Label lbReportId;
private System.Windows.Forms.Label lbCurrentBrand;
private System.Windows.Forms.Label lbBrand;
private System.Windows.Forms.Label lbCurrentBatchNumber;
private System.Windows.Forms.Label lbBatchNumber;
private System.Windows.Forms.Label lbCurrentSampleName;
private System.Windows.Forms.Label lbSampleName;
private System.Windows.Forms.Label lbCurrentSampleQuantity;
private System.Windows.Forms.Label lbSampleQuantity;
private System.Windows.Forms.Button btnLogout; private System.Windows.Forms.Button btnLogout;
private System.Windows.Forms.Button btnLogin; private System.Windows.Forms.Button btnLogin;
private System.Windows.Forms.TextBox tbxPassword; private System.Windows.Forms.TextBox tbxPassword;
...@@ -604,11 +487,12 @@ ...@@ -604,11 +487,12 @@
private System.Windows.Forms.GroupBox gbPhotoList; private System.Windows.Forms.GroupBox gbPhotoList;
private System.Windows.Forms.GroupBox gbUploading; private System.Windows.Forms.GroupBox gbUploading;
private System.Windows.Forms.Button btnUpload; private System.Windows.Forms.Button btnUpload;
private System.Windows.Forms.CheckBox ckbCompress;
private System.Windows.Forms.Button btnDelete; private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.Button btnShot;
private System.Windows.Forms.FlowLayoutPanel flpPhotos; private System.Windows.Forms.FlowLayoutPanel flpPhotos;
private System.Windows.Forms.PictureBox ptbPhotoDisplay; private System.Windows.Forms.PictureBox ptbPhotoDisplay;
private System.Windows.Forms.Button btnShot;
private System.Windows.Forms.Panel plSearchReport;
private System.Windows.Forms.RichTextBox rtbMessage;
} }
} }
...@@ -11,11 +11,13 @@ using System.Data; ...@@ -11,11 +11,13 @@ using System.Data;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml.Linq; using System.Xml.Linq;
using static System.Net.Mime.MediaTypeNames;
namespace Kivii.Sample.ImageUploader namespace Kivii.Sample.ImageUploader
{ {
...@@ -76,6 +78,26 @@ namespace Kivii.Sample.ImageUploader ...@@ -76,6 +78,26 @@ namespace Kivii.Sample.ImageUploader
} }
} }
/// <summary>
/// 输出消息
/// </summary>
/// <param name="message">消息内容</param>
/// <param name="clearMessage">是否清除消息</param>
private void outputMessage(string message, bool clearMessage = false)
{
if (this.InvokeRequired)
{
this.Invoke(new Action(() => outputMessage(message, clearMessage)));
return;
}
if (clearMessage) rtbMessage.Clear();
//if (rtbMessage.Lines.Count() > 500) rtbMessage.Clear();
//var time = DateTime.Now.ToString("HH:mm:ss");
//rtbMessage.AppendText($"[{time}]{message}{Environment.NewLine}");
if(!message.IsNullOrEmpty())rtbMessage.AppendText($"{message}{Environment.NewLine}");
//rtbMessage.ScrollToCaret();
}
private void initFormCtlEnable(bool notLogin = true) private void initFormCtlEnable(bool notLogin = true)
{ {
if (this.InvokeRequired) if (this.InvokeRequired)
...@@ -104,11 +126,12 @@ namespace Kivii.Sample.ImageUploader ...@@ -104,11 +126,12 @@ namespace Kivii.Sample.ImageUploader
cameraQuantity = 0; cameraQuantity = 0;
gbCamView.Text = "相机视图"; gbCamView.Text = "相机视图";
tbxReportId.Text = string.Empty; tbxReportId.Text = string.Empty;
lbCurrentReportId.Text = "__________"; outputMessage(string.Empty, true);
lbCurrentSampleName.Text = "__________"; //lbCurrentReportId.Text = "__________";
lbCurrentBrand.Text = "__________"; //lbCurrentSampleName.Text = "__________";
lbCurrentBatchNumber.Text = "__________"; //lbCurrentBrand.Text = "__________";
lbCurrentSampleQuantity.Text = "__________"; //lbCurrentBatchNumber.Text = "__________";
//lbCurrentSampleQuantity.Text = "__________";
ptbPhotoDisplay.Image = null; ptbPhotoDisplay.Image = null;
flpPhotos.Controls.Clear(); flpPhotos.Controls.Clear();
} }
...@@ -124,21 +147,29 @@ namespace Kivii.Sample.ImageUploader ...@@ -124,21 +147,29 @@ namespace Kivii.Sample.ImageUploader
{ {
btnUpload.Enabled = false; btnUpload.Enabled = false;
tbxReportId.Text = string.Empty; tbxReportId.Text = string.Empty;
lbCurrentReportId.Text = "__________"; outputMessage(string.Empty, true);
lbCurrentSampleName.Text = "__________";
lbCurrentBrand.Text = "__________";
lbCurrentBatchNumber.Text = "__________";
lbCurrentSampleQuantity.Text = "__________";
} }
else else
{ {
btnUpload.Enabled = true; btnUpload.Enabled = true;
tbxReportId.Text = string.Empty; tbxReportId.Text = string.Empty;
lbCurrentReportId.Text = currentReport.ReportId; var time = DateTime.Now.ToString("HH:mm:ss");
lbCurrentSampleName.Text = currentReport.SampleName; //outputMessage($"当前时间:{time}");
lbCurrentBrand.Text = currentReport.SampleBrand; Type type = typeof(Report);
lbCurrentBatchNumber.Text = currentReport.SampleBatchNumber; //获取所有属性。
lbCurrentSampleQuantity.Text = currentReport.SampleQuantityUnit; PropertyInfo[] properties = type.GetProperties();
foreach ( var prop in properties)
{
if (prop.GetDescription().IsNullOrEmpty()) continue;
var msg = $"{prop.GetDescription()}:{prop.GetValue(currentReport)}";
outputMessage(msg);
}
//lbCurrentReportId.Text = currentReport.ReportId;
//lbCurrentSampleName.Text = currentReport.SampleName;
//lbCurrentBrand.Text = currentReport.SampleBrand;
//lbCurrentBatchNumber.Text = currentReport.SampleBatchNumber;
//lbCurrentSampleQuantity.Text = currentReport.SampleQuantityUnit;
} }
} }
#endregion #endregion
......
...@@ -32,5 +32,5 @@ using System.Runtime.InteropServices; ...@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.5080")] [assembly: AssemblyVersion("5.4.2024.5100")]
[assembly: AssemblyFileVersion("5.4.2024.5080")] [assembly: AssemblyFileVersion("5.4.2024.5100")]
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