Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Client.Sample.ImageUploader.V4.5
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶然
Kivii.Client.Sample.ImageUploader.V4.5
Commits
ff1dd3b5
Commit
ff1dd3b5
authored
May 10, 2024
by
Neo Turing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
be462c93
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
42 deletions
+70
-42
Report.cs
Src/Entities/Report.cs
+22
-25
FrmMain.Designer.cs
Src/FrmMain.Designer.cs
+0
-0
FrmMain.cs
Src/FrmMain.cs
+46
-15
AssemblyInfo.cs
Src/Properties/AssemblyInfo.cs
+2
-2
No files found.
Src/Entities/Report.cs
View file @
ff1dd3b5
...
...
@@ -7,30 +7,28 @@ using System.Threading.Tasks;
namespace
Kivii.Sample.ImageUploader.Entities
{
internal
class
Report
:
EntityWithMetadata
internal
class
Report
{
[
ApiMember
(
Description
=
"报告号"
)]
public
string
ReportId
{
get
;
set
;
}
public
string
SupplierName
{
get
;
set
;
}
public
string
DemanderName
{
get
;
set
;
}
public
string
PayerName
{
get
;
set
;
}
#
region
样品相关,和
sample
冗余
[
ApiMember
(
Description
=
"样品Kvid"
)]
[
ApiMember
(
Description
=
"样品名称"
)]
[
StringLength
(
200
),
Required
]
public
string
SampleName
{
get
;
set
;
}
//[ApiMember(Description = "样品Kvid")]
[
IgnoreUpdate
]
[
Required
]
public
Guid
SampleKvid
{
get
;
set
;
}
/// <summary>
/// 样品名称
/// </summary>
[
ApiMember
(
Description
=
"样品名称"
)]
[
StringLength
(
200
),
Required
]
public
string
SampleName
{
get
;
set
;
}
/// <summary>
/// 样品名称
/// </summary>
[
ApiMember
(
Description
=
"样品编号"
)]
//
[ApiMember(Description = "样品编号")]
//[SerialNumber]
[
StringLength
(
50
),
Default
(
""
)]
public
string
SampleSerialNumber
{
get
;
set
;
}
...
...
@@ -38,35 +36,35 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary>
/// 样品批次号
/// </summary>
[
ApiMember
(
Description
=
"样品批次号"
)]
//
[ApiMember(Description = "样品批次号")]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleBatchNumber
{
get
;
set
;
}
/// <summary>
/// 样品品牌
/// </summary>
[
ApiMember
(
Description
=
"
样品
品牌"
)]
[
ApiMember
(
Description
=
"品牌"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleBrand
{
get
;
set
;
}
/// <summary>
/// 样品规格型号
/// </summary>
[
ApiMember
(
Description
=
"
样品
规格型号"
)]
[
ApiMember
(
Description
=
"规格型号"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleModel
{
get
;
set
;
}
/// <summary>
/// 样品数量
/// </summary>
[
ApiMember
(
Description
=
"样品数量"
)]
//
[ApiMember(Description = "样品数量")]
[
DecimalLength
(
10
,
2
),
Default
(
0
)]
public
decimal
SampleQuantity
{
get
;
set
;
}
/// <summary>
/// 数量单位,老数据的样品数量和单位记到metadata中了
/// </summary>
[
ApiMember
(
Description
=
"
样品
数量单位"
)]
[
ApiMember
(
Description
=
"数量单位"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
SampleQuantityUnit
{
get
;
set
;
}
...
...
@@ -91,7 +89,13 @@ namespace Kivii.Sample.ImageUploader.Entities
[
StringLength
(
200
),
Default
(
""
)]
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
]
public
Guid
SampleManufacturerKvid
{
get
;
set
;
}
...
...
@@ -99,21 +103,17 @@ namespace Kivii.Sample.ImageUploader.Entities
[
StringLength
(
100
),
Default
(
""
)]
public
string
SampleManufacturerName
{
get
;
set
;
}
[
ApiMember
(
Description
=
"生产单位联系人Kvid"
)]
[
DefaultEmptyGuid
]
[
IgnoreUpdate
]
public
Guid
SampleManufacturerContactKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"生产单位联系人姓名"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
SampleManufacturerContactName
{
get
;
set
;
}
[
ApiMember
(
Description
=
"生产单位联系人电话"
)]
[
StringLength
(
50
),
Default
(
""
)]
//正则表达式验证:(^(\d{3,4}-)?\d{7,8})$|(13[0-9]{9})
public
string
SampleManufacturerContactNumber
{
get
;
set
;
}
[
ApiMember
(
Description
=
"生产单位地址"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleManufacturerAddress
{
get
;
set
;
}
#
endregion
...
...
@@ -125,7 +125,7 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary>
/// 样品来源编号,计划编号,快递号等
/// </summary>
[
ApiMember
(
Description
=
"
来源编
号"
)]
[
ApiMember
(
Description
=
"
批号/货
号"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleSourceBatchNumber
{
get
;
set
;
}
#
endregion
...
...
@@ -146,7 +146,6 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary>
/// 主检人
/// </summary>
[
ApiMember
(
Description
=
"主检人"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
ManagerName
{
get
;
set
;
}
...
...
@@ -165,7 +164,6 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary>
/// 编制人姓名
/// </summary>
[
ApiMember
(
Description
=
"编制人"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
PreparerName
{
get
;
set
;
}
...
...
@@ -178,7 +176,6 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary>
/// 审核人姓名
/// </summary>
[
ApiMember
(
Description
=
"审核人"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
ReviewerName
{
get
;
set
;
}
...
...
@@ -191,10 +188,10 @@ namespace Kivii.Sample.ImageUploader.Entities
/// <summary>
/// 签发人姓名
/// </summary>
[
ApiMember
(
Description
=
"签发人"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
IssuerName
{
get
;
set
;
}
public
int
Status
{
get
;
set
;
}
#
endregion
}
}
Src/FrmMain.Designer.cs
View file @
ff1dd3b5
This diff is collapsed.
Click to expand it.
Src/FrmMain.cs
View file @
ff1dd3b5
...
...
@@ -11,11 +11,13 @@ using System.Data;
using
System.Drawing
;
using
System.IO
;
using
System.Linq
;
using
System.Reflection
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
System.Xml.Linq
;
using
static
System
.
Net
.
Mime
.
MediaTypeNames
;
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
)
{
if
(
this
.
InvokeRequired
)
...
...
@@ -104,11 +126,12 @@ namespace Kivii.Sample.ImageUploader
cameraQuantity
=
0
;
gbCamView
.
Text
=
"相机视图"
;
tbxReportId
.
Text
=
string
.
Empty
;
lbCurrentReportId
.
Text
=
"__________"
;
lbCurrentSampleName
.
Text
=
"__________"
;
lbCurrentBrand
.
Text
=
"__________"
;
lbCurrentBatchNumber
.
Text
=
"__________"
;
lbCurrentSampleQuantity
.
Text
=
"__________"
;
outputMessage
(
string
.
Empty
,
true
);
//lbCurrentReportId.Text = "__________";
//lbCurrentSampleName.Text = "__________";
//lbCurrentBrand.Text = "__________";
//lbCurrentBatchNumber.Text = "__________";
//lbCurrentSampleQuantity.Text = "__________";
ptbPhotoDisplay
.
Image
=
null
;
flpPhotos
.
Controls
.
Clear
();
}
...
...
@@ -124,21 +147,29 @@ namespace Kivii.Sample.ImageUploader
{
btnUpload
.
Enabled
=
false
;
tbxReportId
.
Text
=
string
.
Empty
;
lbCurrentReportId
.
Text
=
"__________"
;
lbCurrentSampleName
.
Text
=
"__________"
;
lbCurrentBrand
.
Text
=
"__________"
;
lbCurrentBatchNumber
.
Text
=
"__________"
;
lbCurrentSampleQuantity
.
Text
=
"__________"
;
outputMessage
(
string
.
Empty
,
true
);
}
else
{
btnUpload
.
Enabled
=
true
;
tbxReportId
.
Text
=
string
.
Empty
;
lbCurrentReportId
.
Text
=
currentReport
.
ReportId
;
lbCurrentSampleName
.
Text
=
currentReport
.
SampleName
;
lbCurrentBrand
.
Text
=
currentReport
.
SampleBrand
;
lbCurrentBatchNumber
.
Text
=
currentReport
.
SampleBatchNumber
;
lbCurrentSampleQuantity
.
Text
=
currentReport
.
SampleQuantityUnit
;
var
time
=
DateTime
.
Now
.
ToString
(
"HH:mm:ss"
);
//outputMessage($"当前时间:{time}");
Type
type
=
typeof
(
Report
);
//获取所有属性。
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
...
...
Src/Properties/AssemblyInfo.cs
View file @
ff1dd3b5
...
...
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.5
08
0")]
[assembly: AssemblyFileVersion("5.4.2024.5
08
0")]
[assembly: AssemblyVersion("5.4.2024.5
10
0")]
[assembly: AssemblyFileVersion("5.4.2024.5
10
0")]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment