初始化提交
仓库转移到Gitea,初始化提交,可能丢失以前的git版本日志
This commit is contained in:
1948
UTS_Core/UTSModule/DbConnect/DbConnector.vb
Normal file
1948
UTS_Core/UTSModule/DbConnect/DbConnector.vb
Normal file
File diff suppressed because it is too large
Load Diff
24
UTS_Core/UTSModule/DbTableModel/Customer/FolwCtrTable.vb
Normal file
24
UTS_Core/UTSModule/DbTableModel/Customer/FolwCtrTable.vb
Normal file
@@ -0,0 +1,24 @@
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 生产流程签名表,待删除
|
||||
''' </summary>
|
||||
Public Class FlowCtrTable
|
||||
Enum ColNamesEnum
|
||||
ID
|
||||
''' <summary>
|
||||
''' 项目唯一标识
|
||||
''' </summary>
|
||||
ProjectID
|
||||
''' <summary>
|
||||
''' 产品序号唯一标识
|
||||
''' </summary>
|
||||
DUT_SN
|
||||
''' <summary>
|
||||
''' 流程签名
|
||||
''' </summary>
|
||||
ProcessRecord
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_FlowCtr"
|
||||
End Class
|
||||
End Namespace
|
||||
59
UTS_Core/UTSModule/DbTableModel/Customer/ImportInfoTable.vb
Normal file
59
UTS_Core/UTSModule/DbTableModel/Customer/ImportInfoTable.vb
Normal file
@@ -0,0 +1,59 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' Sn关联信息表
|
||||
''' </summary>
|
||||
Public Class ImportInfoTable
|
||||
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 索引
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 项目唯一标识
|
||||
''' </summary>
|
||||
ProjectID
|
||||
''' <summary>
|
||||
''' 产品序号唯一标识
|
||||
''' </summary>
|
||||
Barcode
|
||||
''' <summary>
|
||||
''' 录入时间
|
||||
''' </summary>
|
||||
ImportDateTime
|
||||
''' <summary>
|
||||
''' 更新时间,用于同步下载
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_ImportInfo"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT,")
|
||||
builder.Append($"`{ColNames.ProjectID}` int(11) NOT NULL DEFAULT -1 COMMENT '项目唯一标识',")
|
||||
builder.Append($"`{ColNames.Barcode}` varchar(32) NOT NULL COMMENT '产品序号唯一标识',")
|
||||
builder.Append($"`{ColNames.ImportDateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '录入时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
53
UTS_Core/UTSModule/DbTableModel/Customer/LogTable.vb
Normal file
53
UTS_Core/UTSModule/DbTableModel/Customer/LogTable.vb
Normal file
@@ -0,0 +1,53 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 用户操作记录总表
|
||||
''' </summary>
|
||||
Public Class LogTable
|
||||
Enum ColNamesEnum
|
||||
ID
|
||||
''' <summary>
|
||||
''' 操作者
|
||||
''' </summary>
|
||||
UserID
|
||||
''' <summary>
|
||||
''' 操作时间
|
||||
''' </summary>
|
||||
DateTime
|
||||
''' <summary>
|
||||
''' 操作内容说明
|
||||
''' </summary>
|
||||
Operation
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_Log"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
|
||||
builder.Append($"`{ColNamesEnum.ID}` int(11) Not NULL,")
|
||||
builder.Append($"`{ColNamesEnum.UserID}` int(11) DEFAULT NULL COMMENT '用户索引',")
|
||||
builder.Append($"`{ColNamesEnum.DateTime}` datetime DEFAULT NULL COMMENT '操作时间',")
|
||||
builder.Append($"`{ColNamesEnum.Operation}` varchar(254) DEFAULT NULL COMMENT '操作内容说明',")
|
||||
|
||||
builder.Append($"PRIMARY KEY (`{ColNamesEnum.ID}`) ")
|
||||
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
116
UTS_Core/UTSModule/DbTableModel/Customer/OrderInternalTable.vb
Normal file
116
UTS_Core/UTSModule/DbTableModel/Customer/OrderInternalTable.vb
Normal file
@@ -0,0 +1,116 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
Public Class OrderInternalTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 内部订单索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 订单ID
|
||||
''' </summary>
|
||||
OrderID
|
||||
|
||||
''' <summary>
|
||||
''' 内部单号
|
||||
''' </summary>
|
||||
InternalNo
|
||||
|
||||
''' <summary>
|
||||
''' 订单所属公司索引
|
||||
''' </summary>
|
||||
CompanyID
|
||||
|
||||
''' <summary>
|
||||
''' 产品索引
|
||||
''' </summary>
|
||||
ProductID
|
||||
|
||||
''' <summary>
|
||||
''' 产品类型索引
|
||||
''' </summary>
|
||||
ProductTypeID
|
||||
|
||||
''' <summary>
|
||||
''' 创建时间
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 目标产量
|
||||
''' </summary>
|
||||
ObjectiveYield
|
||||
|
||||
''' <summary>
|
||||
''' 累计目标产量
|
||||
''' </summary>
|
||||
ObjectiveYieldTotal
|
||||
|
||||
''' <summary>
|
||||
''' 订单状态
|
||||
''' </summary>
|
||||
OrderStatus
|
||||
|
||||
''' <summary>
|
||||
''' 交货时间
|
||||
''' </summary>
|
||||
DeliveryTime
|
||||
|
||||
''' <summary>
|
||||
''' 适用站位
|
||||
''' </summary>
|
||||
Station
|
||||
|
||||
''' <summary>
|
||||
''' 条码范围
|
||||
''' </summary>
|
||||
BarCode
|
||||
End Enum
|
||||
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_OrderInternal"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT,")
|
||||
builder.Append($"`{ColNames.OrderID}` int(11) NOT NULL COMMENT '订单ID',")
|
||||
builder.Append($"`{ColNames.CompanyID}` int(11) NOT NULL COMMENT '订单所属公司索引',")
|
||||
builder.Append($"`{ColNames.ProductTypeID}` int(11) NOT NULL COMMENT '产品类型索引',")
|
||||
builder.Append($"`{ColNames.ProductID}` int(11) NOT NULL COMMENT '产品索引',")
|
||||
builder.Append($"`{ColNames.OrderStatus}` int(11) NOT NULL COMMENT '订单状态',")
|
||||
builder.Append($"`{ColNames.InternalNo}` varchar(64) NOT NULL COMMENT '内部单号',")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.DeliveryTime}` datetime DEFAULT NULL COMMENT '交货时间',")
|
||||
builder.Append($"`{ColNames.ObjectiveYield}` int(11) DEFAULT NULL COMMENT '目标产量',")
|
||||
builder.Append($"`{ColNames.ObjectiveYieldTotal}` int(11) DEFAULT NULL COMMENT '累计目标产量',")
|
||||
builder.Append($"`{ColNames.Station}` varchar(64) DEFAULT NULL ,")
|
||||
builder.Append($"`{ColNames.BarCode}` varchar(254) DEFAULT NULL ,")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
98
UTS_Core/UTSModule/DbTableModel/Customer/OrdersTable.vb
Normal file
98
UTS_Core/UTSModule/DbTableModel/Customer/OrdersTable.vb
Normal file
@@ -0,0 +1,98 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 客户订单表
|
||||
''' </summary>
|
||||
Public Class OrdersTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 订单索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 公司索引
|
||||
''' </summary>
|
||||
CompanyID
|
||||
|
||||
''' <summary>
|
||||
''' 订单生产产品索引
|
||||
''' </summary>
|
||||
ProductID
|
||||
|
||||
''' <summary>
|
||||
''' 订单号
|
||||
''' </summary>
|
||||
OrderNo
|
||||
|
||||
''' <summary>
|
||||
''' 生产数量
|
||||
''' </summary>
|
||||
OrderCount
|
||||
|
||||
''' <summary>
|
||||
''' 交货日期
|
||||
''' </summary>
|
||||
DeliveryTime
|
||||
|
||||
''' <summary>
|
||||
''' 订单生成日期
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 成本单价
|
||||
''' </summary>
|
||||
CostPrice
|
||||
|
||||
''' <summary>
|
||||
''' 销售单价
|
||||
''' </summary>
|
||||
TransactPrice
|
||||
|
||||
''' <summary>
|
||||
''' 订单状态
|
||||
''' </summary>
|
||||
OrderStatus
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_Orders"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '订单索引',")
|
||||
builder.Append($"`{ColNames.CompanyID}` int(11) NOT NULL COMMENT '所属厂商索引',")
|
||||
builder.Append($"`{ColNames.ProductID}` int(11) NOT NULL COMMENT '订单生产产品索引',")
|
||||
builder.Append($"`{ColNames.OrderNo}` varchar(64) NOT NULL DEFAULT '' COMMENT '订单号',")
|
||||
builder.Append($"`{ColNames.OrderCount}` int(11) NOT NULL DEFAULT 0 COMMENT '生产数量',")
|
||||
builder.Append($"`{ColNames.DeliveryTime}` datetime DEFAULT NULL COMMENT '交货日期',")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '订单生成日期',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.CostPrice}` float DEFAULT NULL COMMENT '成本单价',")
|
||||
builder.Append($"`{ColNames.TransactPrice}` float DEFAULT NULL COMMENT '销售单价',")
|
||||
builder.Append($"`{ColNames.OrderStatus}` int(11) DEFAULT NULL COMMENT '订单状态',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End NameSpace
|
||||
@@ -0,0 +1,52 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
Public Class ProductTypesTable
|
||||
Enum ColNames
|
||||
ID
|
||||
''' <summary>
|
||||
''' 产品类型
|
||||
''' </summary>
|
||||
ProductType
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_ProductTypes"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) Not NULL AUTO_INCREMENT,")
|
||||
builder.Append($"`{ColNames.ProductType}` varchar(255) Not NULL,")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(255) DEFAULT NULL,")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
@@ -0,0 +1,59 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
Public Class ProductionLineTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 产线索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 产线名称
|
||||
''' </summary>
|
||||
Name
|
||||
|
||||
''' <summary>
|
||||
''' 产线描述
|
||||
''' </summary>
|
||||
Description
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_ProductionLine"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT,")
|
||||
builder.Append($"`{ColNames.Name}` varchar(64) NOT NULL DEFAULT '' COMMENT '产线名',")
|
||||
builder.Append($"`{ColNames.Description}` varchar(255) DEFAULT NULL COMMENT '工艺说明',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(255) DEFAULT NULL COMMENT '备注',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End NameSpace
|
||||
@@ -0,0 +1,99 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
Public Class ProductionPlanTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 生产计划索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 订单索引
|
||||
''' </summary>
|
||||
OrderID
|
||||
|
||||
''' <summary>
|
||||
''' 内部订单
|
||||
''' </summary>
|
||||
OrderInternalID
|
||||
|
||||
''' <summary>
|
||||
''' 站位索引
|
||||
''' </summary>
|
||||
StationID
|
||||
|
||||
''' <summary>
|
||||
''' 产线索引
|
||||
''' </summary>
|
||||
ProductionLineID
|
||||
|
||||
''' <summary>
|
||||
''' 生产时间
|
||||
''' </summary>
|
||||
ProductionTime
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 已完成产量
|
||||
''' </summary>
|
||||
ActualOutput
|
||||
|
||||
''' <summary>
|
||||
''' 目标产量
|
||||
''' </summary>
|
||||
ObjectiveYield
|
||||
|
||||
''' <summary>
|
||||
''' 累计目标产量
|
||||
''' </summary>
|
||||
ObjectiveYieldTotal
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_ProductionPlan"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '生产计划索引',")
|
||||
builder.Append($"`{ColNames.OrderID}` int(11) NOT NULL COMMENT '订单索引',")
|
||||
builder.Append($"`{ColNames.OrderInternalID}` int(11) NOT NULL COMMENT '内部单ID',")
|
||||
builder.Append($"`{ColNames.StationID}` int(11) NOT NULL COMMENT '工艺站ID',")
|
||||
builder.Append($"`{ColNames.ProductionLineID}` int(11) NOT NULL COMMENT '产线索引',")
|
||||
builder.Append($"`{ColNames.ProductionTime}` datetime NOT NULL COMMENT '生产时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.ActualOutput}` int(11) NOT NULL COMMENT '已完成产量',")
|
||||
builder.Append($"`{ColNames.ObjectiveYield}` int(11) NOT NULL COMMENT '目标产量',")
|
||||
builder.Append($"`{ColNames.ObjectiveYieldTotal}` int(11) NOT NULL COMMENT '累计目标产量',")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(255) DEFAULT NULL COMMENT '备注',")
|
||||
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
116
UTS_Core/UTSModule/DbTableModel/Customer/ProjectTable.vb
Normal file
116
UTS_Core/UTSModule/DbTableModel/Customer/ProjectTable.vb
Normal file
@@ -0,0 +1,116 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 项目总表
|
||||
''' </summary>
|
||||
Public Class ProjectTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 项目唯一标识
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 项目类型索引
|
||||
''' </summary>
|
||||
ProductTypeID
|
||||
''' <summary>
|
||||
''' 项目名称
|
||||
''' </summary>
|
||||
ProjectName
|
||||
''' <summary>
|
||||
''' 项目描述
|
||||
''' </summary>
|
||||
Description
|
||||
''' <summary>
|
||||
''' 创建人
|
||||
''' </summary>
|
||||
UserID
|
||||
''' <summary>
|
||||
''' 创建时间
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
|
||||
''' <summary>
|
||||
''' 预览图
|
||||
''' </summary>
|
||||
ImageName
|
||||
|
||||
''' <summary>
|
||||
''' 预览图
|
||||
''' </summary>
|
||||
PreviewImage
|
||||
|
||||
''' <summary>
|
||||
''' 单价
|
||||
''' </summary>
|
||||
Price
|
||||
|
||||
''' <summary>
|
||||
''' 单价单位
|
||||
''' </summary>
|
||||
Currency
|
||||
''' <summary>
|
||||
''' 当前项目是否有效
|
||||
''' </summary>
|
||||
IsValid
|
||||
''' <summary>
|
||||
''' 最后有效日期
|
||||
''' </summary>
|
||||
EolDate
|
||||
|
||||
''' <summary>
|
||||
''' 录入条码总表类型,0无订单,1有订单
|
||||
''' </summary>
|
||||
SnType
|
||||
End Enum
|
||||
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_Project"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) Not NULL AUTO_INCREMENT,")
|
||||
builder.Append($"`{ColNames.ProductTypeID}` int(11) Not NULL,")
|
||||
builder.Append($"`{ColNames.ProjectName}` varchar(64) Not NULL,")
|
||||
builder.Append($"`{ColNames.Description}` varchar(64) DEFAULT NULL,")
|
||||
builder.Append($"`{ColNames.UserID}` int(11) Not NULL,")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp(),")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.EolDate}` datetime DEFAULT NULL,")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(255) DEFAULT NULL,")
|
||||
builder.Append($"`{ColNames.ImageName}` varchar(255) DEFAULT NULL,")
|
||||
builder.Append($"`{ColNames.PreviewImage}` mediumblob DEFAULT NULL,")
|
||||
builder.Append($"`{ColNames.Price}` float(10,2) DEFAULT NULL,")
|
||||
builder.Append($"`{ColNames.Currency}` varchar(10) DEFAULT NULL,")
|
||||
builder.Append($"`{ColNames.IsValid}` tinyint(4) DEFAULT 1,")
|
||||
builder.Append($"`{ColNames.SnType}` int(11) NOT NULL DEFAULT 1,")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,71 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 不良代码类型表
|
||||
''' </summary>
|
||||
Public Class RejectsExplainTable
|
||||
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 所属维修分类索引
|
||||
''' </summary>
|
||||
Matlab
|
||||
|
||||
''' <summary>
|
||||
''' 名称
|
||||
''' </summary>
|
||||
Introductions
|
||||
|
||||
''' <summary>
|
||||
''' 创建日期
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 更新时间
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_RejectsExplain"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '不良代码索引',")
|
||||
builder.Append($"`{ColNames.Matlab}` varchar(255) NOT NULL COMMENT '不良品代码',")
|
||||
builder.Append($"`{ColNames.Introductions}` varchar(255) NOT NULL COMMENT '不良品说明',")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(254) DEFAULT NULL COMMENT '备注',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
Public Class RepairLogTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 维修日志索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 维修产品索引
|
||||
''' </summary>
|
||||
ProductID
|
||||
|
||||
''' <summary>
|
||||
''' 维修产品条码
|
||||
''' </summary>
|
||||
DUT_SN
|
||||
|
||||
''' <summary>
|
||||
''' 产品错误代码
|
||||
''' </summary>
|
||||
ErrCode
|
||||
|
||||
''' <summary>
|
||||
''' 维修原因类型
|
||||
''' </summary>
|
||||
RepairType
|
||||
|
||||
''' <summary>
|
||||
''' 维修人工注释
|
||||
''' </summary>
|
||||
RepairComment
|
||||
|
||||
''' <summary>
|
||||
''' 维修产品日期
|
||||
''' </summary>
|
||||
RepairDate
|
||||
|
||||
''' <summary>
|
||||
''' 维修产品结果
|
||||
''' </summary>
|
||||
RepairResult
|
||||
|
||||
''' <summary>
|
||||
''' 产品图像文件名1
|
||||
''' </summary>
|
||||
ProductImg1
|
||||
|
||||
''' <summary>
|
||||
''' 产品图像文件名2
|
||||
''' </summary>
|
||||
ProductImg2
|
||||
|
||||
''' <summary>
|
||||
''' 产品图像文件名3
|
||||
''' </summary>
|
||||
ProductImg3
|
||||
|
||||
''' <summary>
|
||||
''' 产品图像文件名4
|
||||
''' </summary>
|
||||
ProductImg4
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_RepairLog"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNamesEnum.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '维修日志索引',")
|
||||
builder.Append($"`{ColNamesEnum.ProductID}` int(11) Not NULL COMMENT '维修产品索引',")
|
||||
builder.Append($"`{ColNamesEnum.DUT_SN}` varchar(32) Not NULL COMMENT '维修产品条码',")
|
||||
builder.Append($"`{ColNamesEnum.ErrCode}` varchar(32) DEFAULT NULL COMMENT '产品错误代码',")
|
||||
builder.Append($"`{ColNamesEnum.RepairType}` int(11) DEFAULT NULL COMMENT '维修原因类型',")
|
||||
builder.Append($"`{ColNamesEnum.RepairComment}` varchar(254) DEFAULT NULL COMMENT '维修人工注释',")
|
||||
builder.Append($"`{ColNamesEnum.RepairDate}` datetime DEFAULT NULL COMMENT '维修产品日期',")
|
||||
builder.Append($"`{ColNamesEnum.RepairResult}` bit(1) Not NULL DEFAULT 0 COMMENT '维修产品结果',")
|
||||
builder.Append($"`{ColNamesEnum.ProductImg1}` varchar(64) DEFAULT NULL COMMENT '产品图像文件名1',")
|
||||
builder.Append($"`{ColNamesEnum.ProductImg2}` varchar(64) DEFAULT NULL COMMENT '产品图像文件名2',")
|
||||
builder.Append($"`{ColNamesEnum.ProductImg3}` varchar(64) DEFAULT NULL COMMENT '产品图像文件名3',")
|
||||
builder.Append($"`{ColNamesEnum.ProductImg4}` varchar(64) DEFAULT NULL COMMENT '产品图像文件名4',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNamesEnum.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End NameSpace
|
||||
161
UTS_Core/UTSModule/DbTableModel/Customer/RepairLogTable.vb
Normal file
161
UTS_Core/UTSModule/DbTableModel/Customer/RepairLogTable.vb
Normal file
@@ -0,0 +1,161 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
Public Class RepairLogTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 维修日志索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 维修产品索引
|
||||
''' </summary>
|
||||
ProductID
|
||||
|
||||
''' <summary>
|
||||
''' 所属站位索引
|
||||
''' </summary>
|
||||
StationID
|
||||
|
||||
''' <summary>
|
||||
''' 所属订单索引
|
||||
''' </summary>
|
||||
OrderID
|
||||
|
||||
''' <summary>
|
||||
''' 维修所属测试日志索引
|
||||
''' </summary>
|
||||
TestLogID
|
||||
|
||||
''' <summary>
|
||||
''' 维修产品条码
|
||||
''' </summary>
|
||||
DUT_SN
|
||||
|
||||
''' <summary>
|
||||
''' 测试日志所属测试流程名称
|
||||
''' </summary>
|
||||
TestPlan
|
||||
|
||||
''' <summary>
|
||||
''' 产品测试日志失败步骤名
|
||||
''' </summary>
|
||||
FailSteps
|
||||
|
||||
''' <summary>
|
||||
''' 产品测试日志失败信息
|
||||
''' </summary>
|
||||
FailMsg
|
||||
|
||||
''' <summary>
|
||||
''' 产品测试日志错误代码
|
||||
''' </summary>
|
||||
ErrCode
|
||||
|
||||
''' <summary>
|
||||
''' 维修产品日期
|
||||
''' </summary>
|
||||
RepairDate
|
||||
|
||||
''' <summary>
|
||||
''' 当条记录更新时间
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 维修原因类型
|
||||
''' </summary>
|
||||
RepairType
|
||||
|
||||
''' <summary>
|
||||
''' 维修原因
|
||||
''' </summary>
|
||||
RepairReason
|
||||
|
||||
''' <summary>
|
||||
''' 维修来源
|
||||
''' </summary>
|
||||
RepairSource
|
||||
|
||||
''' <summary>
|
||||
''' 维修来源订单号
|
||||
''' </summary>
|
||||
DocuNumber
|
||||
|
||||
''' <summary>
|
||||
''' 维修人工注释
|
||||
''' </summary>
|
||||
RepairComment
|
||||
|
||||
''' <summary>
|
||||
''' 维修产品结果索引
|
||||
''' </summary>
|
||||
RepairResult
|
||||
|
||||
''' <summary>
|
||||
''' 产品图像文件名1
|
||||
''' </summary>
|
||||
ProductImg1
|
||||
|
||||
''' <summary>
|
||||
''' 产品图像文件名2
|
||||
''' </summary>
|
||||
ProductImg2
|
||||
|
||||
''' <summary>
|
||||
''' 产品图像文件名3
|
||||
''' </summary>
|
||||
ProductImg3
|
||||
|
||||
''' <summary>
|
||||
''' 产品图像文件名4
|
||||
''' </summary>
|
||||
ProductImg4
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_RepairLog"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '维修日志索引',")
|
||||
builder.Append($"`{ColNames.ProductID}` int(11) Not NULL COMMENT '维修产品索引',")
|
||||
builder.Append($"`{ColNames.StationID}` int(11) Not NULL COMMENT '站位索引',")
|
||||
builder.Append($"`{ColNames.OrderID}` int(11) Not NULL COMMENT '订单索引',")
|
||||
builder.Append($"`{ColNames.TestLogID}` int(11) Not NULL COMMENT '测试记录索引',")
|
||||
builder.Append($"`{ColNames.DUT_SN}` varchar(64) NOT NULL COMMENT '维修产品条码',")
|
||||
builder.Append($"`{ColNames.TestPlan}` varchar(64) DEFAULT NULL COMMENT '测试流程名称',")
|
||||
builder.Append($"`{ColNames.FailSteps}` varchar(254) DEFAULT NULL COMMENT '错误步骤',")
|
||||
builder.Append($"`{ColNames.FailMsg}` varchar(254) DEFAULT NULL COMMENT '错误提示信息',")
|
||||
builder.Append($"`{ColNames.ErrCode}` varchar(32) DEFAULT NULL COMMENT '产品错误代码',")
|
||||
builder.Append($"`{ColNames.RepairDate}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '维修产品日期',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.RepairType}` int(11) NOT NULL COMMENT '维修类型索引',")
|
||||
builder.Append($"`{ColNames.RepairReason}` int(11) NOT NULL COMMENT '维修原因索引',")
|
||||
builder.Append($"`{ColNames.RepairSource}` int(11) NOT NULL COMMENT '维修来源索引',")
|
||||
builder.Append($"`{ColNames.DocuNumber}` varchar(64) DEFAULT NULL COMMENT '返修来源订单号',")
|
||||
builder.Append($"`{ColNames.RepairComment}` varchar(254) DEFAULT NULL COMMENT '维修人工注释',")
|
||||
builder.Append($"`{ColNames.RepairResult}` int(11) NOT NULL DEFAULT 0 COMMENT '维修产品结果',")
|
||||
builder.Append($"`{ColNames.ProductImg1}` varchar(64) DEFAULT NULL COMMENT '产品图像文件名1',")
|
||||
builder.Append($"`{ColNames.ProductImg2}` varchar(64) DEFAULT NULL COMMENT '产品图像文件名2',")
|
||||
builder.Append($"`{ColNames.ProductImg3}` varchar(64) DEFAULT NULL COMMENT '产品图像文件名3',")
|
||||
builder.Append($"`{ColNames.ProductImg4}` varchar(64) DEFAULT NULL COMMENT '产品图像文件名4',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End NameSpace
|
||||
@@ -0,0 +1,70 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 维修原因类型表
|
||||
''' </summary>
|
||||
Public Class RepairReasonTable
|
||||
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 所属维修分类索引
|
||||
''' </summary>
|
||||
RepairType
|
||||
|
||||
''' <summary>
|
||||
''' 名称
|
||||
''' </summary>
|
||||
Name
|
||||
|
||||
''' <summary>
|
||||
''' 创建日期
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 更新时间
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_RepairReason"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '维修类型索引',")
|
||||
builder.Append($"`{ColNames.RepairType}` int(11) NOT NULL COMMENT '所属维修分类索引',")
|
||||
builder.Append($"`{ColNames.Name}` varchar(254) NOT NULL COMMENT '名称',")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(254) DEFAULT NULL COMMENT '备注',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
130
UTS_Core/UTSModule/DbTableModel/Customer/RepairRequestTable.vb
Normal file
130
UTS_Core/UTSModule/DbTableModel/Customer/RepairRequestTable.vb
Normal file
@@ -0,0 +1,130 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 维修原因类型表
|
||||
''' </summary>
|
||||
Public Class RepairRequestTable
|
||||
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 报修人员
|
||||
''' </summary>
|
||||
UserID
|
||||
|
||||
''' <summary>
|
||||
''' 报修单号
|
||||
''' </summary>
|
||||
RepairRequestNum
|
||||
|
||||
''' <summary>
|
||||
''' 产品类型
|
||||
''' </summary>
|
||||
ProductID
|
||||
|
||||
''' <summary>
|
||||
''' 产品条码
|
||||
''' </summary>
|
||||
Barcode
|
||||
|
||||
''' <summary>
|
||||
''' 产品图像
|
||||
''' </summary>
|
||||
ProductImage
|
||||
|
||||
''' <summary>
|
||||
''' 不良品来源
|
||||
''' </summary>
|
||||
RejectSource
|
||||
|
||||
''' <summary>
|
||||
''' 不良代码
|
||||
''' </summary>
|
||||
RejectCode
|
||||
|
||||
''' <summary>
|
||||
''' 不良说明
|
||||
''' </summary>
|
||||
RejectDesc
|
||||
|
||||
''' <summary>
|
||||
''' 创建日期
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 更新时间
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 维修进度
|
||||
''' </summary>
|
||||
RepairProgress
|
||||
|
||||
''' <summary>
|
||||
''' 维修结果
|
||||
''' </summary>
|
||||
RepairResult
|
||||
|
||||
''' <summary>
|
||||
''' 维修记录索引
|
||||
''' </summary>
|
||||
RepairLogID
|
||||
|
||||
''' <summary>
|
||||
''' 维修人员
|
||||
''' </summary>
|
||||
Repairier
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_RepairRequest"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '维修类型索引',")
|
||||
builder.Append($"`{ColNames.UserID}` int(11) NOT NULL COMMENT '报修人员',")
|
||||
builder.Append($"`{ColNames.RepairRequestNum}` varchar(254) NOT NULL COMMENT '报修单号',")
|
||||
builder.Append($"`{ColNames.ProductID}` int(11) NOT NULL COMMENT '产品类型',")
|
||||
builder.Append($"`{ColNames.Barcode}` varchar(64) NOT NULL COMMENT '产品条码',")
|
||||
builder.Append($"`{ColNames.ProductImage}` varchar(254) DEFAULT NULL COMMENT '产品图像',")
|
||||
builder.Append($"`{ColNames.RejectSource}` varchar(254) DEFAULT NULL COMMENT '不良品来源',")
|
||||
builder.Append($"`{ColNames.RejectCode}` varchar(254) DEFAULT NULL COMMENT '不良代码',")
|
||||
builder.Append($"`{ColNames.RejectDesc}` varchar(254) DEFAULT NULL COMMENT '不良说明',")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.RepairProgress}` varchar(64) DEFAULT NULL COMMENT '维修进度',")
|
||||
builder.Append($"`{ColNames.RepairResult}` int(11) DEFAULT NULL COMMENT '维修结果',")
|
||||
builder.Append($"`{ColNames.RepairLogID}` int(11) DEFAULT NULL COMMENT '维修记录索引',")
|
||||
builder.Append($"`{ColNames.Repairier}` int(11) DEFAULT NULL COMMENT '维修人员',")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(254) DEFAULT NULL COMMENT '备注',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,63 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
|
||||
Public Class RepairResultTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 索引
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 维修结果名称
|
||||
''' </summary>
|
||||
Name
|
||||
|
||||
''' <summary>
|
||||
''' 创建时间
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_RepairResults"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '维修结果索引',")
|
||||
builder.Append($"`{ColNames.Name}` varchar(254) NOT NULL COMMENT '维修结果名称',")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(254) DEFAULT NULL COMMENT '备注',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
@@ -0,0 +1,60 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
|
||||
Public Class RepairSourceTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 维修来源索引
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 维修来源名称
|
||||
''' </summary>
|
||||
Name
|
||||
|
||||
''' <summary>
|
||||
''' 创建时间
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_RepairSource"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '维修来源索引',")
|
||||
builder.Append($"`{ColNames.Name}` varchar(254) NOT NULL COMMENT '维修来源名称',")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(254) DEFAULT NULL COMMENT '备注',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
62
UTS_Core/UTSModule/DbTableModel/Customer/RepairTypesTable.vb
Normal file
62
UTS_Core/UTSModule/DbTableModel/Customer/RepairTypesTable.vb
Normal file
@@ -0,0 +1,62 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 维修原因类型表
|
||||
''' </summary>
|
||||
Public Class RepairTypesTable
|
||||
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 维修类型索引
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 维修类型说明
|
||||
''' </summary>
|
||||
Name
|
||||
|
||||
''' <summary>
|
||||
''' 创建时间
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_RepairTypes"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '维修类型索引',")
|
||||
builder.Append($"`{ColNames.Name}` varchar(254) NOT NULL COMMENT '维修类型名称',")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(254) DEFAULT NULL COMMENT '备注',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
211
UTS_Core/UTSModule/DbTableModel/Customer/SnListTable.vb
Normal file
211
UTS_Core/UTSModule/DbTableModel/Customer/SnListTable.vb
Normal file
@@ -0,0 +1,211 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
Public Class SnListTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 索引
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 订单ID
|
||||
''' </summary>
|
||||
OrderID
|
||||
''' <summary>
|
||||
''' 内部单ID
|
||||
''' </summary>
|
||||
OrderInternalID
|
||||
''' <summary>
|
||||
''' 机型ID
|
||||
''' </summary>
|
||||
ProductID
|
||||
''' <summary>
|
||||
''' 条码
|
||||
''' </summary>
|
||||
BarCode
|
||||
''' <summary>
|
||||
''' 创建时间
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 更新时间
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
''' <summary>
|
||||
''' 条码生成类型
|
||||
''' </summary>
|
||||
SnType
|
||||
|
||||
''' <summary>
|
||||
''' 参与组装条码
|
||||
''' </summary>
|
||||
AssemblySn
|
||||
|
||||
''' <summary>
|
||||
''' 被组装的时间
|
||||
''' </summary>
|
||||
AssemblyTime
|
||||
|
||||
''' <summary>
|
||||
''' 第1站测试时间
|
||||
''' </summary>
|
||||
S1
|
||||
''' <summary>
|
||||
''' 第2站测试时间
|
||||
''' </summary>
|
||||
S2
|
||||
''' <summary>
|
||||
''' 第3站测试时间
|
||||
''' </summary>
|
||||
S3
|
||||
''' <summary>
|
||||
''' 第4站测试时间
|
||||
''' </summary>
|
||||
S4
|
||||
''' <summary>
|
||||
''' 第5站测试时间
|
||||
''' </summary>
|
||||
S5
|
||||
''' <summary>
|
||||
''' 第6站测试时间
|
||||
''' </summary>
|
||||
S6
|
||||
''' <summary>
|
||||
''' 第7站测试时间
|
||||
''' </summary>
|
||||
S7
|
||||
''' <summary>
|
||||
''' 第8站测试时间
|
||||
''' </summary>
|
||||
S8
|
||||
''' <summary>
|
||||
''' 第9站测试时间
|
||||
''' </summary>
|
||||
S9
|
||||
''' <summary>
|
||||
''' 第10站测试时间
|
||||
''' </summary>
|
||||
S10
|
||||
''' <summary>
|
||||
''' 第11站测试时间
|
||||
''' </summary>
|
||||
S11
|
||||
''' <summary>
|
||||
''' 第12站测试时间
|
||||
''' </summary>
|
||||
S12
|
||||
|
||||
''' <summary>
|
||||
''' 第1站测试结果
|
||||
''' </summary>
|
||||
Result1
|
||||
''' <summary>
|
||||
''' 第2站测试结果
|
||||
''' </summary>
|
||||
Result2
|
||||
''' <summary>
|
||||
''' 第3站测试结果
|
||||
''' </summary>
|
||||
Result3
|
||||
''' <summary>
|
||||
''' 第4站测试结果
|
||||
''' </summary>
|
||||
Result4
|
||||
''' <summary>
|
||||
''' 第5站测试结果
|
||||
''' </summary>
|
||||
Result5
|
||||
''' <summary>
|
||||
''' 第6站测试结果
|
||||
''' </summary>
|
||||
Result6
|
||||
''' <summary>
|
||||
''' 第7站测试结果
|
||||
''' </summary>
|
||||
Result7
|
||||
''' <summary>
|
||||
''' 第8站测试结果
|
||||
''' </summary>
|
||||
Result8
|
||||
''' <summary>
|
||||
''' 第9站测试结果
|
||||
''' </summary>
|
||||
Result9
|
||||
''' <summary>
|
||||
''' 第10站测试结果
|
||||
''' </summary>
|
||||
Result10
|
||||
''' <summary>
|
||||
''' 第11站测试结果
|
||||
''' </summary>
|
||||
Result11
|
||||
''' <summary>
|
||||
''' 第12站测试结果
|
||||
''' </summary>
|
||||
Result12
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_SnList"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',")
|
||||
builder.Append($"`{ColNames.OrderID}` int(11) NOT NULL COMMENT '订单ID',")
|
||||
builder.Append($"`{ColNames.OrderInternalID}` int(11) NOT NULL COMMENT '内部单ID',")
|
||||
builder.Append($"`{ColNames.ProductID}` int(11) NOT NULL COMMENT '机型ID',")
|
||||
builder.Append($"`{ColNames.BarCode}` varchar(64) NOT NULL COMMENT '机型ID',")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.SnType}` int(11) NOT NULL DEFAULT 1 COMMENT '条码生成类型',")
|
||||
|
||||
builder.Append($"`{ColNames.AssemblySn}` varchar(254) DEFAULT NULL COMMENT '被组装的条码集合',")
|
||||
builder.Append($"`{ColNames.AssemblyTime}` datetime DEFAULT NULL COMMENT '被组装的时间',")
|
||||
|
||||
builder.Append($"`{ColNames.S1}` datetime DEFAULT NULL COMMENT '第1站测试时间',")
|
||||
builder.Append($"`{ColNames.S2}` datetime DEFAULT NULL COMMENT '第2站测试时间',")
|
||||
builder.Append($"`{ColNames.S3}` datetime DEFAULT NULL COMMENT '第3站测试时间',")
|
||||
builder.Append($"`{ColNames.S4}` datetime DEFAULT NULL COMMENT '第4站测试时间',")
|
||||
builder.Append($"`{ColNames.S5}` datetime DEFAULT NULL COMMENT '第5站测试时间',")
|
||||
builder.Append($"`{ColNames.S6}` datetime DEFAULT NULL COMMENT '第6站测试时间',")
|
||||
builder.Append($"`{ColNames.S7}` datetime DEFAULT NULL COMMENT '第7站测试时间',")
|
||||
builder.Append($"`{ColNames.S8}` datetime DEFAULT NULL COMMENT '第8站测试时间',")
|
||||
builder.Append($"`{ColNames.S9}` datetime DEFAULT NULL COMMENT '第9站测试时间',")
|
||||
builder.Append($"`{ColNames.S10}` datetime DEFAULT NULL COMMENT '第10站测试时间',")
|
||||
builder.Append($"`{ColNames.S11}` datetime DEFAULT NULL COMMENT '第11站测试时间',")
|
||||
builder.Append($"`{ColNames.S12}` datetime DEFAULT NULL COMMENT '第12站测试时间',")
|
||||
|
||||
builder.Append($"`{ColNames.Result1}` tinyint(4) DEFAULT NULL COMMENT '第1站测试结果',")
|
||||
builder.Append($"`{ColNames.Result2}` tinyint(4) DEFAULT NULL COMMENT '第2站测试结果',")
|
||||
builder.Append($"`{ColNames.Result3}` tinyint(4) DEFAULT NULL COMMENT '第3站测试结果',")
|
||||
builder.Append($"`{ColNames.Result4}` tinyint(4) DEFAULT NULL COMMENT '第4站测试结果',")
|
||||
builder.Append($"`{ColNames.Result5}` tinyint(4) DEFAULT NULL COMMENT '第5站测试结果',")
|
||||
builder.Append($"`{ColNames.Result6}` tinyint(4) DEFAULT NULL COMMENT '第6站测试结果',")
|
||||
builder.Append($"`{ColNames.Result7}` tinyint(4) DEFAULT NULL COMMENT '第7站测试结果',")
|
||||
builder.Append($"`{ColNames.Result8}` tinyint(4) DEFAULT NULL COMMENT '第8站测试结果',")
|
||||
builder.Append($"`{ColNames.Result9}` tinyint(4) DEFAULT NULL COMMENT '第9站测试结果',")
|
||||
builder.Append($"`{ColNames.Result10}` tinyint(4) DEFAULT NULL COMMENT '第10站测试结果',")
|
||||
builder.Append($"`{ColNames.Result11}` tinyint(4) DEFAULT NULL COMMENT '第11站测试结果',")
|
||||
builder.Append($"`{ColNames.Result12}` tinyint(4) DEFAULT NULL COMMENT '第12站测试结果',")
|
||||
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
61
UTS_Core/UTSModule/DbTableModel/Customer/SnRulesTable.vb
Normal file
61
UTS_Core/UTSModule/DbTableModel/Customer/SnRulesTable.vb
Normal file
@@ -0,0 +1,61 @@
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 产品需要索引客户订单号表
|
||||
''' </summary>
|
||||
Public Class SnRulesTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 索引,暂无作用
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 客户订单索引
|
||||
''' </summary>
|
||||
OrderID
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 内部订单号
|
||||
''' </summary>
|
||||
OrderInternalID
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 产品索引
|
||||
''' </summary>
|
||||
ProductID
|
||||
|
||||
''' <summary>
|
||||
''' 工作站索引集合以,分割
|
||||
''' </summary>
|
||||
StationIDs
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 创建时间
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' SN前缀
|
||||
''' </summary>
|
||||
Sn_Prefix
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' SN起始号
|
||||
''' </summary>
|
||||
Sn_Start
|
||||
|
||||
''' <summary>
|
||||
''' SN结束号
|
||||
''' </summary>
|
||||
Sn_End
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_SnRules"
|
||||
End Class
|
||||
End NameSpace
|
||||
134
UTS_Core/UTSModule/DbTableModel/Customer/StationListTable.vb
Normal file
134
UTS_Core/UTSModule/DbTableModel/Customer/StationListTable.vb
Normal file
@@ -0,0 +1,134 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 产品工艺站总表
|
||||
''' </summary>
|
||||
Public Class StationListTable
|
||||
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 工艺站索引
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 项目索引
|
||||
''' </summary>
|
||||
ProjectID
|
||||
''' <summary>
|
||||
''' 工艺站名称
|
||||
''' </summary>
|
||||
StationName
|
||||
''' <summary>
|
||||
''' 工艺站类型
|
||||
''' </summary>
|
||||
StationType
|
||||
''' <summary>
|
||||
''' 工艺站序号,从1开始
|
||||
''' </summary>
|
||||
ArtworkOrder
|
||||
''' <summary>
|
||||
''' Sn总表序号
|
||||
''' </summary>
|
||||
SnListOrder
|
||||
''' <summary>
|
||||
''' 工艺站描述
|
||||
''' </summary>
|
||||
StationDesc
|
||||
|
||||
''' <summary>
|
||||
''' 最后更新日期(重复字段等待删除)
|
||||
''' </summary>
|
||||
LastUpdateDate
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 测试记录表名
|
||||
''' </summary>
|
||||
LogTableName
|
||||
''' <summary>
|
||||
''' 预览图片
|
||||
''' </summary>
|
||||
PreviewImage
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
''' <summary>
|
||||
''' 最新测试包名
|
||||
''' </summary>
|
||||
PacketName
|
||||
|
||||
''' <summary>
|
||||
''' 最新包MD5
|
||||
''' </summary>
|
||||
PacketMd5
|
||||
|
||||
''' <summary>
|
||||
''' 当前站位是否有效
|
||||
''' </summary>
|
||||
Isvalid
|
||||
''' <summary>
|
||||
''' 站位条码生成规则,1系统生成,2客户录入
|
||||
''' </summary>
|
||||
SnType
|
||||
|
||||
''' <summary>
|
||||
''' 编辑密码
|
||||
''' </summary>
|
||||
EditPwd
|
||||
|
||||
''' <summary>
|
||||
''' 发布密码
|
||||
''' </summary>
|
||||
ReleasePwd
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_StationList"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '工艺站索引',")
|
||||
builder.Append($"`{ColNames.ProjectID}` int(11) NOT NULL COMMENT '项目ID',")
|
||||
builder.Append($"`{ColNames.StationName}` varchar(128) NOT NULL COMMENT '工艺站名',")
|
||||
builder.Append($"`{ColNames.StationType}` varchar(128) NOT NULL COMMENT '工艺站类型',")
|
||||
builder.Append($"`{ColNames.ArtworkOrder}` int(11) NOT NULL COMMENT '测试站位序号',")
|
||||
builder.Append($"`{ColNames.SnListOrder}` int(11) NOT NULL COMMENT 'SN总表序号',")
|
||||
builder.Append($"`{ColNames.StationDesc}` varchar(128) DEFAULT NULL COMMENT '站位描述',")
|
||||
builder.Append($"`{ColNames.LastUpdateDate}` datetime DEFAULT NULL COMMENT '最后一次更新日期时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"`{ColNames.LogTableName}` varchar(128) DEFAULT NULL COMMENT '测试记录表名',")
|
||||
builder.Append($"`{ColNames.PreviewImage}` mediumblob DEFAULT NULL COMMENT '预览图片',")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(128) DEFAULT NULL COMMENT ' 备注',")
|
||||
builder.Append($"`{ColNames.PacketName}` varchar(128) DEFAULT NULL COMMENT '最新测试包名',")
|
||||
builder.Append($"`{ColNames.PacketMd5}` varchar(32) DEFAULT NULL COMMENT '测试站包MD5值',")
|
||||
builder.Append($"`{ColNames.Isvalid}` tinyint(4) not NULL DEFAULT 1 COMMENT '是否有效',")
|
||||
builder.Append($"`{ColNames.SnType}` int(11) not NULL DEFAULT 1,")
|
||||
builder.Append($"`{ColNames.EditPwd}` varchar(32) DEFAULT NULL COMMENT '编辑密码',")
|
||||
builder.Append($"`{ColNames.ReleasePwd}` varchar(32) DEFAULT NULL COMMENT '发布密码',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,132 @@
|
||||
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
Public Class StationPacketReleaseLogTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 工艺站包索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 项目索引
|
||||
''' </summary>
|
||||
ProjectID
|
||||
|
||||
''' <summary>
|
||||
''' 站位索引
|
||||
''' </summary>
|
||||
StationID
|
||||
|
||||
''' <summary>
|
||||
''' 创建时间
|
||||
''' </summary>
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 更新时间
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
''' <summary>
|
||||
''' 当前包名
|
||||
''' </summary>
|
||||
PacketName
|
||||
|
||||
''' <summary>
|
||||
''' 当前包MD5值
|
||||
''' </summary>
|
||||
PacketMd5
|
||||
|
||||
''' <summary>
|
||||
''' 记录本版本更改内容
|
||||
''' </summary>
|
||||
Description
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 当前包是否有效
|
||||
''' </summary>
|
||||
IsValid
|
||||
|
||||
''' <summary>
|
||||
''' 登录用户索引
|
||||
''' </summary>
|
||||
UserID
|
||||
|
||||
''' <summary>
|
||||
''' 登录用户名称
|
||||
''' </summary>
|
||||
UserName
|
||||
|
||||
''' <summary>
|
||||
''' 发布电脑的公网IP
|
||||
''' </summary>
|
||||
PublicIP
|
||||
|
||||
''' <summary>
|
||||
''' 发布电脑用户名
|
||||
''' </summary>
|
||||
ComputerName
|
||||
|
||||
''' <summary>
|
||||
''' 发布电脑的SID
|
||||
''' </summary>
|
||||
SID
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_TP_Release_Log"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT '工艺站包索引',")
|
||||
builder.Append($"`{ColNames.ProjectID}` int(11) NOT NULL COMMENT '项目ID',")
|
||||
builder.Append($"`{ColNames.StationID}` int(11) NOT NULL COMMENT '站位索引',")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
|
||||
builder.Append($"`{ColNames.Description}` text NOT NULL COMMENT '版本说明',")
|
||||
builder.Append($"`{ColNames.Remark}` varchar(128) DEFAULT NULL COMMENT ' 备注',")
|
||||
builder.Append($"`{ColNames.PacketName}` varchar(128) NOT NULL COMMENT '工艺站包包名',")
|
||||
builder.Append($"`{ColNames.PacketMd5}` varchar(32) NOT NULL COMMENT '工艺站包MD5值',")
|
||||
builder.Append($"`{ColNames.IsValid}` tinyint(4) NOT NULL DEFAULT 1 COMMENT '是否有效',")
|
||||
|
||||
builder.Append($"`{ColNames.UserID}` int(11) NOT NULL COMMENT '登录用户索引',")
|
||||
builder.Append($"`{ColNames.UserName}` varchar(254) NOT NULL COMMENT '登录用户名称',")
|
||||
builder.Append($"`{ColNames.PublicIP}` varchar(64) NOT NULL COMMENT '发布电脑的公网IP',")
|
||||
builder.Append($"`{ColNames.ComputerName}` varchar(254) NOT NULL COMMENT '发布电脑用户名',")
|
||||
builder.Append($"`{ColNames.SID}` varchar(64) NOT NULL COMMENT '发布电脑的SID',")
|
||||
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
|
||||
212
UTS_Core/UTSModule/DbTableModel/Customer/SyncListTable.vb
Normal file
212
UTS_Core/UTSModule/DbTableModel/Customer/SyncListTable.vb
Normal file
@@ -0,0 +1,212 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 用户数据库同步总表
|
||||
''' </summary>
|
||||
Public Class SyncListTable
|
||||
Enum ColNamesEnum
|
||||
ID
|
||||
''' <summary>
|
||||
''' 需要同步的数据表名
|
||||
''' </summary>
|
||||
TableName
|
||||
''' <summary>
|
||||
''' 数据表版本编号
|
||||
''' </summary>
|
||||
RevisionID
|
||||
''' <summary>
|
||||
''' 最近同步的本地时间
|
||||
''' </summary>
|
||||
SyncTime
|
||||
''' <summary>
|
||||
''' 同步类型,如全表下载(all),或是增量下载(new)
|
||||
''' </summary>
|
||||
SyncType
|
||||
''' <summary>
|
||||
''' 同步时需要更新的数据列
|
||||
''' </summary>
|
||||
SyncCols
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_SyncList"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 根据数据库类型,返回建表语句
|
||||
''' </summary>
|
||||
''' <param name="dbType">数据库类型</param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function CreateTableString(dbType As DbExecutor.DbTypeEnum) As String
|
||||
Dim createStr As New StringBuilder
|
||||
Select Case dbType
|
||||
Case DbExecutor.DbTypeEnum.Sqlite
|
||||
createStr.Append($"Create Table If Not Exists `{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.TableName}` varchar(254) NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.RevisionID}` integer NOT NULL Default 0 ,")
|
||||
createStr.Append($"`{ColNamesEnum.SyncTime}` dateTime NOT NULL DEFAULT '2000-01-01 00:00:00' ,")
|
||||
createStr.Append($"`{ColNamesEnum.SyncType}` varchar(254) NOT NULL DEFAULT 'ALL' ,")
|
||||
createStr.Append($"`{ColNamesEnum.SyncCols}` varchar(254) NOT NULL DEFAULT '*' ")
|
||||
createStr.Append(" );")
|
||||
Case DbExecutor.DbTypeEnum.Mysql
|
||||
createStr.Append($"Create Table If Not Exists `{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` int(11) Not NULL AUTO_INCREMENT,")
|
||||
createStr.Append($"`{ColNamesEnum.TableName}` varchar(254) Not NULL COMMENT '需同步的表名',")
|
||||
createStr.Append($"`{ColNamesEnum.RevisionID}` int(11) Not NULL DEFAULT 0 COMMENT '表版本编号',")
|
||||
createStr.Append($"`{ColNamesEnum.SyncType}` varchar(254) NOT NULL DEFAULT 'ALL' COMMENT '同步类型',")
|
||||
createStr.Append($"`{ColNamesEnum.SyncCols}` varchar(254) NOT NULL DEFAULT '*' COMMENT '同步列名',")
|
||||
createStr.Append($"PRIMARY KEY (`ID`)")
|
||||
createStr.Append(" );")
|
||||
Case Else
|
||||
Throw New Exception($"Invalid db type:{dbType}")
|
||||
End Select
|
||||
|
||||
Return createStr.ToString()
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim createStr As New StringBuilder
|
||||
Select Case dbType
|
||||
Case DbExecutor.DbTypeEnum.Sqlite
|
||||
createStr.Append($"Create Table If Not Exists `{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.TableName}` varchar(254) NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.RevisionID}` integer NOT NULL Default 0 ,")
|
||||
createStr.Append($"`{ColNamesEnum.SyncTime}` dateTime NOT NULL DEFAULT '2000-01-01 00:00:00' ,")
|
||||
createStr.Append($"`{ColNamesEnum.SyncType}` varchar(254) NOT NULL DEFAULT 'ALL' ,")
|
||||
createStr.Append($"`{ColNamesEnum.SyncCols}` varchar(254) NOT NULL DEFAULT '*' ")
|
||||
createStr.Append(" );")
|
||||
Case DbExecutor.DbTypeEnum.Mysql
|
||||
createStr.Append($"Create Table If Not Exists `{dbName}`.`{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` int(11) Not NULL AUTO_INCREMENT,")
|
||||
createStr.Append($"`{ColNamesEnum.TableName}` varchar(254) Not NULL COMMENT '需同步的表名',")
|
||||
createStr.Append($"`{ColNamesEnum.RevisionID}` int(11) Not NULL DEFAULT 0 COMMENT '表版本编号',")
|
||||
createStr.Append($"`{ColNamesEnum.SyncType}` varchar(254) NOT NULL DEFAULT 'ALL' COMMENT '同步类型',")
|
||||
createStr.Append($"`{ColNamesEnum.SyncCols}` varchar(254) NOT NULL DEFAULT '*' COMMENT '同步列名',")
|
||||
createStr.Append($"PRIMARY KEY (`ID`)")
|
||||
createStr.Append(" );")
|
||||
Case Else
|
||||
Throw New Exception($"Invalid db type:{dbType}")
|
||||
End Select
|
||||
|
||||
Return createStr.ToString()
|
||||
End Function
|
||||
|
||||
Public Shared Function SyncTrigger(dbName As String, tbName As String) As String
|
||||
Dim builder As New StringBuilder
|
||||
builder.Append(DbAfterDeleteDataTrigger(dbName, tbName))
|
||||
builder.Append(DbAfterInsertDataTrigger(dbName, tbName))
|
||||
' builder.Append(DbAfterUpdateDataTrigger(dbName, tbName))
|
||||
builder.Append(DbBeforUpdateDataTrigger(dbName, tbName))
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 添加需要同步的数据表名至同步表中
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tbName">需要同步的数据表名</param>
|
||||
''' <param name="syncType">同步类型,all为全表下载,new为增量下载</param>
|
||||
''' <param name="syncCols">同步时下载的字段,默认为*全字段下载</param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function AddSyncTableString(dbName As String, tbName As String,Optional syncType As String = "all",Optional syncCols As String = "*") As String
|
||||
Dim builder As New StringBuilder
|
||||
builder.Append($"Delete from `{dbName}`.`{TableName}` where `{ColNamesEnum.TableName}` = '{tbName}';")
|
||||
builder.Append($"Insert Into `{dbName}`.`{TableName}` (`{ColNamesEnum.TableName}`,`{ColNamesEnum.SyncType}`,`{ColNamesEnum.SyncCols}`) values ('{tbName}','{syncType}','{syncCols}');")
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 数据库连接涉及多库操作时,新增数据后更新触发器
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tbName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function DbAfterInsertDataTrigger(dbName As String, tbName As String) As String
|
||||
Dim triggerString As New StringBuilder
|
||||
triggerString.Append($"Create Trigger If Not Exists `{dbName}`.`{tbName}_AfterInsert` ")
|
||||
triggerString.Append($"After Insert On `{dbName}`.`{tbName}` ")
|
||||
triggerString.Append($"For Each Row ")
|
||||
triggerString.Append($"Begin ")
|
||||
|
||||
triggerString.Append($"UPDATE `{dbName}`.`{TableName}` SET `{ColNamesEnum.RevisionID}` = (`{ColNamesEnum.RevisionID}` + 1) where `{ColNamesEnum.TableName}` = '{tbName}';")
|
||||
|
||||
triggerString.Append($"End;")
|
||||
|
||||
Return triggerString.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 数据库连接涉及多库操作时,更新数据后更新触发器
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tbName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function DbAfterUpdateDataTrigger(dbName As String, tbName As String) As String
|
||||
Dim triggerString As New StringBuilder
|
||||
triggerString.Append($"Create Trigger If Not Exists `{dbName}`.`{tbName}_AfterUpdate` ")
|
||||
triggerString.Append($"After Update On `{dbName}`.`{tbName}` ")
|
||||
triggerString.Append($"For Each Row ")
|
||||
triggerString.Append($"Begin ")
|
||||
|
||||
triggerString.Append($"Set NEW.UpdateTime = NOW();")
|
||||
triggerString.Append($"UPDATE `{dbName}`.`{TableName}` SET `{ColNamesEnum.RevisionID}` = (`{ColNamesEnum.RevisionID}` + 1) where `{ColNamesEnum.TableName}` = '{tbName}';")
|
||||
|
||||
triggerString.Append($"End;")
|
||||
|
||||
Return triggerString.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 数据库连接涉及多库操作时,更新数据后更新触发器
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tbName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function DbBeforUpdateDataTrigger(dbName As String, tbName As String) As String
|
||||
Dim triggerString As New StringBuilder
|
||||
triggerString.Append($"Create Trigger If Not Exists `{dbName}`.`{tbName}_BeforeUpdate` ")
|
||||
triggerString.Append($"Before Update On `{dbName}`.`{tbName}` ")
|
||||
triggerString.Append($"For Each Row ")
|
||||
triggerString.Append($"Begin ")
|
||||
|
||||
triggerString.Append($"Set NEW.UpdateTime = NOW();")
|
||||
triggerString.Append($"UPDATE `{dbName}`.`{TableName}` SET `{ColNamesEnum.RevisionID}` = (`{ColNamesEnum.RevisionID}` + 1) where `{ColNamesEnum.TableName}` = '{tbName}';")
|
||||
|
||||
triggerString.Append($"End;")
|
||||
|
||||
Return triggerString.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 数据库连接涉及多库操作时,删除后更新触发器
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tbName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function DbAfterDeleteDataTrigger(dbName As String, tbName As String) As String
|
||||
Dim triggerString As New StringBuilder
|
||||
triggerString.Append($"Create Trigger If Not Exists `{dbName}`.`{tbName}_AfterDelete` ")
|
||||
triggerString.Append($"After Delete On `{dbName}`.`{tbName}` ")
|
||||
triggerString.Append($"For Each Row ")
|
||||
triggerString.Append($"Begin ")
|
||||
|
||||
triggerString.Append($"UPDATE `{dbName}`.`{TableName}` SET `{ColNamesEnum.RevisionID}` = (`{ColNamesEnum.RevisionID}` + 1) where `{ColNamesEnum.TableName}` = '{tbName}';")
|
||||
|
||||
triggerString.Append($"End;")
|
||||
|
||||
Return triggerString.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
146
UTS_Core/UTSModule/DbTableModel/Customer/TestLogTable.vb
Normal file
146
UTS_Core/UTSModule/DbTableModel/Customer/TestLogTable.vb
Normal file
@@ -0,0 +1,146 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 测试记录表,不同项目不同站表名不同
|
||||
''' </summary>
|
||||
Public Class TestLogTable
|
||||
Enum ColNames
|
||||
ID
|
||||
''' <summary>
|
||||
''' 用户唯一标识
|
||||
''' </summary>
|
||||
UserID
|
||||
|
||||
''' <summary>
|
||||
''' 设备唯一索引
|
||||
''' </summary>
|
||||
ServiceID
|
||||
|
||||
''' <summary>
|
||||
''' 生产线索引
|
||||
''' </summary>
|
||||
ProductionLineID
|
||||
|
||||
''' <summary>
|
||||
''' 内部订单索引
|
||||
''' </summary>
|
||||
OrderID
|
||||
|
||||
''' <summary>
|
||||
''' 应用程序名
|
||||
''' </summary>
|
||||
AppName
|
||||
|
||||
''' <summary>
|
||||
''' 测试流程名
|
||||
''' </summary>
|
||||
TestPlan
|
||||
|
||||
''' <summary>
|
||||
''' 产品SN唯一索引
|
||||
''' </summary>
|
||||
DUT_SN
|
||||
|
||||
''' <summary>
|
||||
''' 测试起始时间
|
||||
''' </summary>
|
||||
StartTime
|
||||
|
||||
''' <summary>
|
||||
''' 测试耗时
|
||||
''' </summary>
|
||||
UsedTime
|
||||
|
||||
''' <summary>
|
||||
''' 测试结果
|
||||
''' </summary>
|
||||
TestResult
|
||||
|
||||
''' <summary>
|
||||
''' 错误代码
|
||||
''' </summary>
|
||||
ErrCode
|
||||
|
||||
''' <summary>
|
||||
''' 失败步骤集合
|
||||
''' </summary>
|
||||
FailSteps
|
||||
|
||||
''' <summary>
|
||||
''' 失败步骤集合
|
||||
''' </summary>
|
||||
FailMsg
|
||||
|
||||
''' <summary>
|
||||
''' 自定义字段,由实际使用中添加字段
|
||||
''' </summary>
|
||||
CustomFiled
|
||||
End Enum
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 数据表名
|
||||
''' </summary>
|
||||
''' <param name="projectIndex">项目索引</param>
|
||||
''' <param name="stationIndex">工艺站索引</param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function TableName(projectIndex As Integer, stationIndex As Integer) As String
|
||||
Return $"TBL_{projectIndex}_{stationIndex}_TestLog"
|
||||
End Function
|
||||
|
||||
Public Shared ReadOnly CustomFiledType As String = $"varchar(16)"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, tableName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim createStr As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Sqlite Then
|
||||
createStr.Append($"Create Table If Not Exists `{tableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNames.ID}` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,")
|
||||
createStr.Append($"`{ColNames.UserID}` INTEGER,")
|
||||
createStr.Append($"`{ColNames.ServiceID}` INTEGER,")
|
||||
createStr.Append($"`{ColNames.AppName}` varchar(64) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.TestPlan}` varchar(128) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.DUT_SN}` varchar(32) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.StartTime}` datetime DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.UsedTime}` double DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.TestResult}` int DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.ErrCode}` varchar(16) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.FailSteps}` varchar(128) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.ProductionLineID}` int DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.OrderID}` int DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.FailMsg}` varchar(254) DEFAULT NULL")
|
||||
createStr.Append(" );")
|
||||
ElseIf dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
createStr.Append($"Create Table If Not Exists `{dbName}`.`{tableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT ,")
|
||||
createStr.Append($"`{ColNames.UserID}` int,")
|
||||
createStr.Append($"`{ColNames.ServiceID}` int,")
|
||||
createStr.Append($"`{ColNames.AppName}` varchar(64) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.TestPlan}` varchar(128) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.DUT_SN}` varchar(32) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.StartTime}` datetime DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.UsedTime}` double DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.TestResult}` tinyint(1) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.ErrCode}` varchar(16) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.FailSteps}` varchar(128) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.ProductionLineID}` int DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.OrderID}` int DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNames.FailMsg}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"PRIMARY KEY (`{ColNames.ID}`)")
|
||||
createStr.Append(" );")
|
||||
Else
|
||||
Throw New Exception($"Unknown Type{dbType}!")
|
||||
End If
|
||||
|
||||
Return createStr.ToString()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,54 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Customer
|
||||
''' <summary>
|
||||
''' 产商的客户总表
|
||||
''' </summary>
|
||||
Public Class VendorCustomerTable
|
||||
Enum ColNames
|
||||
ID
|
||||
|
||||
CustomerAbbr
|
||||
|
||||
CustomerName
|
||||
|
||||
CreateTime
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_Customer"
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim builder As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
builder.Append($"CREATE TABLE If Not Exists `{dbName}`.`{TableName}` ")
|
||||
builder.Append("(")
|
||||
|
||||
builder.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',")
|
||||
builder.Append($"`{ColNames.CustomerAbbr}` varchar(64) NOT NULL COMMENT '客户缩写',")
|
||||
builder.Append($"`{ColNames.CustomerName}` varchar(64) NOT NULL DEFAULT '' COMMENT '客户名称',")
|
||||
builder.Append($"`{ColNames.CreateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',")
|
||||
builder.Append($"`{ColNames.UpdateTime}` datetime NOT NULL DEFAULT current_timestamp() COMMENT '更新时间',")
|
||||
builder.Append($"PRIMARY KEY (`{ColNames.ID}`) ")
|
||||
|
||||
builder.Append(")")
|
||||
builder.Append("ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;")
|
||||
Else
|
||||
Throw New Exception($"{TableName}-Invalid db type :{dbType}")
|
||||
End If
|
||||
|
||||
Return builder.ToString()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End NameSpace
|
||||
59
UTS_Core/UTSModule/DbTableModel/LocalPrivate/CacheTable.vb
Normal file
59
UTS_Core/UTSModule/DbTableModel/LocalPrivate/CacheTable.vb
Normal file
@@ -0,0 +1,59 @@
|
||||
Imports System.Text
|
||||
|
||||
Namespace UTSModule.DbTableModel.LocalPrivate
|
||||
''' <summary>
|
||||
''' 本地未上传记录缓存表
|
||||
''' </summary>
|
||||
Public Class CacheTable
|
||||
''' <summary>数据库操作记录表枚举值</summary>
|
||||
Enum ColNamesEnum
|
||||
|
||||
''' <summary>序列号</summary>
|
||||
ID
|
||||
|
||||
''' <summary>用户名</summary>
|
||||
[Operator]
|
||||
|
||||
''' <summary>日期时间</summary>
|
||||
DateTime
|
||||
|
||||
''' <summary>数据库语句</summary>
|
||||
SqlCmd
|
||||
|
||||
''' <summary>是否已经同步到远程数据库</summary>
|
||||
IsUpload
|
||||
|
||||
''' <summary>同步出错编码</summary>
|
||||
ErrorCode
|
||||
|
||||
''' <summary>同步出错提示</summary>
|
||||
ErrorMessage
|
||||
|
||||
''' <summary>备注</summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared ReadOnly TableName As String = "TBL_Table_CaChe"
|
||||
|
||||
''' <summary>
|
||||
''' Sqlite数据库建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString() As String
|
||||
Dim createStr As New StringBuilder
|
||||
createStr.Append($"Create Table If Not Exists `{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.DateTime}` DateTime NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.Operator }` integer,")
|
||||
createStr.Append($"`{ColNamesEnum.SqlCmd}` text NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.IsUpload }` bit NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.ErrorCode }` varchar(64) ,")
|
||||
createStr.Append($"`{ColNamesEnum.ErrorMessage }` varchar(255) ,")
|
||||
createStr.Append($"`{ColNamesEnum.Remark}` varchar(255)")
|
||||
createStr.Append(" );")
|
||||
Return createStr.ToString()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
85
UTS_Core/UTSModule/DbTableModel/Manage/AppListTable.vb
Normal file
85
UTS_Core/UTSModule/DbTableModel/Manage/AppListTable.vb
Normal file
@@ -0,0 +1,85 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
Public Class AppListTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
'''索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 数据服务索引
|
||||
''' </summary>
|
||||
ServiceID
|
||||
|
||||
''' <summary>
|
||||
''' 软件名
|
||||
''' </summary>
|
||||
AppName
|
||||
|
||||
''' <summary>
|
||||
''' 软件版本
|
||||
''' </summary>
|
||||
AppVersion
|
||||
|
||||
''' <summary>
|
||||
''' 注册日期与时间
|
||||
''' </summary>
|
||||
RegisterDateTime
|
||||
|
||||
''' <summary>
|
||||
''' 最后活动日期与时间
|
||||
''' </summary>
|
||||
LastActiveDateTime
|
||||
|
||||
''' <summary>
|
||||
''' 最后活动信息
|
||||
''' </summary>
|
||||
LastInfomation
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_AppList"
|
||||
|
||||
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim createStr As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Sqlite Then
|
||||
createStr.Append($"Create Table If Not Exists `{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.ServiceID}` int(11) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.AppName}` varchar(254) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.AppVersion}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.LastInfomation}` varchar(254) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.RegisterDateTime}` DateTime DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.LastActiveDateTime}` DateTime DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.Remark}` text DEFAULT NULL ")
|
||||
createStr.Append(" );")
|
||||
ElseIf dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
createStr.Append($"Create Table If Not Exists `{dbName}`.`{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.ServiceID}` int(11) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.AppName}` varchar(254) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.AppVersion}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.LastInfomation}` varchar(254) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.RegisterDateTime}` DateTime DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.LastActiveDateTime}` DateTime DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.Remark}` text DEFAULT NULL ,")
|
||||
createStr.Append($"PRIMARY KEY (`{ColNamesEnum.ID}`)")
|
||||
createStr.Append(" );")
|
||||
Else
|
||||
Throw New Exception($"Unknown Type{dbType}!")
|
||||
End If
|
||||
|
||||
Return createStr.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
106
UTS_Core/UTSModule/DbTableModel/Manage/AppLogTable.vb
Normal file
106
UTS_Core/UTSModule/DbTableModel/Manage/AppLogTable.vb
Normal file
@@ -0,0 +1,106 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
Public Class AppLogTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 数据服务索引
|
||||
''' </summary>
|
||||
ServiceID
|
||||
|
||||
''' <summary>
|
||||
''' 软件名称
|
||||
''' </summary>
|
||||
AppName
|
||||
|
||||
''' <summary>
|
||||
''' App版本
|
||||
''' </summary>
|
||||
AppVersion
|
||||
|
||||
''' <summary>
|
||||
''' 测试项目名
|
||||
''' </summary>
|
||||
ProjectName
|
||||
|
||||
''' <summary>
|
||||
''' 测试站名
|
||||
''' </summary>
|
||||
StationName
|
||||
|
||||
''' <summary>
|
||||
''' 测试流程名
|
||||
''' </summary>
|
||||
TestPlan
|
||||
|
||||
''' <summary>
|
||||
''' 生成日期
|
||||
''' </summary>
|
||||
DateTime
|
||||
|
||||
''' <summary>
|
||||
''' 日志类型
|
||||
''' </summary>
|
||||
LogType
|
||||
|
||||
''' <summary>
|
||||
''' 日志内容
|
||||
''' </summary>
|
||||
LogText
|
||||
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_AppLog"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim createStr As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Sqlite Then
|
||||
createStr.Append($"Create Table If Not Exists `{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.ServiceID}` int(11) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.AppName}` varchar(254) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.AppVersion}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.ProjectName}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.StationName}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.TestPlan}` varchar(254) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.DateTime}` DateTime DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.LogType}` varchar(32) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.LogText}` text DEFAULT NULL ")
|
||||
createStr.Append(" );")
|
||||
ElseIf dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
createStr.Append($"Create Table If Not Exists `{dbName}`.`{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` int(11) NOT NULL AUTO_INCREMENT ,")
|
||||
createStr.Append($"`{ColNamesEnum.ServiceID}` int(11) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.AppName}` varchar(254) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.AppVersion}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.ProjectName}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.StationName}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.TestPlan}` varchar(254) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.DateTime}` DateTime DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.LogType}` varchar(32) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.LogText}` text DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` int(11) NOT NULL AUTO_INCREMENT ,")
|
||||
createStr.Append($"PRIMARY KEY (`{ColNamesEnum.ID}`)")
|
||||
createStr.Append(" );")
|
||||
Else
|
||||
Throw New Exception($"Unknown Type{dbType}!")
|
||||
End If
|
||||
|
||||
Return createStr.ToString()
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
32
UTS_Core/UTSModule/DbTableModel/Manage/CustomerListTable.vb
Normal file
32
UTS_Core/UTSModule/DbTableModel/Manage/CustomerListTable.vb
Normal file
@@ -0,0 +1,32 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 客户总表
|
||||
''' </summary>
|
||||
Public Class CustomerListTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 客户唯一标识
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 客户公司名
|
||||
''' </summary>
|
||||
CustomerName
|
||||
|
||||
''' <summary>
|
||||
''' 创建日期
|
||||
''' </summary>
|
||||
CreateTime
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_Company"
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End NameSpace
|
||||
133
UTS_Core/UTSModule/DbTableModel/Manage/DataServiceListTable.vb
Normal file
133
UTS_Core/UTSModule/DbTableModel/Manage/DataServiceListTable.vb
Normal file
@@ -0,0 +1,133 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
Public Class DataServiceListTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 服务索引唯一值
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 鉴权文件索引
|
||||
''' </summary>
|
||||
LicenseID
|
||||
|
||||
''' <summary>
|
||||
''' 鉴权文件有效日期
|
||||
''' </summary>
|
||||
LicenseValidDateTime
|
||||
|
||||
''' <summary>
|
||||
''' 公司名
|
||||
''' </summary>
|
||||
CompanyName
|
||||
|
||||
''' <summary>
|
||||
''' 服务终端内核
|
||||
''' </summary>
|
||||
TerminalOS
|
||||
|
||||
''' <summary>
|
||||
''' 服务终端类型
|
||||
''' </summary>
|
||||
TerminalType
|
||||
|
||||
''' <summary>
|
||||
''' 服务终端名称
|
||||
''' </summary>
|
||||
TerminalName
|
||||
|
||||
''' <summary>
|
||||
''' 服务自定义标识名称
|
||||
''' </summary>
|
||||
TerminalAlias
|
||||
|
||||
''' <summary>
|
||||
''' 服务MAC地址
|
||||
''' </summary>
|
||||
TerminalMAC
|
||||
|
||||
''' <summary>
|
||||
''' CPU序列号
|
||||
''' </summary>
|
||||
ProcessorId
|
||||
|
||||
''' <summary>
|
||||
''' 服务版本
|
||||
''' </summary>
|
||||
ServiceVersion
|
||||
|
||||
''' <summary>
|
||||
''' 服务注册日期
|
||||
''' </summary>
|
||||
ServiceRegisterDateTime
|
||||
|
||||
''' <summary>
|
||||
'''服务最后活动日期
|
||||
''' </summary>
|
||||
ServiceLastActiveDateTime
|
||||
|
||||
''' <summary>
|
||||
''' 服务是否有效,注册默认有效
|
||||
''' </summary>
|
||||
ServiceValid
|
||||
|
||||
''' <summary>
|
||||
''' 数据服务在线
|
||||
''' </summary>
|
||||
IsOnline
|
||||
|
||||
''' <summary>
|
||||
''' 数据服务在线时间
|
||||
''' </summary>
|
||||
ServiceOnlineDateTime
|
||||
|
||||
''' <summary>
|
||||
''' 数据服务需要人工处理错误信息
|
||||
''' </summary>
|
||||
ErrMsg
|
||||
|
||||
''' <summary>
|
||||
''' 更新服务版本
|
||||
''' </summary>
|
||||
USVer
|
||||
|
||||
''' <summary>
|
||||
''' 更新服务是否在线
|
||||
''' </summary>
|
||||
USIsOnline
|
||||
|
||||
''' <summary>
|
||||
''' 更新服务需要人工处理错误信息
|
||||
''' </summary>
|
||||
USErrMsg
|
||||
|
||||
''' <summary>
|
||||
''' 子网名称
|
||||
''' </summary>
|
||||
BarnchNet
|
||||
|
||||
''' <summary>
|
||||
''' 设备角色
|
||||
''' </summary>
|
||||
Roles
|
||||
|
||||
''' <summary>
|
||||
''' 与子网服务连接状态
|
||||
''' </summary>
|
||||
IsDBProxyConn
|
||||
|
||||
''' <summary>
|
||||
''' 缓存表数量
|
||||
''' </summary>
|
||||
CacheCount
|
||||
|
||||
''' <summary>
|
||||
''' 网上邻居
|
||||
''' </summary>
|
||||
NetworkNeiborhood
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_DataServiceList"
|
||||
|
||||
End Class
|
||||
End NameSpace
|
||||
112
UTS_Core/UTSModule/DbTableModel/Manage/DataServiceLogTable.vb
Normal file
112
UTS_Core/UTSModule/DbTableModel/Manage/DataServiceLogTable.vb
Normal file
@@ -0,0 +1,112 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
Public Class DataServiceLogTable
|
||||
Enum ColNames
|
||||
''' <summary>
|
||||
''' 索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 数据服务索引
|
||||
''' </summary>
|
||||
ServiceID
|
||||
|
||||
''' <summary>
|
||||
''' 数据服务版本
|
||||
''' </summary>
|
||||
ServiceVersion
|
||||
|
||||
''' <summary>
|
||||
''' 更新服务版本
|
||||
''' </summary>
|
||||
UpdateServiceVersion
|
||||
|
||||
''' <summary>
|
||||
''' 厂商名称
|
||||
''' </summary>
|
||||
VendorName
|
||||
|
||||
''' <summary>
|
||||
''' 生成日期与时间
|
||||
''' </summary>
|
||||
DateTime
|
||||
|
||||
''' <summary>
|
||||
''' 公网IP
|
||||
''' </summary>
|
||||
PublicIp
|
||||
|
||||
''' <summary>
|
||||
''' 私网IP
|
||||
''' </summary>
|
||||
PrivateIp
|
||||
|
||||
''' <summary>
|
||||
''' Mac地址
|
||||
''' </summary>
|
||||
Mac
|
||||
|
||||
''' <summary>
|
||||
''' 日志类型
|
||||
''' </summary>
|
||||
LogType
|
||||
|
||||
''' <summary>
|
||||
''' 日志内容
|
||||
''' </summary>
|
||||
LogText
|
||||
End Enum
|
||||
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_DataServiceLog"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(dbName As String, Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim createStr As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Sqlite Then
|
||||
createStr.Append($"Create Table If Not Exists `{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNames.ID}` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,")
|
||||
createStr.Append($"`{ColNames.ServiceID}` int(11) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.ServiceVersion}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.UpdateServiceVersion}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.VendorName}` varchar(254) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.PrivateIp}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.PublicIp}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.DateTime}` DateTime DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.LogType}` varchar(32) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.LogText}` text DEFAULT NULL ")
|
||||
createStr.Append(" );")
|
||||
ElseIf dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
createStr.Append($"Create Table If Not Exists `{dbName}`.`{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT ,")
|
||||
createStr.Append($"`{ColNames.ServiceID}` int(11) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.ServiceVersion}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.UpdateServiceVersion}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.VendorName}` varchar(254) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.PrivateIp}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.PublicIp}` varchar(64) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.DateTime}` DateTime DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.LogType}` varchar(32) DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.LogText}` text DEFAULT NULL ,")
|
||||
createStr.Append($"`{ColNames.ID}` int(11) NOT NULL AUTO_INCREMENT ,")
|
||||
createStr.Append($"PRIMARY KEY (`{ColNames.ID}`)")
|
||||
createStr.Append(" );")
|
||||
Else
|
||||
Throw New Exception($"Unknown Type{dbType}!")
|
||||
End If
|
||||
|
||||
Return createStr.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
39
UTS_Core/UTSModule/DbTableModel/Manage/DbListTable.vb
Normal file
39
UTS_Core/UTSModule/DbTableModel/Manage/DbListTable.vb
Normal file
@@ -0,0 +1,39 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 数据库总表
|
||||
''' </summary>
|
||||
Public Class DbListTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 数据库唯一标识
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 所属公司索引
|
||||
''' </summary>
|
||||
CompanyID
|
||||
''' <summary>
|
||||
''' 数据库名
|
||||
''' </summary>
|
||||
DatabaseName
|
||||
''' <summary>
|
||||
''' 数据库用户名
|
||||
''' </summary>
|
||||
DatabaseUser
|
||||
''' <summary>
|
||||
''' 数据库密码
|
||||
''' </summary>
|
||||
DatabasePassword
|
||||
''' <summary>
|
||||
''' 数据库说明
|
||||
''' </summary>
|
||||
DatabaseDesc
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_DBList"
|
||||
End Class
|
||||
End NameSpace
|
||||
48
UTS_Core/UTSModule/DbTableModel/Manage/DevListTable.vb
Normal file
48
UTS_Core/UTSModule/DbTableModel/Manage/DevListTable.vb
Normal file
@@ -0,0 +1,48 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 设备总表
|
||||
''' </summary>
|
||||
Public Class DevListTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 设备唯一索引
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 设备名称
|
||||
''' </summary>
|
||||
DevName
|
||||
''' <summary>
|
||||
''' 设备类型
|
||||
''' </summary>
|
||||
DevType
|
||||
''' <summary>
|
||||
''' 设备MAC地址
|
||||
''' </summary>
|
||||
MAC
|
||||
''' <summary>
|
||||
''' 首次登陆时间
|
||||
''' </summary>
|
||||
FirstLoginDate
|
||||
''' <summary>
|
||||
''' 末次在线时间
|
||||
''' </summary>
|
||||
LastOnlineDate
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
''' <summary>
|
||||
''' 设备在线状态
|
||||
''' </summary>
|
||||
OnlineStatus
|
||||
''' <summary>
|
||||
''' 是被是否有效
|
||||
''' </summary>
|
||||
Valid
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_DevList"
|
||||
|
||||
End Class
|
||||
End NameSpace
|
||||
52
UTS_Core/UTSModule/DbTableModel/Manage/DevLogTable.vb
Normal file
52
UTS_Core/UTSModule/DbTableModel/Manage/DevLogTable.vb
Normal file
@@ -0,0 +1,52 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 设备日志总表
|
||||
''' </summary>
|
||||
Public Class DevLogTable
|
||||
Enum ColNamesEnum
|
||||
ID
|
||||
''' <summary>
|
||||
''' 设备唯一标识
|
||||
''' </summary>
|
||||
DevID
|
||||
''' <summary>
|
||||
''' 操作时间
|
||||
''' </summary>
|
||||
DateTime
|
||||
''' <summary>
|
||||
''' 公网IP
|
||||
''' </summary>
|
||||
Public_IP
|
||||
''' <summary>
|
||||
''' 内网IP
|
||||
''' </summary>
|
||||
Private_IP
|
||||
''' <summary>
|
||||
''' License文件名
|
||||
''' </summary>
|
||||
LicFileName
|
||||
''' <summary>
|
||||
''' 产生日志的APP名
|
||||
''' </summary>
|
||||
AppName
|
||||
''' <summary>
|
||||
''' App版本号
|
||||
''' </summary>
|
||||
AppVersion
|
||||
''' <summary>
|
||||
''' 测试配置文件名称
|
||||
''' </summary>
|
||||
TestPlan
|
||||
''' <summary>
|
||||
''' 用户唯一标识
|
||||
''' </summary>
|
||||
UserID
|
||||
''' <summary>
|
||||
''' 操作内容
|
||||
''' </summary>
|
||||
Operation
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_DevLog"
|
||||
End Class
|
||||
End NameSpace
|
||||
28
UTS_Core/UTSModule/DbTableModel/Manage/ErrCodeTable.vb
Normal file
28
UTS_Core/UTSModule/DbTableModel/Manage/ErrCodeTable.vb
Normal file
@@ -0,0 +1,28 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 错误代码总表
|
||||
''' </summary>
|
||||
Public Class ErrCodeTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 错误代码唯一标识
|
||||
''' </summary>
|
||||
ErrCode
|
||||
''' <summary>
|
||||
''' 错误提示信息
|
||||
''' </summary>
|
||||
ErrMsg
|
||||
''' <summary>
|
||||
''' 统计图中提示颜色
|
||||
''' </summary>
|
||||
ErrColor
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_ErrCode"
|
||||
|
||||
End Class
|
||||
End NameSpace
|
||||
34
UTS_Core/UTSModule/DbTableModel/Manage/FtpUserTable.vb
Normal file
34
UTS_Core/UTSModule/DbTableModel/Manage/FtpUserTable.vb
Normal file
@@ -0,0 +1,34 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
Public Class FtpUserTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
'''索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 数据服务索引
|
||||
''' </summary>
|
||||
FtpService
|
||||
|
||||
''' <summary>
|
||||
''' 软件名
|
||||
''' </summary>
|
||||
FtpPort
|
||||
|
||||
''' <summary>
|
||||
''' 软件版本
|
||||
''' </summary>
|
||||
FtpUser
|
||||
|
||||
''' <summary>
|
||||
''' 注册日期与时间
|
||||
''' </summary>
|
||||
FtpPassword
|
||||
End Enum
|
||||
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_FtpList"
|
||||
|
||||
End Class
|
||||
End NameSpace
|
||||
33
UTS_Core/UTSModule/DbTableModel/Manage/LicenseListTable.vb
Normal file
33
UTS_Core/UTSModule/DbTableModel/Manage/LicenseListTable.vb
Normal file
@@ -0,0 +1,33 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
Public Class LicenseListTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 索引
|
||||
''' </summary>
|
||||
ID
|
||||
|
||||
''' <summary>
|
||||
''' 公司名称
|
||||
''' </summary>
|
||||
CompanyName
|
||||
|
||||
''' <summary>
|
||||
''' 发布日期
|
||||
''' </summary>
|
||||
ReleaseDate
|
||||
|
||||
''' <summary>
|
||||
''' 有效日期
|
||||
''' </summary>
|
||||
ValidDateTime
|
||||
|
||||
''' <summary>
|
||||
''' 备注
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_LicenseList"
|
||||
|
||||
End Class
|
||||
End NameSpace
|
||||
27
UTS_Core/UTSModule/DbTableModel/Manage/LogTable.vb
Normal file
27
UTS_Core/UTSModule/DbTableModel/Manage/LogTable.vb
Normal file
@@ -0,0 +1,27 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 操作日志表,对公共库的操作记录
|
||||
''' </summary>
|
||||
Public Class LogTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 索引,无作用
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 用户唯一标识
|
||||
''' </summary>
|
||||
UserID
|
||||
''' <summary>
|
||||
''' 操作时间
|
||||
''' </summary>
|
||||
DateTime
|
||||
''' <summary>
|
||||
''' 具体操作内容
|
||||
''' </summary>
|
||||
Operation
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_Log"
|
||||
End Class
|
||||
End NameSpace
|
||||
36
UTS_Core/UTSModule/DbTableModel/Manage/OperationListTable.vb
Normal file
36
UTS_Core/UTSModule/DbTableModel/Manage/OperationListTable.vb
Normal file
@@ -0,0 +1,36 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 功能模块总表
|
||||
''' </summary>
|
||||
Public Class OperationListTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 功能模块唯一索引
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 功能模块名称
|
||||
''' </summary>
|
||||
OperationName
|
||||
''' <summary>
|
||||
''' 功能模块详细说明
|
||||
''' </summary>
|
||||
OperationDesc
|
||||
|
||||
''' <summary>
|
||||
''' 操作级别,读为0,写为1
|
||||
''' </summary>
|
||||
OperationLevel
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_OperationList"
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
11
UTS_Core/UTSModule/DbTableModel/Manage/OrderStatusTable.vb
Normal file
11
UTS_Core/UTSModule/DbTableModel/Manage/OrderStatusTable.vb
Normal file
@@ -0,0 +1,11 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
Public Class OrderStatusTable
|
||||
Enum ColNames
|
||||
ID
|
||||
StatusName
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_OrderStatus"
|
||||
End Class
|
||||
End Namespace
|
||||
107
UTS_Core/UTSModule/DbTableModel/Manage/ServiceLogTable.vb
Normal file
107
UTS_Core/UTSModule/DbTableModel/Manage/ServiceLogTable.vb
Normal file
@@ -0,0 +1,107 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
Public Class ServiceLogTable
|
||||
''' <summary>数据库操作记录表枚举值</summary>
|
||||
Enum ColNamesEnum
|
||||
|
||||
''' <summary>日志索引</summary>
|
||||
ID
|
||||
|
||||
''' <summary>厂商名称</summary>
|
||||
CompanyName
|
||||
|
||||
''' <summary>应用名称</summary>
|
||||
AppName
|
||||
|
||||
''' <summary>应用版本</summary>
|
||||
AppVersion
|
||||
|
||||
''' <summary>日志生成日期与时间</summary>
|
||||
DateTime
|
||||
|
||||
''' <summary>设备公网IP</summary>
|
||||
DevPublicIP
|
||||
|
||||
''' <summary>设备内网IP地址</summary>
|
||||
DevPrivateIP
|
||||
|
||||
''' <summary>设备MAC</summary>
|
||||
DevMac
|
||||
|
||||
''' <summary>设备系统版本</summary>
|
||||
DevOS
|
||||
|
||||
''' <summary>设备名称</summary>
|
||||
DevName
|
||||
|
||||
''' <summary>设备用户名</summary>
|
||||
DevUserName
|
||||
|
||||
''' <summary>设备网络状态</summary>
|
||||
DevOnline
|
||||
|
||||
''' <summary>日志类型</summary>
|
||||
LogType
|
||||
|
||||
''' <summary>日志内容</summary>
|
||||
LogText
|
||||
|
||||
End Enum
|
||||
|
||||
Public Shared ReadOnly TableName As String = "TBL_UTS_Manage_ServiceLog"
|
||||
|
||||
''' <summary>
|
||||
''' Sqlite数据库建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString(Optional dbType As DbExecutor.DbTypeEnum = DbExecutor.DbTypeEnum.Mysql) As String
|
||||
Dim createStr As New StringBuilder
|
||||
If dbType = DbExecutor.DbTypeEnum.Mysql Then
|
||||
|
||||
createStr.Append($"Create Table If Not Exists `{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` NOT NULL AUTO_INCREMENT ,")
|
||||
createStr.Append($"`{ColNamesEnum.CompanyName}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.AppName}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.AppVersion}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DateTime}` DateTime NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.DevPublicIP}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevPrivateIP}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevMac}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevOS}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevName}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevUserName}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevOnline}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.LogType}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.LogText}` text,")
|
||||
createStr.Append($"PRIMARY KEY (`ID`)")
|
||||
createStr.Append(" );")
|
||||
|
||||
ElseIf dbType = DbExecutor.DbTypeEnum.Sqlite Then
|
||||
|
||||
createStr.Append($"Create Table If Not Exists `{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.CompanyName}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.AppName}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.AppVersion}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DateTime}` DateTime NOT NULL ,")
|
||||
createStr.Append($"`{ColNamesEnum.DevPublicIP}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevPrivateIP}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevMac}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevOS}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevName}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevUserName}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.DevOnline}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.LogType}` varchar(254),")
|
||||
createStr.Append($"`{ColNamesEnum.LogText}` text")
|
||||
createStr.Append(" );")
|
||||
End If
|
||||
|
||||
Return createStr.ToString()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
33
UTS_Core/UTSModule/DbTableModel/Manage/SwReleaseLogTable.vb
Normal file
33
UTS_Core/UTSModule/DbTableModel/Manage/SwReleaseLogTable.vb
Normal file
@@ -0,0 +1,33 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
Public Class SwReleaseLogTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 应用程序索引
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 应用程序名
|
||||
''' </summary>
|
||||
SoftwareName
|
||||
''' <summary>
|
||||
''' 发布版本号
|
||||
''' </summary>
|
||||
ReleaseVersion
|
||||
''' <summary>
|
||||
''' 发布日期
|
||||
''' </summary>
|
||||
ReleaseDate
|
||||
''' <summary>
|
||||
''' 发布用户索引
|
||||
''' </summary>
|
||||
UserID
|
||||
''' <summary>
|
||||
''' 发布说明
|
||||
''' </summary>
|
||||
Remark
|
||||
End Enum
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End NameSpace
|
||||
40
UTS_Core/UTSModule/DbTableModel/Manage/SwUpdateTable.vb
Normal file
40
UTS_Core/UTSModule/DbTableModel/Manage/SwUpdateTable.vb
Normal file
@@ -0,0 +1,40 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 程序更新软件表
|
||||
''' </summary>
|
||||
Public Class SwUpdateTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 应用程序索引
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 应用程序名
|
||||
''' </summary>
|
||||
SoftwareName
|
||||
''' <summary>
|
||||
''' 最新版本号
|
||||
''' </summary>
|
||||
LastVersion
|
||||
''' <summary>
|
||||
''' 发布日期
|
||||
''' </summary>
|
||||
ReleaseDate
|
||||
''' <summary>
|
||||
''' 二进制文件
|
||||
''' </summary>
|
||||
BinPackage
|
||||
''' <summary>
|
||||
''' MD5校验码
|
||||
''' </summary>
|
||||
BinPackageMd5
|
||||
''' <summary>
|
||||
''' FTP包名
|
||||
''' </summary>
|
||||
PackageName
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_SwUpdate"
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
54
UTS_Core/UTSModule/DbTableModel/Manage/SyncListTable.vb
Normal file
54
UTS_Core/UTSModule/DbTableModel/Manage/SyncListTable.vb
Normal file
@@ -0,0 +1,54 @@
|
||||
Imports System.Text
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 需要同步下载表名总表
|
||||
''' </summary>
|
||||
Public Class SyncListTable
|
||||
Enum ColNamesEnum
|
||||
ID
|
||||
''' <summary>
|
||||
''' 表名
|
||||
''' </summary>
|
||||
TableName
|
||||
''' <summary>
|
||||
''' 表版本编号
|
||||
''' </summary>
|
||||
RevisionID
|
||||
''' <summary>
|
||||
''' 同步类型
|
||||
''' </summary>
|
||||
SyncType
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_SyncList"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 根据数据库类型,返回建表语句
|
||||
''' </summary>
|
||||
''' <param name="type">数据库类型</param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function CreateString(type As DbExecutor.DbTypeEnum) As String
|
||||
Dim createStr As New StringBuilder
|
||||
Select Case type
|
||||
Case DbExecutor.DbTypeEnum.Sqlite
|
||||
createStr.Append($"Create Table If Not Exists {TableName}")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"{Customer.SyncListTable.ColNamesEnum.ID} INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,")
|
||||
createStr.Append($"{Customer.SyncListTable.ColNamesEnum.TableName} varchar(254) NOT NULL ,")
|
||||
createStr.Append($"{Customer.SyncListTable.ColNamesEnum.RevisionID} integer NOT NULL ,")
|
||||
createStr.Append($"{Customer.SyncListTable.ColNamesEnum.SyncType} varchar(254)")
|
||||
createStr.Append(" );")
|
||||
Case DbExecutor.DbTypeEnum.Mysql
|
||||
|
||||
Case Else
|
||||
|
||||
End Select
|
||||
|
||||
Return createStr.ToString()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
32
UTS_Core/UTSModule/DbTableModel/Manage/TestPlanTipsTable.vb
Normal file
32
UTS_Core/UTSModule/DbTableModel/Manage/TestPlanTipsTable.vb
Normal file
@@ -0,0 +1,32 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 测试计划编辑信息提示
|
||||
''' </summary>
|
||||
Public Class TestPlanTipsTable
|
||||
Enum ColNamesEnum
|
||||
ID
|
||||
''' <summary>
|
||||
''' 列名
|
||||
''' </summary>
|
||||
ColName
|
||||
''' <summary>
|
||||
''' 列类型
|
||||
''' </summary>
|
||||
ColType
|
||||
''' <summary>
|
||||
''' 列描述
|
||||
''' </summary>
|
||||
ColDesc
|
||||
''' <summary>
|
||||
''' 列默认值
|
||||
''' </summary>
|
||||
ColValue
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_TestPlanTips"
|
||||
End Class
|
||||
End NameSpace
|
||||
52
UTS_Core/UTSModule/DbTableModel/Manage/UserListTable.vb
Normal file
52
UTS_Core/UTSModule/DbTableModel/Manage/UserListTable.vb
Normal file
@@ -0,0 +1,52 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 用户总表
|
||||
''' </summary>
|
||||
Public Class UserListTable
|
||||
Enum ColNamesEnum
|
||||
''' <summary>
|
||||
''' 用户ID唯一索引
|
||||
''' </summary>
|
||||
ID
|
||||
''' <summary>
|
||||
''' 用户登陆账号
|
||||
''' </summary>
|
||||
UserName
|
||||
''' <summary>
|
||||
''' 用户密码
|
||||
''' </summary>
|
||||
Password
|
||||
''' <summary>
|
||||
''' 公司索引ID
|
||||
''' </summary>
|
||||
CompanyID
|
||||
|
||||
''' <summary>
|
||||
''' 创建日期
|
||||
''' </summary>
|
||||
CreateTime
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
''' <summary>
|
||||
''' 手机号码
|
||||
''' </summary>
|
||||
Mobile
|
||||
''' <summary>
|
||||
''' 微信号
|
||||
''' </summary>
|
||||
WeiXin
|
||||
''' <summary>
|
||||
''' 邮箱地址
|
||||
''' </summary>
|
||||
Email
|
||||
''' <summary>
|
||||
''' 是否有效
|
||||
''' </summary>
|
||||
IsValid
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_User"
|
||||
End Class
|
||||
End NameSpace
|
||||
@@ -0,0 +1,32 @@
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 用户操作功能权限总表
|
||||
''' </summary>
|
||||
Public Class UserOperationAuthTable
|
||||
Enum ColNamesEnum
|
||||
ID
|
||||
''' <summary>
|
||||
''' 用户唯一标识
|
||||
''' </summary>
|
||||
UserID
|
||||
''' <summary>
|
||||
''' 数据库唯一标识
|
||||
''' </summary>
|
||||
DatabaseID
|
||||
''' <summary>
|
||||
''' 拥有完整权限的功能唯一标识,用,分割
|
||||
''' </summary>
|
||||
FullAccess
|
||||
''' <summary>
|
||||
''' 拥有读写权限的功能唯一标识,用,分割
|
||||
''' </summary>
|
||||
ReadWriteAccess
|
||||
''' <summary>
|
||||
''' 拥有只读权限的功能唯一标识,用,分割
|
||||
''' </summary>
|
||||
ReadOnlyAccess
|
||||
End Enum
|
||||
|
||||
Public Shared Property TableName() As String = "TBL_UTS_Manage_UserAuth_Operation"
|
||||
End Class
|
||||
End NameSpace
|
||||
122
UTS_Core/UTSModule/DbTableModel/Manage/UtsCmdListTable.vb
Normal file
122
UTS_Core/UTSModule/DbTableModel/Manage/UtsCmdListTable.vb
Normal file
@@ -0,0 +1,122 @@
|
||||
Imports System.Text
|
||||
|
||||
Namespace UTSModule.DbTableModel.Manage
|
||||
''' <summary>
|
||||
''' 用户测试命令总表
|
||||
''' </summary>
|
||||
Public Class UtsCmdListTable
|
||||
Enum ColNamesEnum
|
||||
ID
|
||||
CmdType
|
||||
CmdName
|
||||
CmdDesc
|
||||
|
||||
''' <summary>
|
||||
''' 修改日期
|
||||
''' </summary>
|
||||
UpdateTime
|
||||
|
||||
ParamCount
|
||||
|
||||
ParamDesc1
|
||||
ParamType1
|
||||
ParamLower1
|
||||
ParamUpper1
|
||||
ParamValue1
|
||||
|
||||
ParamDesc2
|
||||
ParamType2
|
||||
ParamLower2
|
||||
ParamUpper2
|
||||
ParamValue2
|
||||
|
||||
ParamDesc3
|
||||
ParamType3
|
||||
ParamLower3
|
||||
ParamUpper3
|
||||
ParamValue3
|
||||
|
||||
ParamDesc4
|
||||
ParamType4
|
||||
ParamLower4
|
||||
ParamUpper4
|
||||
ParamValue4
|
||||
|
||||
ParamDesc5
|
||||
ParamType5
|
||||
ParamLower5
|
||||
ParamUpper5
|
||||
ParamValue5
|
||||
|
||||
ParamDesc6
|
||||
ParamType6
|
||||
ParamLower6
|
||||
ParamUpper6
|
||||
ParamValue6
|
||||
End Enum
|
||||
|
||||
Shared ReadOnly Property TableName() As String = "TBL_UTS_Manage_UtsCmdList"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 建表语句
|
||||
''' </summary>
|
||||
''' <returns>建表语句</returns>
|
||||
Public Shared Function CreateTableString() As String
|
||||
Dim createStr As New StringBuilder
|
||||
createStr.Append($"Create Table If Not Exists `{TableName}`")
|
||||
createStr.Append(" (")
|
||||
createStr.Append($"`{ColNamesEnum.ID}` int(11) NOT NULL AUTO_INCREMENT,")
|
||||
createStr.Append($"`{ColNamesEnum.CmdType}` varchar(254) NOT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.CmdName}` varchar(254) NOT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.CmdDesc}` varchar(254) DEFAULT NULL,")
|
||||
|
||||
' createStr.Append($"{ColNamesEnum.ParamName1} varchar(64) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamDesc1}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamType1}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamLower1}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamUpper1}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamValue1}` varchar(254) DEFAULT NULL,")
|
||||
|
||||
' createStr.Append($"{ColNamesEnum.ParamName2} varchar(64) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamDesc2}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamType2}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamLower2}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamUpper2}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamValue2}` varchar(254) DEFAULT NULL,")
|
||||
|
||||
' createStr.Append($"{ColNamesEnum.ParamName3} varchar(64) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamDesc3}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamType3}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamLower3}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamUpper3}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamValue3}` varchar(254) DEFAULT NULL,")
|
||||
|
||||
' createStr.Append($"{ColNamesEnum.ParamName4} varchar(64) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamDesc4}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamType4}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamLower4}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamUpper4}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamValue4}` varchar(254) DEFAULT NULL,")
|
||||
|
||||
' createStr.Append($"{ColNamesEnum.ParamName5} varchar(64) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamDesc5}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamType5}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamLower5}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamUpper5}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamValue5}` varchar(254) DEFAULT NULL,")
|
||||
|
||||
' createStr.Append($"{ColNamesEnum.ParamName6} varchar(64) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamDesc6}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamType6}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamLower6}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamUpper6}` varchar(254) DEFAULT NULL,")
|
||||
createStr.Append($"`{ColNamesEnum.ParamValue6}` varchar(254) DEFAULT NULL,")
|
||||
|
||||
createStr.Append($"PRIMARY KEY (`{ColNamesEnum.ID}`)")
|
||||
createStr.Append(" );")
|
||||
Return createStr.ToString()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
9
UTS_Core/UTSModule/DbTableModel/UtsDataTable.vb
Normal file
9
UTS_Core/UTSModule/DbTableModel/UtsDataTable.vb
Normal file
@@ -0,0 +1,9 @@
|
||||
Imports UTS_Core.Database.DbExecutor
|
||||
|
||||
Namespace UTSModule.DbTableModel
|
||||
MustInherit Class UtsDataTable
|
||||
Public Property TableName() As String
|
||||
|
||||
MustOverride Function CreateTableString(Optional dbName As String = "",Optional type As DbTypeEnum = DbTypeEnum.Mysql) As String
|
||||
End Class
|
||||
End Namespace
|
||||
116
UTS_Core/UTSModule/FtpService.vb
Normal file
116
UTS_Core/UTSModule/FtpService.vb
Normal file
@@ -0,0 +1,116 @@
|
||||
Imports System.Text
|
||||
Imports FluentFTP
|
||||
|
||||
Namespace UTSModule
|
||||
Public Class FtpService
|
||||
Private _ftpUser As String
|
||||
Private _ftpPwd As String
|
||||
Private _ftpPort As Integer
|
||||
Private _ftpHost As String
|
||||
|
||||
Sub New(host As String, port As Integer, user As String, pwd As String)
|
||||
_ftpHost = host
|
||||
_ftpPort = port
|
||||
_ftpUser = user
|
||||
_ftpPwd = pwd
|
||||
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Ftp服务器地址
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property FtpHost As String
|
||||
Get
|
||||
Return _ftpHost
|
||||
End Get
|
||||
Set(value As String)
|
||||
_ftpHost = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Sub OnValidateCertificate(control As FtpClient, e As FtpSslValidationEventArgs)
|
||||
e.Accept = True
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Ftp是否能正常连接,连接正常返回True,连接失败则产生异常
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function CanConnected() As Boolean
|
||||
Dim result As Boolean
|
||||
Using ftpClient As FtpClient = New FtpClient(_ftpHost, _ftpPort, _ftpUser, _ftpPwd)
|
||||
AddHandler ftpClient.ValidateCertificate, AddressOf OnValidateCertificate
|
||||
ftpClient.EncryptionMode = FtpEncryptionMode.None
|
||||
ftpClient.DataConnectionType = FtpDataConnectionType.PASV
|
||||
ftpClient.Encoding = Encoding.UTF8
|
||||
|
||||
ftpClient.Connect()
|
||||
ftpClient.Disconnect()
|
||||
End Using
|
||||
result = True
|
||||
|
||||
Return result
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 文件是否存在
|
||||
''' </summary>
|
||||
''' <param name="path"></param>
|
||||
''' <returns></returns>
|
||||
Public Function FtpFileExists(path As String) As Boolean
|
||||
Dim result As Boolean
|
||||
Using ftpClient As FtpClient = New FtpClient(_ftpHost, _ftpPort, _ftpUser, _ftpPwd)
|
||||
AddHandler ftpClient.ValidateCertificate, AddressOf OnValidateCertificate
|
||||
ftpClient.EncryptionMode = FtpEncryptionMode.None
|
||||
ftpClient.DataConnectionType = FtpDataConnectionType.PASV
|
||||
ftpClient.Encoding = Encoding.UTF8
|
||||
|
||||
ftpClient.Connect()
|
||||
|
||||
result = ftpClient.FileExists(path)
|
||||
|
||||
ftpClient.Disconnect()
|
||||
End Using
|
||||
|
||||
Return result
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 文件上传
|
||||
''' 将本地指定路径压缩包上传到FTP服务器上manager文件夹下
|
||||
''' </summary>
|
||||
Public Sub FtpUpload(remotePath As String, loadPath As String)
|
||||
Using ftpClient As FtpClient = New FtpClient(_ftpHost, _ftpPort, _ftpUser, _ftpPwd)
|
||||
AddHandler ftpClient.ValidateCertificate, AddressOf OnValidateCertificate
|
||||
ftpClient.EncryptionMode = FtpEncryptionMode.None
|
||||
ftpClient.DataConnectionType = FtpDataConnectionType.PASV
|
||||
ftpClient.Encoding = Encoding.UTF8
|
||||
|
||||
ftpClient.Connect()
|
||||
ftpClient.UploadFile(loadPath, remotePath, FtpRemoteExists.Overwrite, True)
|
||||
ftpClient.Disconnect()
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 文件下载
|
||||
''' 从FTP下载压缩包,到本地指定路径
|
||||
''' </summary>
|
||||
Public Sub FtpDownload(remotePath As String, loadPath As String)
|
||||
Using ftpClient As FtpClient = New FtpClient(_ftpHost, _ftpPort, _ftpUser, _ftpPwd)
|
||||
AddHandler ftpClient.ValidateCertificate, AddressOf OnValidateCertificate
|
||||
ftpClient.EncryptionMode = FtpEncryptionMode.None
|
||||
ftpClient.DataConnectionType = FtpDataConnectionType.PASV
|
||||
ftpClient.Encoding = Encoding.UTF8
|
||||
|
||||
ftpClient.Connect()
|
||||
ftpClient.DownloadFile(loadPath, remotePath)
|
||||
ftpClient.Disconnect()
|
||||
End Using
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
5
UTS_Core/UTSModule/IProcessStation.vb
Normal file
5
UTS_Core/UTSModule/IProcessStation.vb
Normal file
@@ -0,0 +1,5 @@
|
||||
Namespace UTSModule
|
||||
Public Interface IProcessStation
|
||||
Sub StationChanged()
|
||||
End Interface
|
||||
End NameSpace
|
||||
6
UTS_Core/UTSModule/IProductionLine.vb
Normal file
6
UTS_Core/UTSModule/IProductionLine.vb
Normal file
@@ -0,0 +1,6 @@
|
||||
Namespace UTSModule
|
||||
Public Interface IProductionLine
|
||||
Sub ProductionLineChanged()
|
||||
|
||||
End Interface
|
||||
End NameSpace
|
||||
9
UTS_Core/UTSModule/IUtsForm.vb
Normal file
9
UTS_Core/UTSModule/IUtsForm.vb
Normal file
@@ -0,0 +1,9 @@
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Namespace UTSModule
|
||||
Public Interface IUtsForm
|
||||
Sub ShowForm(parentControl As Control)
|
||||
|
||||
Sub RemoveForm()
|
||||
End Interface
|
||||
End Namespace
|
||||
35
UTS_Core/UTSModule/IUtsTest.vb
Normal file
35
UTS_Core/UTSModule/IUtsTest.vb
Normal file
@@ -0,0 +1,35 @@
|
||||
Imports UTS_Core.UTSModule.Test
|
||||
Imports UTS_Core.UTSModule.Test.StatusMonitor
|
||||
|
||||
Namespace UTSModule
|
||||
Public Interface IUtsTest
|
||||
|
||||
Sub TestStart(sender As Object, e As EventArgs)
|
||||
|
||||
Sub TestPass(sender As Object, e As EventArgs)
|
||||
|
||||
Sub TestFail(sender As Object, e As TestFailEventArgs)
|
||||
|
||||
Sub TestPause(sender As Object, e As TestPauseEventArgs)
|
||||
|
||||
Sub TestEnd(sender As Object, e As TestEndEventArgs)
|
||||
|
||||
|
||||
|
||||
Sub TestNodeChanged(sender As Object, e As TestNodeChangedEventArgs)
|
||||
|
||||
Sub TestNodeCompleted(sender As Object, e As TestNodeCompletedEventArgs)
|
||||
|
||||
Sub TestNodeResultChanged(sender As Object, e As TestNodeResultChangedEventArgs)
|
||||
|
||||
Sub TestCountChanged(sender As Object, e As TestCountChangedEventArgs)
|
||||
|
||||
Sub TestStatusChanged(sender As Object, e As TestStatusChangedEventArgs)
|
||||
|
||||
Sub TestTimeChanged(sender As Object, e As TestTimeEventArgs)
|
||||
|
||||
Sub TestProgressChanged(sender As Object, e As TestProgressChangedEventArgs)
|
||||
|
||||
Sub RetryProgressChanged(sender As Object, e As TestProgressChangedEventArgs)
|
||||
End Interface
|
||||
End Namespace
|
||||
505
UTS_Core/UTSModule/License/License.vb
Normal file
505
UTS_Core/UTSModule/License/License.vb
Normal file
@@ -0,0 +1,505 @@
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports UTS_Core.DebugLog
|
||||
Imports UTS_Core.Security
|
||||
|
||||
Namespace UTSModule.License
|
||||
|
||||
Public Class License
|
||||
''' <summary> License文件字段枚举 </summary>
|
||||
Private Enum LicenseKeyEnum
|
||||
''' <summary>索引</summary>
|
||||
ID
|
||||
|
||||
''' <summary>客户名</summary>
|
||||
VendorName
|
||||
|
||||
''' <summary>注册日期</summary>
|
||||
AuthorizationDate
|
||||
|
||||
''' <summary>截止日期</summary>
|
||||
ExpirationDate
|
||||
|
||||
''' <summary>管理员账号</summary>
|
||||
DefaultUser
|
||||
|
||||
''' <summary>管理员密码</summary>
|
||||
DefaultPassword
|
||||
|
||||
''' <summary>远程数据库URL或IP</summary>
|
||||
MysqlServer
|
||||
|
||||
''' <summary>远程数据库连接端口</summary>
|
||||
MysqlPort
|
||||
|
||||
''' <summary>远程数据库账号</summary>
|
||||
MysqlUserID
|
||||
|
||||
''' <summary>远程数据库密码</summary>
|
||||
MysqlPassword
|
||||
|
||||
''' <summary>远程数据库私有操作库</summary>
|
||||
MysqlDatabase
|
||||
|
||||
''' <summary>远程数据库共有操作库</summary>
|
||||
PublicDb
|
||||
|
||||
''' <summary>本地数据库存放文件夹</summary>
|
||||
SqliteDir
|
||||
|
||||
''' <summary>本地数据库文件名</summary>
|
||||
SqliteName
|
||||
|
||||
''' <summary>本地数据库密码</summary>
|
||||
SqlitePassword
|
||||
|
||||
''' <summary>Ftp服务器</summary>
|
||||
FtpHost
|
||||
|
||||
''' <summary>Ftp通讯端口</summary>
|
||||
FtpPort
|
||||
|
||||
''' <summary>Ftp通讯账号</summary>
|
||||
FtpUser
|
||||
|
||||
''' <summary>Ftp通讯密码</summary>
|
||||
FtpPwd
|
||||
|
||||
''' <summary>客户MAC地址,锁定|MAC时使用</summary>
|
||||
MAC
|
||||
|
||||
''' <summary>备注</summary>
|
||||
Remark
|
||||
|
||||
''' <summary>UTS版本号</summary>
|
||||
UtsVersion
|
||||
|
||||
''' <summary>签名</summary>
|
||||
Signature
|
||||
End Enum
|
||||
|
||||
''' <summary> License文件校验返回枚举值</summary>
|
||||
Public Enum LicenseCheckCodeEnum
|
||||
|
||||
''' <summary>未找到License</summary>
|
||||
NoLicense
|
||||
|
||||
''' <summary>无法打开License</summary>
|
||||
CantOpenLicense
|
||||
|
||||
''' <summary>无效的License</summary>
|
||||
InvalidLicense
|
||||
|
||||
''' <summary>校验通过</summary>
|
||||
CheckPass
|
||||
End Enum
|
||||
|
||||
|
||||
''' <summary>License校验结果</summary>
|
||||
Public Enum EnLicenseCheckCode
|
||||
''' <summary>校验通过</summary>
|
||||
CheckPass
|
||||
|
||||
''' <summary>无效的客户</summary>
|
||||
InvalidCustomer
|
||||
|
||||
''' <summary>无效的注册日期</summary>
|
||||
InvalidAuthorizationDate
|
||||
|
||||
''' <summary>无效的截止日期</summary>
|
||||
InvalidExpirationDate
|
||||
|
||||
''' <summary>无效的用户</summary>
|
||||
InvalidDefaultUser
|
||||
|
||||
''' <summary>无效的用户密码</summary>
|
||||
InvalidDefaultPassword
|
||||
|
||||
''' <summary>无效的MAC地址</summary>
|
||||
InvalidMac
|
||||
|
||||
''' <summary>无效的UTS版本</summary>
|
||||
InvalidUtsVersion
|
||||
|
||||
''' <summary>无效的签名</summary>
|
||||
InvalidSignature
|
||||
|
||||
''' <summary>无效的数据库地址</summary>
|
||||
InvalidDatabaseServer
|
||||
|
||||
''' <summary>无效的数据库名</summary>
|
||||
InvalidDatabaseName
|
||||
|
||||
''' <summary>无效的数据库用户</summary>
|
||||
InvalidDatabaseUserID
|
||||
|
||||
''' <summary>无效的数据库密码</summary>
|
||||
InvalidDatabaseUserPassword
|
||||
|
||||
''' <summary>无效的数据库端口号</summary>
|
||||
InvalidDatabaseUserPort
|
||||
|
||||
''' <summary>无效的数据库名(sqlite)</summary>
|
||||
InvalidDatabaseFileName
|
||||
|
||||
''' <summary>无效的数据库文件夹名(sqlite)</summary>
|
||||
InvalidDatabaseDirName
|
||||
End Enum
|
||||
|
||||
|
||||
''' <summary>存储License签名校验值</summary>
|
||||
Private ReadOnly _standardSignature As String = "this is a valid license data"
|
||||
|
||||
''' <summary>License密钥</summary>
|
||||
Private ReadOnly _licenseAesKey As String = "8h(*H&-987OygO8yg*yS$&G&aG9*&6g96*&7^RA65s76r*&&G(*(7(Gyg7#7Ff7F*&(*&&^5GHo96tr5ff&*Hphg7665^fyu&uOhj0j[0[(jOIhI&g77FgghO*hhHY"
|
||||
|
||||
Sub New()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Sub New(licensePath As String)
|
||||
ReadLicenseFile(licensePath)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 索引
|
||||
''' </summary>
|
||||
''' <returns>索引</returns>
|
||||
Public Property ID() As String
|
||||
|
||||
''' <summary>
|
||||
''' 获取客户名
|
||||
''' </summary>
|
||||
''' <returns>客户名</returns>
|
||||
Public Property VendorName As String
|
||||
|
||||
''' <summary>
|
||||
''' 获取注册日期
|
||||
''' </summary>
|
||||
''' <returns>注册日期</returns>
|
||||
Public Property AuthorizationDate() As String
|
||||
|
||||
''' <summary>
|
||||
''' 获取截止日期
|
||||
''' </summary>
|
||||
''' <returns>截止日期</returns>
|
||||
Public Property ExpirationDate() As String
|
||||
|
||||
''' <summary>
|
||||
''' 获取管理员账号
|
||||
''' </summary>
|
||||
''' <returns>管理员账号</returns>
|
||||
Public Property DefaultUser() As String
|
||||
|
||||
''' <summary>
|
||||
''' 获取管理员密码
|
||||
''' </summary>
|
||||
''' <returns>管理员密码</returns>
|
||||
Public Property DefaultPassword() As String
|
||||
|
||||
''' <summary>
|
||||
''' 远程数据库URL或IP(待删除字段)
|
||||
''' </summary>
|
||||
''' <returns>远程数据库URL或IP</returns>
|
||||
Public Property MysqlServer() As String
|
||||
|
||||
''' <summary>
|
||||
''' 远程数据库连接端口
|
||||
''' </summary>
|
||||
''' <returns>远程数据库连接端口</returns>
|
||||
Public Property MysqlPort() As String
|
||||
|
||||
''' <summary>
|
||||
''' 远程数据库账号
|
||||
''' </summary>
|
||||
''' <returns>远程数据库账号</returns>
|
||||
Public Property MysqlUserID() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 远程数据库密码
|
||||
''' </summary>
|
||||
''' <returns>远程数据库密码</returns>
|
||||
Public Property MysqlPassword() As String
|
||||
|
||||
''' <summary>
|
||||
''' 远程数据库操作库
|
||||
''' </summary>
|
||||
''' <returns>远程数据库操作库</returns>
|
||||
Public Property MysqlDatabase() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 远程数据库公开库
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property PublicDb() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 本地数据库存放文件夹
|
||||
''' </summary>
|
||||
''' <returns>本地数据库存放文件夹</returns>
|
||||
Public Property SqliteDir() As String
|
||||
|
||||
''' <summary>
|
||||
''' 本地数据库文件名
|
||||
''' </summary>
|
||||
''' <returns>本地数据库文件名</returns>
|
||||
Public Property SqliteName() As String
|
||||
|
||||
''' <summary>
|
||||
''' 本地数据库密码
|
||||
''' </summary>
|
||||
''' <returns>本地数据库密码</returns>
|
||||
Public Property SqlitePassword() As String
|
||||
|
||||
''' <summary>
|
||||
''' Ftp服务器地址(待删除字段)
|
||||
''' </summary>
|
||||
''' <returns>Ftp服务器地址</returns>
|
||||
Public Property FtpHost() As String
|
||||
|
||||
''' <summary>
|
||||
''' Ftp服务器端口
|
||||
''' </summary>
|
||||
''' <returns>Ftp服务器端口</returns>
|
||||
Public Property FtpPort() As String
|
||||
|
||||
''' <summary>
|
||||
''' Ftp服务器用户
|
||||
''' </summary>
|
||||
''' <returns>Ftp服务器用户</returns>
|
||||
Public Property FtpUser() As String
|
||||
|
||||
''' <summary>
|
||||
''' Ftp服务器密码
|
||||
''' </summary>
|
||||
''' <returns>Ftp服务器密码</returns>
|
||||
Public Property FtpPwd() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 获取客户MAC地址
|
||||
''' </summary>
|
||||
''' <returns>客户MAC地址</returns>
|
||||
Public Property Mac() As String
|
||||
|
||||
''' <summary>
|
||||
''' 获取备注
|
||||
''' </summary>
|
||||
''' <returns>备注</returns>
|
||||
Public Property Remark() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 获取UTS版本号
|
||||
''' </summary>
|
||||
''' <returns>UTS版本号</returns>
|
||||
Public Property UtsVersion() As String
|
||||
|
||||
''' <summary>
|
||||
''' 获取签名
|
||||
''' </summary>
|
||||
''' <returns>签名</returns>
|
||||
Public Property Signature() As String
|
||||
|
||||
|
||||
Public Function DealLicenseString(strLicense As String) As Boolean
|
||||
strLicense = strLicense.Replace(vbLf, String.Empty)
|
||||
|
||||
Dim lines() As String = strLicense.Split(Chr(13))
|
||||
For Each line As String In lines
|
||||
If String.IsNullOrWhiteSpace(line) Then Continue For
|
||||
Dim keyValues As String() = line.Split("="c)
|
||||
If keyValues.Length = 2 Then
|
||||
keyValues(0) = keyValues(0).Trim()
|
||||
keyValues(1) = keyValues(1).Trim()
|
||||
InitLicenseField(keyValues(0), keyValues(1))
|
||||
Else
|
||||
Throw New Exception($"ReadLicense Error:{LicenseCheckCodeEnum.InvalidLicense}")
|
||||
End If
|
||||
Next
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub InitLicenseField(key As String, value As String)
|
||||
Dim field As LicenseKeyEnum
|
||||
If [Enum].TryParse(key, field) = False Then
|
||||
ApplicationLog.WriteLog(ApplicationLog.LogTypes.Error, $"Error LicenseField,Key:{key},Value:{value}")
|
||||
Return
|
||||
End If
|
||||
|
||||
Select Case field
|
||||
Case LicenseKeyEnum.ID
|
||||
ID = value
|
||||
Case LicenseKeyEnum.AuthorizationDate
|
||||
AuthorizationDate = value
|
||||
Case LicenseKeyEnum.DefaultPassword
|
||||
DefaultPassword = value
|
||||
Case LicenseKeyEnum.DefaultUser
|
||||
DefaultUser = value
|
||||
Case LicenseKeyEnum.ExpirationDate
|
||||
ExpirationDate = value
|
||||
Case LicenseKeyEnum.MAC
|
||||
Mac = value
|
||||
Case LicenseKeyEnum.Remark
|
||||
Remark = value
|
||||
Case LicenseKeyEnum.Signature
|
||||
Signature = value
|
||||
Case LicenseKeyEnum.UtsVersion
|
||||
UtsVersion = value
|
||||
Case LicenseKeyEnum.VendorName
|
||||
VendorName = value
|
||||
Case LicenseKeyEnum.MysqlServer
|
||||
MysqlServer = value
|
||||
Case LicenseKeyEnum.MysqlPort
|
||||
MysqlPort = value
|
||||
Case LicenseKeyEnum.MysqlUserID
|
||||
MysqlUserID = value
|
||||
Case LicenseKeyEnum.MysqlPassword
|
||||
MysqlPassword = value
|
||||
Case LicenseKeyEnum.MysqlDatabase
|
||||
MysqlDatabase = value
|
||||
Case LicenseKeyEnum.PublicDb
|
||||
PublicDb = value
|
||||
Case LicenseKeyEnum.SqliteDir
|
||||
SqliteDir = value
|
||||
Case LicenseKeyEnum.SqliteName
|
||||
SqliteName = value
|
||||
Case LicenseKeyEnum.SqlitePassword
|
||||
SqlitePassword = value
|
||||
Case LicenseKeyEnum.FtpHost
|
||||
FtpHost = value
|
||||
Case LicenseKeyEnum.FtpPort
|
||||
FtpPort = value
|
||||
Case LicenseKeyEnum.FtpUser
|
||||
FtpUser = value
|
||||
Case LicenseKeyEnum.FtpPwd
|
||||
FtpPwd = value
|
||||
Case Else
|
||||
ApplicationLog.WriteLog(ApplicationLog.LogTypes.Warn, $"Untreated,Key:{key},Value:{value}")
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 读取License文件所有内容,并进行解密,将解密后的内容存入License字典中
|
||||
''' </summary>
|
||||
''' <param name="licensePath">License文件完整路径(含文件名)</param>
|
||||
Public Sub ReadLicenseFile(licensePath As String)
|
||||
If File.Exists(licensePath) = False Then
|
||||
Throw New Exception($"ReadLicense Error:{LicenseCheckCodeEnum.NoLicense}")
|
||||
End If
|
||||
|
||||
Dim strLicense As String = Aes128.DecryptStr(File.ReadAllText(licensePath), _licenseAesKey)
|
||||
DealLicenseString(strLicense)
|
||||
End Sub
|
||||
|
||||
|
||||
Public Function CheckLicense() As Boolean
|
||||
'检测ID字段
|
||||
If String.IsNullOrWhiteSpace(ID) Then
|
||||
Throw New Exception($"Not Found License ID.")
|
||||
End If
|
||||
|
||||
'校验注册日期
|
||||
Dim nowDate As String = Format(Now.Date, "yyyy-MM-dd") & " " & Format(TimeOfDay, "HH:mm:ss")
|
||||
If String.Compare(nowDate, AuthorizationDate, StringComparison.OrdinalIgnoreCase) < 0 Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidAuthorizationDate}")
|
||||
End If
|
||||
|
||||
'校验截止日期
|
||||
If String.Compare(nowDate, ExpirationDate, StringComparison.OrdinalIgnoreCase) > 0 Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidExpirationDate}")
|
||||
End If
|
||||
|
||||
'默认用户
|
||||
If String.IsNullOrWhiteSpace(DefaultUser) Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidDefaultUser}")
|
||||
End If
|
||||
|
||||
'默认用户密码
|
||||
If String.IsNullOrWhiteSpace(DefaultPassword) Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidDefaultPassword}")
|
||||
End If
|
||||
|
||||
'校验签名
|
||||
If String.Compare(Signature, _standardSignature, True) <> 0 Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidSignature}")
|
||||
End If
|
||||
|
||||
'校验数据库URL或IP
|
||||
If String.IsNullOrEmpty(MysqlServer) Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidDatabaseServer}")
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(MysqlDatabase) Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidDatabaseName}")
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(MysqlPort) Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidDatabaseUserPort}")
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(MysqlUserID) Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidDatabaseUserID}")
|
||||
End If
|
||||
|
||||
|
||||
If String.IsNullOrEmpty(MysqlPassword) Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidDatabaseUserPassword}")
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(SqliteDir) Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidDatabaseDirName}")
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(SqliteName) Then
|
||||
Throw New Exception($"{EnLicenseCheckCode.InvalidDatabaseFileName}")
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Sub SaveLicenseFile(licensePath As String)
|
||||
Dim builder As New StringBuilder
|
||||
builder.Append($"{LicenseKeyEnum.ID} = {ID}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.VendorName} = {VendorName}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.AuthorizationDate} = {AuthorizationDate}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.ExpirationDate} = {ExpirationDate}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.DefaultUser} = {DefaultUser}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.DefaultPassword} = {DefaultPassword}{vbCrLf}")
|
||||
|
||||
builder.Append($"{LicenseKeyEnum.MysqlServer} = {MysqlServer }{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.MysqlPort} = {MysqlPort}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.MysqlUserID} = {MysqlUserID}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.MysqlPassword} = {MysqlPassword}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.MysqlDatabase} = {MysqlDatabase}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.PublicDb} = {PublicDb}{vbCrLf}")
|
||||
|
||||
builder.Append($"{LicenseKeyEnum.SqliteDir} = {SqliteDir}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.SqliteName} = {SqliteName}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.SqlitePassword} = {SqlitePassword}{vbCrLf}")
|
||||
|
||||
builder.Append($"{LicenseKeyEnum.FtpHost} = {FtpHost}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.FtpPort} = {FtpPort}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.FtpUser} = {FtpUser}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.FtpPwd} = {FtpPwd}{vbCrLf}")
|
||||
|
||||
builder.Append($"{LicenseKeyEnum.MAC} = {Mac}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.Remark} = {Remark}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.UtsVersion} = {UtsVersion}{vbCrLf}")
|
||||
builder.Append($"{LicenseKeyEnum.Signature} = {Signature }{vbCrLf}")
|
||||
|
||||
Dim strLicense As String = Aes128.EncryptStr(builder.ToString(), _licenseAesKey)
|
||||
|
||||
File.WriteAllText(licensePath, strLicense)
|
||||
'File.WriteAllText(licensePath, licenseString.ToString())
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
237
UTS_Core/UTSModule/License/Server.vb
Normal file
237
UTS_Core/UTSModule/License/Server.vb
Normal file
@@ -0,0 +1,237 @@
|
||||
Imports System.IO
|
||||
Imports UTS_Core.Security
|
||||
|
||||
Namespace UTSModule.License
|
||||
|
||||
''' <summary>
|
||||
''' 类的作用:获取服务器信息
|
||||
''' 创建人员:ML
|
||||
''' Log编号:1
|
||||
''' 修改描述:创建
|
||||
''' 修改日期:2019-10-15
|
||||
''' 修改人员:ML
|
||||
''' </summary>
|
||||
Public Class Server
|
||||
|
||||
''' <summary> Server文件字段枚举 </summary>
|
||||
Private Enum ServerKeyEnum
|
||||
|
||||
''' <summary>客户名</summary>
|
||||
VendorName
|
||||
|
||||
''' <summary>数据库服务器地址</summary>
|
||||
DataSource
|
||||
|
||||
''' <summary>数据库服务器端口</summary>
|
||||
DbPort
|
||||
|
||||
''' <summary>数据库名</summary>
|
||||
Database
|
||||
|
||||
''' <summary>数据库用户名</summary>
|
||||
DbUser
|
||||
|
||||
''' <summary>数据库用户密码</summary>
|
||||
DbPassword
|
||||
|
||||
''' <summary>Ftp地址</summary>
|
||||
FtpHost
|
||||
|
||||
''' <summary>Ftp端口</summary>
|
||||
FtpPort
|
||||
|
||||
''' <summary>Ftp用户名</summary>
|
||||
FtpUser
|
||||
|
||||
''' <summary>Ftp用户密码</summary>
|
||||
FtpPassword
|
||||
|
||||
End Enum
|
||||
|
||||
''' <summary> Server文件校验返回枚举值</summary>
|
||||
Public Enum ServerCheckCodeEnum
|
||||
|
||||
''' <summary>未找到Server</summary>
|
||||
NoServer
|
||||
|
||||
''' <summary>无法打开Server</summary>
|
||||
CantOpenServer
|
||||
|
||||
''' <summary>无效的Server</summary>
|
||||
InvalidServer
|
||||
|
||||
''' <summary>校验通过</summary>
|
||||
CheckPass
|
||||
|
||||
End Enum
|
||||
|
||||
''' <summary>存储Server校验返回值</summary>
|
||||
Private _checkCode As ServerCheckCodeEnum
|
||||
|
||||
''' <summary>存储Server所有信息</summary>
|
||||
Private _server As Dictionary(Of String, String)
|
||||
|
||||
''' <summary>服务器密钥</summary>
|
||||
Private ReadOnly _serverAesKey As String = "^5GHo96tr5ff&*Hphg7665^fyu&uOhj0j[0[(jOIhI&g77FgghO*hhHY8h(*H&-987OygO8yg*yS$&G&aG9*&6g96*&7^RA65s76r*&&G(*(7(Gyg7#7Ff7F*&(*&&^"
|
||||
|
||||
'''<summary>Server所有可用字段</summary>
|
||||
Private ReadOnly _serverKey() As String = {"VendorName", "DataSource", "DataPort", "Database", "DbUser", "DbPassword", "FtpHost", "FtpPort", "FtpUser", "FtpPassword"}
|
||||
|
||||
''' <summary>
|
||||
''' 获取客户名
|
||||
''' </summary>
|
||||
''' <returns>客户名</returns>
|
||||
Public ReadOnly Property VendorName() As String
|
||||
Get
|
||||
Return _server.Item(_serverKey(ServerKeyEnum.VendorName))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 获取服务器名
|
||||
''' </summary>
|
||||
''' <returns>服务器名</returns>
|
||||
Public ReadOnly Property DataSource() As String
|
||||
Get
|
||||
Return _server.Item(_serverKey(ServerKeyEnum.DataSource))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 获取服务器端口
|
||||
''' </summary>
|
||||
''' <returns>服务器端口</returns>
|
||||
Public ReadOnly Property DatabasePort() As String
|
||||
Get
|
||||
Return _server.Item(_serverKey(ServerKeyEnum.DbPort))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 获取数据库名
|
||||
''' </summary>
|
||||
''' <returns>数据库名</returns>
|
||||
Public ReadOnly Property Database() As String
|
||||
Get
|
||||
Return _server.Item(_serverKey(ServerKeyEnum.Database))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 获取数据库用户名
|
||||
''' </summary>
|
||||
''' <returns>数据库用户名</returns>
|
||||
Public ReadOnly Property DatabaseUser() As String
|
||||
Get
|
||||
Return _server.Item(_serverKey(ServerKeyEnum.DbUser))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 获取数据库用户密码
|
||||
''' </summary>
|
||||
''' <returns>数据库用户密码</returns>
|
||||
Public ReadOnly Property DatabasePassword() As String
|
||||
Get
|
||||
Return _server.Item(_serverKey(ServerKeyEnum.DbPassword))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 获取服务器端口
|
||||
''' </summary>
|
||||
''' <returns>服务器端口</returns>
|
||||
Public ReadOnly Property FtpPort() As String
|
||||
Get
|
||||
Return _server.Item(_serverKey(ServerKeyEnum.FtpPort))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 获取数据库名
|
||||
''' </summary>
|
||||
''' <returns>数据库名</returns>
|
||||
Public ReadOnly Property FtpHost() As String
|
||||
Get
|
||||
Return _server.Item(_serverKey(ServerKeyEnum.FtpHost))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 获取数据库用户名
|
||||
''' </summary>
|
||||
''' <returns>数据库用户名</returns>
|
||||
Public ReadOnly Property FtpUser() As String
|
||||
Get
|
||||
Return _server.Item(_serverKey(ServerKeyEnum.FtpUser))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 获取数据库用户密码
|
||||
''' </summary>
|
||||
''' <returns>数据库用户密码</returns>
|
||||
Public ReadOnly Property FtpPassword() As String
|
||||
Get
|
||||
Return _server.Item(_serverKey(ServerKeyEnum.FtpPassword))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 读取Server文件所有内容,并进行解密,将解密后的内容存入Server字典中
|
||||
''' </summary>
|
||||
''' <param name="serverPath">Server文件完整路径(含文件名)</param>
|
||||
''' <returns>读取Server文件的状态</returns>
|
||||
Public Function ReadServerFile(ByVal serverPath As String) As ServerCheckCodeEnum
|
||||
Dim tmp As String
|
||||
Dim fm As FileStream
|
||||
Dim sr As StreamReader
|
||||
If File.Exists(serverPath) Then
|
||||
fm = New FileStream(serverPath, FileMode.Open)
|
||||
sr = New StreamReader(fm)
|
||||
_checkCode = ServerCheckCodeEnum.CheckPass
|
||||
_server = New Dictionary(Of String, String)
|
||||
Try
|
||||
tmp = Aes128.DecryptStr(sr.ReadToEnd, _serverAesKey) 'utf8解密字符串
|
||||
' tmp = ClsAes128.DecryptStr(sr.ReadToEnd, _serverAesKey, Unicode) 'Unicode解密字符串
|
||||
Dim lines() As String = tmp.Split(Chr(13))‘回车切割
|
||||
For i As Integer = 0 To lines.Length - 1
|
||||
tmp = lines(i).Trim(Chr(10))'去除换行
|
||||
Dim str As String() = tmp.Split("="c)
|
||||
If str.Length = 2 Then
|
||||
_server.Add(Trim(str(0)), Trim(str(1)))
|
||||
Debug.Print($"Keys : {_server.Keys.ElementAt(_server.Count - 1)} Value : {_server.Values.ElementAt(_server.Count - 1)}")
|
||||
Else
|
||||
_checkCode = ServerCheckCodeEnum.InvalidServer
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
_checkCode = ServerCheckCodeEnum.InvalidServer
|
||||
Finally
|
||||
fm.Dispose()
|
||||
sr.Close()
|
||||
End Try
|
||||
Else
|
||||
_checkCode = ServerCheckCodeEnum.NoServer
|
||||
End If
|
||||
Return _checkCode
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 校验Server
|
||||
''' </summary>
|
||||
''' <param name="serverPath">Server文件完整路径(含文件名)</param>
|
||||
''' <returns>校验是否通过</returns>
|
||||
Public Function CheckoutServer(ByVal serverPath As String) As ServerCheckCodeEnum
|
||||
If ReadServerFile(serverPath) = ServerCheckCodeEnum.CheckPass Then
|
||||
'校验厂商(根据是否存在厂商数据库校验)
|
||||
If My.Computer.Network.Ping(_server.Item(_serverKey(ServerKeyEnum.DataSource))) Then
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
Return _checkCode
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
9213
UTS_Core/UTSModule/Login/LoginForm.resx
Normal file
9213
UTS_Core/UTSModule/Login/LoginForm.resx
Normal file
File diff suppressed because it is too large
Load Diff
450
UTS_Core/UTSModule/Login/LoginForm.vb
Normal file
450
UTS_Core/UTSModule/Login/LoginForm.vb
Normal file
@@ -0,0 +1,450 @@
|
||||
Imports System.Windows.Forms
|
||||
Imports UTS_Core.My
|
||||
Imports UTS_Core.Security
|
||||
|
||||
Namespace UTSModule.Login
|
||||
Public Class LoginForm
|
||||
Inherits System.Windows.Forms.Form
|
||||
#Region "初始化组件"
|
||||
|
||||
|
||||
Friend WithEvents Label4 As System.Windows.Forms.Label
|
||||
Friend WithEvents CboUserAccount As System.Windows.Forms.ComboBox
|
||||
Friend WithEvents BtnLogin As System.Windows.Forms.Button
|
||||
Friend WithEvents ChkAutoLogin As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents ChkRememb As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents TxtUserPassword As System.Windows.Forms.TextBox
|
||||
Friend WithEvents Label2 As System.Windows.Forms.Label
|
||||
Friend WithEvents Label1 As System.Windows.Forms.Label
|
||||
Friend WithEvents PicLogin As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents TmrAutoLogin As System.Windows.Forms.Timer
|
||||
Friend WithEvents PictureBox1 As PictureBox
|
||||
Friend WithEvents PictureBox2 As PictureBox
|
||||
|
||||
|
||||
|
||||
'Form 重写 Dispose,以清理组件列表。
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Windows 窗体设计器所必需的
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'注意: 以下过程是 Windows 窗体设计器所必需的
|
||||
'可以使用 Windows 窗体设计器修改它。
|
||||
'不要使用代码编辑器修改它。
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(LoginForm))
|
||||
Me.Label4 = New System.Windows.Forms.Label()
|
||||
Me.CboUserAccount = New System.Windows.Forms.ComboBox()
|
||||
Me.BtnLogin = New System.Windows.Forms.Button()
|
||||
Me.ChkAutoLogin = New System.Windows.Forms.CheckBox()
|
||||
Me.ChkRememb = New System.Windows.Forms.CheckBox()
|
||||
Me.TxtUserPassword = New System.Windows.Forms.TextBox()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.PicLogin = New System.Windows.Forms.PictureBox()
|
||||
Me.TmrAutoLogin = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
|
||||
Me.PictureBox2 = New System.Windows.Forms.PictureBox()
|
||||
CType(Me.PicLogin, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'Label4
|
||||
'
|
||||
Me.Label4.Location = New System.Drawing.Point(518, 91)
|
||||
Me.Label4.Name = "Label4"
|
||||
Me.Label4.Size = New System.Drawing.Size(18, 21)
|
||||
Me.Label4.TabIndex = 32
|
||||
Me.Label4.Text = "*"
|
||||
Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||
'
|
||||
'CboUserAccount
|
||||
'
|
||||
Me.CboUserAccount.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
|
||||
Me.CboUserAccount.FormattingEnabled = True
|
||||
Me.CboUserAccount.ImeMode = System.Windows.Forms.ImeMode.Disable
|
||||
Me.CboUserAccount.Location = New System.Drawing.Point(338, 41)
|
||||
Me.CboUserAccount.MaxLength = 20
|
||||
Me.CboUserAccount.Name = "CboUserAccount"
|
||||
Me.CboUserAccount.Size = New System.Drawing.Size(174, 23)
|
||||
Me.CboUserAccount.TabIndex = 0
|
||||
Me.CboUserAccount.Text = "Qizengbiao"
|
||||
'
|
||||
'BtnLogin
|
||||
'
|
||||
Me.BtnLogin.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.BtnLogin.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.BtnLogin.ForeColor = System.Drawing.Color.White
|
||||
Me.BtnLogin.Location = New System.Drawing.Point(304, 162)
|
||||
Me.BtnLogin.Name = "BtnLogin"
|
||||
Me.BtnLogin.Size = New System.Drawing.Size(208, 49)
|
||||
Me.BtnLogin.TabIndex = 2
|
||||
Me.BtnLogin.Text = "登 录"
|
||||
Me.BtnLogin.UseVisualStyleBackColor = True
|
||||
'
|
||||
'ChkAutoLogin
|
||||
'
|
||||
Me.ChkAutoLogin.AutoSize = True
|
||||
Me.ChkAutoLogin.FlatStyle = System.Windows.Forms.FlatStyle.Popup
|
||||
Me.ChkAutoLogin.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
|
||||
Me.ChkAutoLogin.ForeColor = System.Drawing.Color.White
|
||||
Me.ChkAutoLogin.Location = New System.Drawing.Point(314, 134)
|
||||
Me.ChkAutoLogin.Name = "ChkAutoLogin"
|
||||
Me.ChkAutoLogin.Size = New System.Drawing.Size(72, 19)
|
||||
Me.ChkAutoLogin.TabIndex = 28
|
||||
Me.ChkAutoLogin.TabStop = False
|
||||
Me.ChkAutoLogin.Text = "自动登录"
|
||||
Me.ChkAutoLogin.UseVisualStyleBackColor = True
|
||||
'
|
||||
'ChkRememb
|
||||
'
|
||||
Me.ChkRememb.AutoSize = True
|
||||
Me.ChkRememb.FlatStyle = System.Windows.Forms.FlatStyle.Popup
|
||||
Me.ChkRememb.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
|
||||
Me.ChkRememb.ForeColor = System.Drawing.Color.White
|
||||
Me.ChkRememb.Location = New System.Drawing.Point(440, 134)
|
||||
Me.ChkRememb.Name = "ChkRememb"
|
||||
Me.ChkRememb.Size = New System.Drawing.Size(72, 19)
|
||||
Me.ChkRememb.TabIndex = 27
|
||||
Me.ChkRememb.TabStop = False
|
||||
Me.ChkRememb.Text = "记住密码"
|
||||
Me.ChkRememb.UseVisualStyleBackColor = True
|
||||
'
|
||||
'TxtUserPassword
|
||||
'
|
||||
Me.TxtUserPassword.ImeMode = System.Windows.Forms.ImeMode.Disable
|
||||
Me.TxtUserPassword.Location = New System.Drawing.Point(338, 88)
|
||||
Me.TxtUserPassword.MaxLength = 20
|
||||
Me.TxtUserPassword.Name = "TxtUserPassword"
|
||||
Me.TxtUserPassword.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
|
||||
Me.TxtUserPassword.Size = New System.Drawing.Size(174, 21)
|
||||
Me.TxtUserPassword.TabIndex = 1
|
||||
Me.TxtUserPassword.Text = "Actop00803"
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
|
||||
Me.Label2.ForeColor = System.Drawing.Color.White
|
||||
Me.Label2.Location = New System.Drawing.Point(301, 94)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(31, 15)
|
||||
Me.Label2.TabIndex = 25
|
||||
Me.Label2.Text = "密码"
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.BackColor = System.Drawing.Color.Transparent
|
||||
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
|
||||
Me.Label1.ForeColor = System.Drawing.Color.White
|
||||
Me.Label1.Location = New System.Drawing.Point(301, 49)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(31, 15)
|
||||
Me.Label1.TabIndex = 24
|
||||
Me.Label1.Text = "账号"
|
||||
Me.Label1.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'PicLogin
|
||||
'
|
||||
Me.PicLogin.Image = CType(resources.GetObject("PicLogin.Image"), System.Drawing.Image)
|
||||
Me.PicLogin.Location = New System.Drawing.Point(3, 3)
|
||||
Me.PicLogin.Name = "PicLogin"
|
||||
Me.PicLogin.Size = New System.Drawing.Size(275, 242)
|
||||
Me.PicLogin.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
|
||||
Me.PicLogin.TabIndex = 23
|
||||
Me.PicLogin.TabStop = False
|
||||
'
|
||||
'TmrAutoLogin
|
||||
'
|
||||
Me.TmrAutoLogin.Interval = 3000
|
||||
'
|
||||
'PictureBox1
|
||||
'
|
||||
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
|
||||
Me.PictureBox1.Location = New System.Drawing.Point(304, 36)
|
||||
Me.PictureBox1.Name = "PictureBox1"
|
||||
Me.PictureBox1.Size = New System.Drawing.Size(28, 33)
|
||||
Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
|
||||
Me.PictureBox1.TabIndex = 35
|
||||
Me.PictureBox1.TabStop = False
|
||||
'
|
||||
'PictureBox2
|
||||
'
|
||||
Me.PictureBox2.Image = CType(resources.GetObject("PictureBox2.Image"), System.Drawing.Image)
|
||||
Me.PictureBox2.Location = New System.Drawing.Point(304, 79)
|
||||
Me.PictureBox2.Name = "PictureBox2"
|
||||
Me.PictureBox2.Size = New System.Drawing.Size(28, 33)
|
||||
Me.PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
|
||||
Me.PictureBox2.TabIndex = 36
|
||||
Me.PictureBox2.TabStop = False
|
||||
'
|
||||
'LoginForm
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.Color.DodgerBlue
|
||||
Me.ClientSize = New System.Drawing.Size(544, 249)
|
||||
Me.Controls.Add(Me.PictureBox2)
|
||||
Me.Controls.Add(Me.PictureBox1)
|
||||
Me.Controls.Add(Me.Label4)
|
||||
Me.Controls.Add(Me.CboUserAccount)
|
||||
Me.Controls.Add(Me.BtnLogin)
|
||||
Me.Controls.Add(Me.ChkAutoLogin)
|
||||
Me.Controls.Add(Me.ChkRememb)
|
||||
Me.Controls.Add(Me.TxtUserPassword)
|
||||
Me.Controls.Add(Me.Label2)
|
||||
Me.Controls.Add(Me.Label1)
|
||||
Me.Controls.Add(Me.PicLogin)
|
||||
Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 9!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"),System.Drawing.Icon)
|
||||
Me.MaximizeBox = false
|
||||
Me.MinimizeBox = false
|
||||
Me.Name = "LoginForm"
|
||||
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
|
||||
Me.Text = "Form1"
|
||||
CType(Me.PicLogin,System.ComponentModel.ISupportInitialize).EndInit
|
||||
CType(Me.PictureBox1,System.ComponentModel.ISupportInitialize).EndInit
|
||||
CType(Me.PictureBox2,System.ComponentModel.ISupportInitialize).EndInit
|
||||
Me.ResumeLayout(false)
|
||||
Me.PerformLayout
|
||||
|
||||
End Sub
|
||||
|
||||
Sub New()
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
''' <summary>是否记住密码</summary>
|
||||
Private _isRecordPassWord As Boolean
|
||||
|
||||
''' <summary>是否自动登录</summary>
|
||||
Private _isAutoLogin As Boolean
|
||||
|
||||
''' <summary>是否正在登录中</summary>
|
||||
Private _isLogging As Boolean
|
||||
|
||||
|
||||
''' <summary>校验文件信息</summary>
|
||||
Public Property UserLicense As License.License
|
||||
|
||||
''' <summary>用户登录信息</summary>
|
||||
Public Property UserLoginInfo As UserInfo
|
||||
|
||||
|
||||
|
||||
|
||||
''' <summary>修改窗体标题</summary>
|
||||
Private Sub ShowFormTitle()
|
||||
Text = $"{My.Application.Info.ProductName} Login"
|
||||
End Sub
|
||||
|
||||
''' <summary>读取Setting中的缓存量</summary>
|
||||
Private Sub LoadSettings()
|
||||
My.Settings.Reload() '读取Setting中的内容
|
||||
_isAutoLogin = My.Settings.IsAutoLogin
|
||||
_isRecordPassWord = My.Settings.IsRecordPassWord
|
||||
End Sub
|
||||
|
||||
''' <summary>保存Setting中的缓存量</summary>
|
||||
Private Sub SaveSettings()
|
||||
My.Settings.IsAutoLogin = _isAutoLogin
|
||||
My.Settings.IsRecordPassWord = _isRecordPassWord
|
||||
|
||||
If _isRecordPassWord Then
|
||||
Settings.UserAccount = Aes128.EncryptStr(CboUserAccount.Text, Aes128.ServerAesKey)
|
||||
Settings.UserPassword = Aes128.EncryptStr(TxtUserPassword.Text, Aes128.ServerAesKey)
|
||||
Else
|
||||
Settings.UserAccount = String.Empty
|
||||
Settings.UserPassword = String.Empty
|
||||
End If
|
||||
Settings.Save()
|
||||
End Sub
|
||||
|
||||
Private Sub InitChkAutoLogin()
|
||||
ChkAutoLogin.Checked = _isAutoLogin
|
||||
End Sub
|
||||
|
||||
Private Sub InitChkRememb()
|
||||
ChkRememb.Checked = _isRecordPassWord
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 初始化账号控件显示
|
||||
''' </summary>
|
||||
Private Sub InitCboUserAccount()
|
||||
Try
|
||||
CboUserAccount.Text = Aes128.DecryptStr(Settings.UserAccount, Aes128.ServerAesKey)
|
||||
Catch ex As Exception
|
||||
CboUserAccount.Text = String.Empty
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 密码获取与保存机制以后会修改,或加密
|
||||
''' </summary>
|
||||
Private Sub InitTxtUserPassword()
|
||||
Try
|
||||
TxtUserPassword.Text = Aes128.DecryptStr(Settings.UserPassword, Aes128.ServerAesKey)
|
||||
Catch ex As Exception
|
||||
TxtUserPassword.Text = String.Empty
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub InitForm()
|
||||
ShowFormTitle()
|
||||
|
||||
InitChkAutoLogin()
|
||||
InitChkRememb()
|
||||
InitCboUserAccount()
|
||||
InitTxtUserPassword()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CloseTipMessage(tipString As String)
|
||||
MessageBox.Show(tipString, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||||
DialogResult = DialogResult.Abort
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CheckLicense()
|
||||
Try
|
||||
UserLicense = New License.License(UtsRegistry.LicenseFilePath)
|
||||
UserLicense.CheckLicense()
|
||||
|
||||
Catch ex As Exception
|
||||
CloseTipMessage($"Open And Check License Error:{ex.Message}")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub InitConnectParams()
|
||||
If UserLicense Is Nothing Then
|
||||
Throw New Exception($"License Error:Uninitialized License!")
|
||||
End If
|
||||
|
||||
UtsPath.VendorName = UserLicense.VendorName
|
||||
UtsFtp.InitConnectParams(CInt(UserLicense.FtpPort), UserLicense.FtpUser, UserLicense.FtpPwd)
|
||||
UtsDb.InitConnectParams(UserLicense) '根据License信息,初始化数据库连接信息
|
||||
End Sub
|
||||
|
||||
Private Sub LoginForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
LoadSettings()
|
||||
InitForm()
|
||||
|
||||
CheckLicense()
|
||||
InitConnectParams()
|
||||
End Sub
|
||||
|
||||
''' <summary>记住密码复选框状态修改触发事件</summary>
|
||||
Private Sub ChkKeepPwd_CheckedChanged(sender As Object, e As EventArgs) Handles ChkRememb.CheckedChanged
|
||||
_isRecordPassWord = ChkRememb.Checked
|
||||
End Sub
|
||||
|
||||
''' <summary>自动登录复选框状态修改触发事件</summary>
|
||||
Private Sub Chk_AutoLogin_CheckedChanged(sender As Object, e As EventArgs) Handles ChkAutoLogin.CheckedChanged
|
||||
_isAutoLogin = ChkAutoLogin.Checked
|
||||
End Sub
|
||||
|
||||
Private Sub LoginForm_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
SaveSettings()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CheckUserAccount(userAccount As String)
|
||||
If String.IsNullOrWhiteSpace(userAccount) Then
|
||||
Throw New Exception($"请输入用户账号!")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CheckUserPassword(userPassword As String)
|
||||
If String.IsNullOrWhiteSpace(userPassword) Then
|
||||
Throw New Exception($"请输入密码!")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function AdminLogin(userAccount As String, userPassword As String) As Boolean
|
||||
Return userAccount = UserLicense.DefaultUser AndAlso userPassword = UserLicense.DefaultPassword
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 使用账号密码登录
|
||||
''' </summary>
|
||||
Private Sub AccountLogin()
|
||||
Dim userAccount As String = CboUserAccount.Text
|
||||
Dim userPassword As String = TxtUserPassword.Text
|
||||
CheckUserAccount(userAccount)
|
||||
CheckUserPassword(userPassword)
|
||||
|
||||
Dim dtUser As DataTable = DbConnect.DbConnector.UtsGetUserInfo(userAccount, userPassword)
|
||||
UserLoginInfo = New UserInfo(dtUser)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub BtnLogin_Click(sender As Object, e As EventArgs) Handles BtnLogin.Click
|
||||
CloseAutoLogin()
|
||||
If _isLogging Then Return
|
||||
_isLogging = True
|
||||
|
||||
Text = $"{My.Application.Info.ProductName} Login [Logining]"
|
||||
Try
|
||||
AccountLogin() '从云端获取用户信息
|
||||
|
||||
DialogResult = DialogResult.OK
|
||||
Close() '登录完成关闭登录页面
|
||||
Catch ex As Exception
|
||||
Text = $"{My.Application.Info.ProductName} Login [Login failed]"
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly, "登录失败")
|
||||
End Try
|
||||
|
||||
_isLogging = False
|
||||
End Sub
|
||||
|
||||
Private Sub TmrAutoLogin_Tick(sender As Object, e As EventArgs) Handles TmrAutoLogin.Tick
|
||||
BtnLogin.PerformClick()
|
||||
End Sub
|
||||
|
||||
Private Sub LoginForm_Shown(sender As Object, e As EventArgs) Handles Me.Shown
|
||||
If _isAutoLogin Then
|
||||
TmrAutoLogin.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LoginForm_Activated(sender As Object, e As EventArgs) Handles Me.Activated
|
||||
'设置默认焦点控件
|
||||
BtnLogin.Focus()
|
||||
End Sub
|
||||
|
||||
Private Sub TxtUserPassword_TextChanged(sender As Object, e As EventArgs) Handles TxtUserPassword.TextChanged
|
||||
CloseAutoLogin()
|
||||
End Sub
|
||||
|
||||
Private Sub CboUserAccount_TextChanged(sender As Object, e As EventArgs) Handles CboUserAccount.TextChanged
|
||||
CloseAutoLogin()
|
||||
End Sub
|
||||
|
||||
Private Sub CloseAutoLogin()
|
||||
If TmrAutoLogin.Enabled Then
|
||||
TmrAutoLogin.Stop()
|
||||
Text = $"{My.Application.Info.ProductName} Login [Auto Login Cancelled...]"
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
13
UTS_Core/UTSModule/Login/LoginParams.vb
Normal file
13
UTS_Core/UTSModule/Login/LoginParams.vb
Normal file
@@ -0,0 +1,13 @@
|
||||
Namespace UTSModule.Login
|
||||
Public Class LoginParams
|
||||
''' <summary>是否需要显示登陆页面,方便以后编译时,生成不登陆工具</summary>
|
||||
Public Shared IsShowLoginForm As Boolean = True
|
||||
|
||||
''' <summary>是否记住密码</summary>
|
||||
Public Shared IsRecordPassWord As Boolean
|
||||
|
||||
''' <summary>是否自动登录</summary>
|
||||
Public Shared IsAutoLogin As Boolean
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
59
UTS_Core/UTSModule/Login/UserInfo.vb
Normal file
59
UTS_Core/UTSModule/Login/UserInfo.vb
Normal file
@@ -0,0 +1,59 @@
|
||||
Imports UTS_Core.UTSModule.DbTableModel.Manage
|
||||
|
||||
Namespace UTSModule.Login
|
||||
''' <summary>
|
||||
''' 用户信息类
|
||||
''' </summary>
|
||||
Public Class UserInfo
|
||||
Sub New(dataTable As DataTable)
|
||||
If dataTable Is Nothing Then Throw New Exception($"错误的登录信息!")
|
||||
If dataTable.Rows.Count = 0 Then Throw New Exception($"未查询到匹配的账号与密码!")
|
||||
|
||||
InitializeFormDataTable(dataTable)
|
||||
|
||||
If IsValid = False Then Throw New Exception($"账户已冻结!")
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub InitializeFormDataTable(dataTable As DataTable)
|
||||
UserId = CInt(dataTable.Rows(0).Item($"{UserListTable.ColNamesEnum.ID}"))
|
||||
CompanyId = CInt(dataTable.Rows(0).Item($"{UserListTable.ColNamesEnum.CompanyID}"))
|
||||
UserName = dataTable.Rows(0).Item($"{UserListTable.ColNamesEnum.UserName}").ToString
|
||||
PassWord = dataTable.Rows(0).Item($"{UserListTable.ColNamesEnum.Password}").ToString
|
||||
IsValid = CBool(dataTable.Rows(0).Item($"{UserListTable.ColNamesEnum.IsValid}"))
|
||||
Email = dataTable.Rows(0).Item($"{UserListTable.ColNamesEnum.Email}").ToString
|
||||
Mobile = dataTable.Rows(0).Item($"{UserListTable.ColNamesEnum.Mobile}").ToString
|
||||
CreateTime = dataTable.Rows(0).Item($"{UserListTable.ColNamesEnum.CreateTime}").ToString
|
||||
WeChat = dataTable.Rows(0).Item($"{UserListTable.ColNamesEnum.WeiXin}").ToString
|
||||
End Sub
|
||||
|
||||
''' <summary>账号索引</summary>
|
||||
Public Property UserId() As Integer
|
||||
|
||||
''' <summary>公司索引</summary>
|
||||
Public Property CompanyId() As Integer
|
||||
|
||||
''' <summary>获取或设置用户账号</summary>
|
||||
Public Property UserName As String
|
||||
|
||||
''' <summary>获取或设置用户密码</summary>
|
||||
Public Property PassWord As String
|
||||
|
||||
''' <summary>获取或设置用户注册日期</summary>
|
||||
Public Property CreateTime As String
|
||||
|
||||
''' <summary>获取或设置用户电话号码</summary>
|
||||
Public Property Mobile As String
|
||||
|
||||
''' <summary>获取或设置用户微信号</summary>
|
||||
Public Property WeChat As String
|
||||
|
||||
''' <summary>获取或设置用户电子邮箱</summary>
|
||||
Public Property Email As String
|
||||
|
||||
''' <summary>获取或设置用户是否有效</summary>
|
||||
Public Property IsValid As Boolean
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
133
UTS_Core/UTSModule/Production/CustomerOrderManager.vb
Normal file
133
UTS_Core/UTSModule/Production/CustomerOrderManager.vb
Normal file
@@ -0,0 +1,133 @@
|
||||
Imports System.ComponentModel
|
||||
|
||||
Namespace UTSModule.Production
|
||||
Public Enum OrderStatusEnum
|
||||
|
||||
''' <summary>
|
||||
''' 已下单待转内部单
|
||||
''' </summary>
|
||||
<Description("已下单待转M/O")>
|
||||
PlaceOrder = 1
|
||||
|
||||
''' <summary>
|
||||
''' 已转M/O待制条码
|
||||
''' </summary>
|
||||
<Description("已转M/O待制条码")>
|
||||
MOrder = 2
|
||||
|
||||
''' <summary>
|
||||
''' 已制SN待制计划
|
||||
''' </summary>
|
||||
<Description("已制SN待制计划")>
|
||||
SnRules = 3
|
||||
|
||||
''' <summary>
|
||||
''' 已制计划待生产
|
||||
''' </summary>
|
||||
<Description("已制计划待生产")>
|
||||
ProductionPlan = 4
|
||||
|
||||
''' <summary>
|
||||
''' 生产中
|
||||
''' </summary>
|
||||
<Description("生产中")>
|
||||
InProduction = 5
|
||||
|
||||
''' <summary>
|
||||
''' 完成生产
|
||||
''' </summary>
|
||||
<Description("完成生产")>
|
||||
CompleteProduction = 6
|
||||
|
||||
''' <summary>
|
||||
''' 已完成
|
||||
''' </summary>
|
||||
<Description("已完成")>
|
||||
Completed = 7
|
||||
|
||||
''' <summary>
|
||||
''' 取消
|
||||
''' </summary>
|
||||
<Description("取消")>
|
||||
Cancel = -1
|
||||
|
||||
''' <summary>
|
||||
''' 暂停中
|
||||
''' </summary>
|
||||
<Description("暂停中")>
|
||||
Suspend = -2
|
||||
|
||||
End Enum
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 客户订单信息
|
||||
''' </summary>
|
||||
Public Class CustomerOrderManager
|
||||
Sub New()
|
||||
OrderID = -1
|
||||
|
||||
OrderStatus = OrderStatusEnum.Suspend
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 订单索引
|
||||
''' </summary>
|
||||
Public OrderID As Integer
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 订单条码序号字符串
|
||||
''' </summary>
|
||||
Public OrderNo As String
|
||||
|
||||
''' <summary>
|
||||
''' 订单状态
|
||||
''' </summary>
|
||||
|
||||
Public OrderStatus As OrderStatusEnum
|
||||
|
||||
''' <summary>
|
||||
''' 订单总量
|
||||
''' </summary>
|
||||
Public OrderCount As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 订单产品
|
||||
''' </summary>
|
||||
|
||||
Public ProductID As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 订单所属客户索引
|
||||
''' </summary>
|
||||
Public CompanyID As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 订单交期
|
||||
''' </summary>
|
||||
Public DeliveryTime As Date
|
||||
|
||||
''' <summary>
|
||||
''' 订单创建时间
|
||||
''' </summary>
|
||||
Public CreateTime As Date
|
||||
|
||||
''' <summary>
|
||||
''' 成本单价
|
||||
''' </summary>
|
||||
Public CostPrice As Double
|
||||
|
||||
''' <summary>
|
||||
''' 销售单价
|
||||
''' </summary>
|
||||
Public TransactPrice As Double
|
||||
|
||||
|
||||
Public Function IsInitialized() As Boolean
|
||||
If OrderID = -1 Then Return False
|
||||
|
||||
Return True
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
30
UTS_Core/UTSModule/Production/ErrCode.vb
Normal file
30
UTS_Core/UTSModule/Production/ErrCode.vb
Normal file
@@ -0,0 +1,30 @@
|
||||
Imports System.Drawing
|
||||
|
||||
Namespace UTSModule.Production
|
||||
|
||||
Public Class ErrCode
|
||||
Sub New ()
|
||||
Code = ""
|
||||
Msg =""
|
||||
Color = Color.White
|
||||
End Sub
|
||||
|
||||
|
||||
Sub New(code As String, msg As String, color As Color)
|
||||
Me.Code = code
|
||||
Me.Msg = msg
|
||||
Me.Color = color
|
||||
End Sub
|
||||
|
||||
Public Property Code() As String
|
||||
|
||||
Public Property Msg() As String
|
||||
|
||||
Public Property Color() As Color
|
||||
|
||||
Public Function CodeEqual(srcCode As String) As Boolean
|
||||
If String.Compare(Code, srcCode, True) = 0 Then Return True
|
||||
Return False
|
||||
End Function
|
||||
End Class
|
||||
End NameSpace
|
||||
111
UTS_Core/UTSModule/Production/ErrCodeManager.vb
Normal file
111
UTS_Core/UTSModule/Production/ErrCodeManager.vb
Normal file
@@ -0,0 +1,111 @@
|
||||
Imports System.Drawing
|
||||
Imports UTS_Core.UTSModule.DbTableModel.Manage.ErrCodeTable
|
||||
|
||||
Namespace UTSModule.Production
|
||||
Public Class ErrCodeManager
|
||||
''' <summary>错误代码管理器,全局唯一</summary>
|
||||
Private Shared _manager As ErrCodeManager
|
||||
|
||||
''' <summary>初始化测试器线程锁</summary>
|
||||
Private Shared ReadOnly InitLock As New Object()
|
||||
|
||||
|
||||
Private ReadOnly _errCodeList As List(Of ErrCode)
|
||||
|
||||
Private ReadOnly _defaultErrCode As ErrCode
|
||||
|
||||
''' <summary>
|
||||
''' 创建单例管理器,并初始化管理器内容
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Shared Function CreateManager() As ErrCodeManager
|
||||
If _manager Is Nothing Then
|
||||
SyncLock InitLock
|
||||
Threading.Thread.MemoryBarrier()
|
||||
If _manager Is Nothing Then
|
||||
_manager = New ErrCodeManager
|
||||
_manager.InitializeErrCode()
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
Return _manager
|
||||
End Function
|
||||
|
||||
Private Sub New()
|
||||
_errCodeList = New List(Of ErrCode)()
|
||||
|
||||
_defaultErrCode = New ErrCode()
|
||||
End Sub
|
||||
|
||||
Public Sub InitializeErrCode()
|
||||
Dim dtTable As DataTable = DbConnect.DbConnector.GetAllErrCode()
|
||||
_errCodeList.Clear()
|
||||
|
||||
For Each row As DataRow In dtTable.Rows
|
||||
Dim code As String = row($"{ColNamesEnum.ErrCode}").ToString()
|
||||
Dim msg As String = row($"{ColNamesEnum.ErrMsg}").ToString()
|
||||
Dim color As Color = HexStringToColor(row($"{ColNamesEnum.ErrColor}").ToString())
|
||||
_errCodeList.Add(New ErrCode(code, msg, color))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Function IndexOf(code As String) As Integer
|
||||
For i As Integer = 0 To _errCodeList.Count - 1
|
||||
If _errCodeList(i).CodeEqual(code) Then Return i
|
||||
Next
|
||||
Return -1
|
||||
End Function
|
||||
|
||||
Default Public ReadOnly Property Item(index As Integer) As ErrCode
|
||||
Get
|
||||
If index = -1 OrElse index >= _errCodeList.Count Then
|
||||
Return _defaultErrCode
|
||||
End If
|
||||
|
||||
Return _errCodeList(index)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Default Public ReadOnly Property Item(code As String) As ErrCode
|
||||
Get
|
||||
Return Item(IndexOf(code))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Private Function HexStringToColor(hexString As String) As Color
|
||||
Dim val As Integer = Convert.ToInt32(hexString, 16)
|
||||
Return Color.FromArgb(val >> 16 And &HFF, val >> 8 And &HFF, val And &HFF)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 提取错误代码与错误消息字符串中的错误代码
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Shared Function CodeMsgToCode(codeMsg As String) As String
|
||||
Dim length As Integer = codeMsg.IndexOf(":"c)
|
||||
If length > 0 Then Return Mid(codeMsg, 1, codeMsg.IndexOf(":"c))
|
||||
Return codeMsg
|
||||
End Function
|
||||
|
||||
Private Function Count() As Integer
|
||||
Return _errCodeList.Count
|
||||
End Function
|
||||
|
||||
Public Function GetAllCodes() As String()
|
||||
Dim arr(_errCodeList.Count - 1) As String
|
||||
For i As Integer = 0 To _errCodeList.Count - 1
|
||||
arr(i) = _errCodeList(i).Code
|
||||
Next
|
||||
Return arr
|
||||
End Function
|
||||
|
||||
Public Function GetAllCodeAndMsg() As String()
|
||||
Dim arr(_errCodeList.Count - 1) As String
|
||||
For i As Integer = 0 To _errCodeList.Count - 1
|
||||
arr(i) = $"{_errCodeList(i).Code}:{_errCodeList(i).Msg}"
|
||||
Next
|
||||
Return arr
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
156
UTS_Core/UTSModule/Production/InternalOrderManager.vb
Normal file
156
UTS_Core/UTSModule/Production/InternalOrderManager.vb
Normal file
@@ -0,0 +1,156 @@
|
||||
Imports System.Threading
|
||||
Imports UTS_Core.UTSModule.DbTableModel.Customer
|
||||
|
||||
Namespace UTSModule.Production
|
||||
''' <summary>
|
||||
''' 内部订单信息
|
||||
''' </summary>
|
||||
Public Class InternalOrderManager
|
||||
|
||||
|
||||
Private Sub New()
|
||||
ID = -1
|
||||
OrderID = -1
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 内部订单索引
|
||||
''' </summary>
|
||||
Public Property ID As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 客户订单索引
|
||||
''' </summary>
|
||||
Public Property OrderID As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 内部订单号字符串
|
||||
''' </summary>
|
||||
Public Property InternalNo As String
|
||||
|
||||
''' <summary>
|
||||
''' 公司索引
|
||||
''' </summary>
|
||||
Public Property CompanyID As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 产品索引
|
||||
''' </summary>
|
||||
Public Property ProductID As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 产品类型索引
|
||||
''' </summary>
|
||||
Public Property ProductTypeID As Integer
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 内部订单创建时间
|
||||
''' </summary>
|
||||
Public Property CreateTime As Date
|
||||
|
||||
''' <summary>
|
||||
''' 订单交期
|
||||
''' </summary>
|
||||
Public Property DeliveryTime As Date
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 目标产能
|
||||
''' </summary>
|
||||
Public Property ObjectiveYield As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 当前总产能
|
||||
''' </summary>
|
||||
Public Property ObjectiveYieldTotal As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 内部订单状态
|
||||
''' </summary>
|
||||
Public Property OrderStatus As Integer
|
||||
|
||||
''' <summary>内部订单管理器</summary>
|
||||
Private Shared _manager As InternalOrderManager
|
||||
|
||||
''' <summary>初始化测试器线程锁</summary>
|
||||
Private Shared ReadOnly InitLock As New Object()
|
||||
|
||||
''' <summary>
|
||||
''' 创建内部订单管理器单例
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Shared Function CreateManager() As InternalOrderManager
|
||||
If _manager Is Nothing Then
|
||||
SyncLock InitLock
|
||||
Thread.MemoryBarrier()
|
||||
If _manager Is Nothing Then
|
||||
_manager = New InternalOrderManager()
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
|
||||
Return _manager
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 初始化指定内部订单索引的订单详情
|
||||
''' </summary>
|
||||
''' <param name="internalOrderID"></param>
|
||||
Public Sub Initialize(internalOrderID As Integer)
|
||||
Dim dtTable As DataTable = DbConnect.DbConnector.GetInternalOrder(internalOrderID)
|
||||
If dtTable.Rows.Count = 0 Then Return
|
||||
|
||||
ID = internalOrderID
|
||||
|
||||
If Integer.TryParse(dtTable(0)($"{OrderInternalTable.ColNames.OrderID}").ToString, OrderID) = False Then
|
||||
OrderID = -1
|
||||
End If
|
||||
' OrderID = CInt(dtTable(0)($"{OrderInternalTable.ColNames.OrderID}"))
|
||||
|
||||
If Integer.TryParse(dtTable(0)($"{OrderInternalTable.ColNames.OrderStatus}").ToString, OrderStatus) = False Then
|
||||
OrderStatus = 4
|
||||
End If
|
||||
'OrderStatus = CInt(dtTable(0)($"{OrderInternalTable.ColNames.OrderStatus}"))
|
||||
|
||||
If Integer.TryParse(dtTable(0)($"{OrderInternalTable.ColNames.CompanyID}").ToString, CompanyID) = False Then
|
||||
CompanyID = -1
|
||||
End If
|
||||
' CompanyID = CInt(dtTable(0)($"{OrderInternalTable.ColNames.CompanyID}"))
|
||||
|
||||
If Integer.TryParse(dtTable(0)($"{OrderInternalTable.ColNames.ProductID}").ToString, ProductID) = False Then
|
||||
ProductID = -1
|
||||
End If
|
||||
' ProductID = CInt(dtTable(0)($"{OrderInternalTable.ColNames.ProductID}"))
|
||||
|
||||
If Integer.TryParse(dtTable(0)($"{OrderInternalTable.ColNames.ProductTypeID}").ToString, ProductTypeID) = False Then
|
||||
ProductTypeID = -1
|
||||
End If
|
||||
'ProductTypeID = CInt(dtTable(0)($"{OrderInternalTable.ColNames.ProductTypeID}"))
|
||||
|
||||
If Integer.TryParse(dtTable(0)($"{OrderInternalTable.ColNames.ObjectiveYield}").ToString, ObjectiveYield) = False Then
|
||||
ObjectiveYield = -1
|
||||
End If
|
||||
'ObjectiveYield = CInt(dtTable(0)($"{OrderInternalTable.ColNames.ObjectiveYield}"))
|
||||
|
||||
If Integer.TryParse(dtTable(0)($"{OrderInternalTable.ColNames.ObjectiveYieldTotal}").ToString, ObjectiveYieldTotal) = False Then
|
||||
ObjectiveYieldTotal = -1
|
||||
End If
|
||||
'ObjectiveYieldTotal = CInt(dtTable(0)($"{OrderInternalTable.ColNames.ObjectiveYieldTotal}"))
|
||||
|
||||
If Date.TryParse(dtTable(0)($"{OrderInternalTable.ColNames.CreateTime}").ToString, CreateTime) = False Then
|
||||
CreateTime = Now
|
||||
End If
|
||||
'CreateTime = CDate(dtTable(0)($"{OrderInternalTable.ColNames.CreateTime}"))
|
||||
|
||||
If Date.TryParse(dtTable(0)($"{OrderInternalTable.ColNames.DeliveryTime}").ToString, DeliveryTime) = False Then
|
||||
DeliveryTime = Now
|
||||
End If
|
||||
' DeliveryTime = CDate(dtTable(0)($"{OrderInternalTable.ColNames.DeliveryTime}"))
|
||||
|
||||
InternalNo = CStr(dtTable(0)($"{OrderInternalTable.ColNames.InternalNo}"))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
23
UTS_Core/UTSModule/Production/PlanCol.vb
Normal file
23
UTS_Core/UTSModule/Production/PlanCol.vb
Normal file
@@ -0,0 +1,23 @@
|
||||
Namespace UTSModule.Production
|
||||
Public Class PlanCol
|
||||
Sub New(name As String, type As String, desc As String)
|
||||
ColName = name
|
||||
ColType = type
|
||||
ColDesc = desc
|
||||
End Sub
|
||||
|
||||
|
||||
Property ColName() As String
|
||||
|
||||
Property ColType() As String
|
||||
|
||||
Property ColDesc() As String
|
||||
|
||||
Public Function NameEqual(name As String) As Boolean
|
||||
If String.Compare(ColName, name, True) = 0 Then
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
End Class
|
||||
End NameSpace
|
||||
86
UTS_Core/UTSModule/Production/PlanColManager.vb
Normal file
86
UTS_Core/UTSModule/Production/PlanColManager.vb
Normal file
@@ -0,0 +1,86 @@
|
||||
Imports UTS_Core.Database
|
||||
Imports UTS_Core.UTSModule.DbTableModel.Manage.TestPlanTipsTable
|
||||
|
||||
Namespace UTSModule.Production
|
||||
Public Class PlanColManager
|
||||
Private ReadOnly _planColList As List(Of PlanCol)
|
||||
|
||||
''' <summary>测试流程列管理器,全局唯一</summary>
|
||||
Private Shared _manager As PlanColManager
|
||||
|
||||
''' <summary>初始化测试器线程锁</summary>
|
||||
Private Shared ReadOnly InitLock As New Object()
|
||||
|
||||
|
||||
Private Sub New()
|
||||
_planColList = New List(Of PlanCol)()
|
||||
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 创建单例管理器,并初始化管理器内容
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Shared Function CreateManager() As PlanColManager
|
||||
If _manager Is Nothing Then
|
||||
SyncLock InitLock
|
||||
Threading.Thread.MemoryBarrier()
|
||||
If _manager Is Nothing Then
|
||||
_manager = New PlanColManager
|
||||
_manager.InitializePlanCol()
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
Return _manager
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub InitializePlanCol()
|
||||
Dim dtTable As DataTable = SearchPlanCol(UtsDb.LocalDbType, UtsDb.LocalConnString)
|
||||
|
||||
_planColList.Clear()
|
||||
For Each row As DataRow In dtTable.Rows
|
||||
Dim name As String = row($"{ColNamesEnum.ColName}").ToString()
|
||||
Dim type As String = row($"{ColNamesEnum.ColType}").ToString()
|
||||
Dim desc As String = row($"{ColNamesEnum.ColDesc}").ToString()
|
||||
|
||||
_planColList.Add(New PlanCol(name, type, desc))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Function IndexOf(code As String) As Integer
|
||||
For i As Integer = 0 To _planColList.Count - 1
|
||||
If _planColList(i).NameEqual(code) Then Return i
|
||||
Next
|
||||
Return -1
|
||||
End Function
|
||||
|
||||
Default Public ReadOnly Property Item(index As Integer) As PlanCol
|
||||
Get
|
||||
Return _planColList(index)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Default Public ReadOnly Property Item(code As String) As PlanCol
|
||||
Get
|
||||
Return Item(IndexOf(code))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Private Function Count() As Integer
|
||||
Return _planColList.Count
|
||||
End Function
|
||||
|
||||
|
||||
Private Shared Function SearchPlanCol(type As DbExecutor.DbTypeEnum, connString As String) As DataTable
|
||||
Using db As New DbExecutor(type, connString) '查询本地
|
||||
db.Open()
|
||||
|
||||
Dim tableName As String = DbTableModel.Manage.TestPlanTipsTable.TableName
|
||||
Return db.ExecuteDataTable(db.CmdHelper.SearchAll(tableName))
|
||||
End Using
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
98
UTS_Core/UTSModule/Production/ProductTypeManager.vb
Normal file
98
UTS_Core/UTSModule/Production/ProductTypeManager.vb
Normal file
@@ -0,0 +1,98 @@
|
||||
Imports UTS_Core.UTSModule.DbTableModel.Customer.ProductTypesTable
|
||||
|
||||
Namespace UTSModule.Production
|
||||
|
||||
Public Class ProductTypeManager
|
||||
''' <summary>产品类型管理器,全局唯一</summary>
|
||||
Private Shared _manager As ProductTypeManager
|
||||
|
||||
''' <summary>初始化测试器线程锁</summary>
|
||||
Private Shared ReadOnly InitLock As New Object()
|
||||
|
||||
Private ReadOnly _productTypeList As List(Of ProductType)
|
||||
|
||||
Private Sub New()
|
||||
_productTypeList = New List(Of ProductType)()
|
||||
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 创建单例管理器,并初始化管理器内容
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Shared Function CreateManager() As ProductTypeManager
|
||||
If _manager Is Nothing Then
|
||||
SyncLock InitLock
|
||||
Threading.Thread.MemoryBarrier()
|
||||
If _manager Is Nothing Then
|
||||
_manager = New ProductTypeManager
|
||||
_manager.InitializeProductType()
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
Return _manager
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 从数据库中获取所有的产品类型
|
||||
''' </summary>
|
||||
Public Sub InitializeProductType()
|
||||
Dim dtTable As DataTable = DbConnect.DbConnector.GetAllProductTypes()
|
||||
_productTypeList.Clear()
|
||||
|
||||
For Each row As DataRow In dtTable.Rows
|
||||
Dim id As Integer = CInt(row($"{ColNames.ID}"))
|
||||
Dim type As String = row($"{ColNames.ProductType}").ToString()
|
||||
|
||||
_productTypeList.Add(New ProductType(id, type))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Function GetAllProductType() As String()
|
||||
If _productTypeList.Count <= 0 Then Return New String() {}
|
||||
|
||||
Dim result(_productTypeList.Count - 1) As String
|
||||
For i As Integer = 0 To _productTypeList.Count - 1
|
||||
result(i) = _productTypeList(i).ProductType
|
||||
Next
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Public Function GetProductType(index As Integer) As String
|
||||
Dim result As String = String.Empty
|
||||
For Each productType As ProductType In _productTypeList
|
||||
If productType.IDEqual(index) Then result = productType.ProductType : Exit For
|
||||
Next
|
||||
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Public Function GetProductIndex(type As String) As Integer
|
||||
Dim result As Integer = -1
|
||||
For Each productType As ProductType In _productTypeList
|
||||
If productType.TypesEqual(type) Then result = productType.ID : Exit For
|
||||
Next
|
||||
Return result
|
||||
End Function
|
||||
End Class
|
||||
|
||||
|
||||
Public Class ProductType
|
||||
Public Property ID As Integer
|
||||
Public Property ProductType As String
|
||||
|
||||
|
||||
Sub New(id As Integer, type As String)
|
||||
Me.ID = id
|
||||
ProductType = type
|
||||
End Sub
|
||||
|
||||
Public Function TypesEqual(type As String) As Boolean
|
||||
Return String.Compare(ProductType, type, True) = 0
|
||||
End Function
|
||||
|
||||
Public Function IDEqual(index As Integer) As Boolean
|
||||
Return ID = index
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
67
UTS_Core/UTSModule/Production/ProductionLineManager.vb
Normal file
67
UTS_Core/UTSModule/Production/ProductionLineManager.vb
Normal file
@@ -0,0 +1,67 @@
|
||||
Namespace UTSModule.Production
|
||||
Public Class ProductionLineManager
|
||||
Private _id As Integer
|
||||
|
||||
Private _name As String
|
||||
|
||||
Private _description As String
|
||||
|
||||
Private _remark As String
|
||||
|
||||
Sub New()
|
||||
|
||||
End Sub
|
||||
|
||||
Sub New(id As Integer, name As String)
|
||||
_id = id
|
||||
_name = name
|
||||
End Sub
|
||||
|
||||
Sub New(id As Integer, name As String, desc As String)
|
||||
_id = id
|
||||
_name = name
|
||||
|
||||
_description = desc
|
||||
End Sub
|
||||
|
||||
Sub New(id As Integer, name As String, desc As String, remark As String)
|
||||
_id = id
|
||||
_name = name
|
||||
|
||||
_description = desc
|
||||
_remark = remark
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property ID() As Integer
|
||||
Get
|
||||
Return _id
|
||||
End Get
|
||||
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property Name() As String
|
||||
Get
|
||||
Return _name
|
||||
End Get
|
||||
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property Description() As String
|
||||
Get
|
||||
Return _description
|
||||
End Get
|
||||
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Remark() As String
|
||||
Get
|
||||
Return _remark
|
||||
End Get
|
||||
|
||||
End Property
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
117
UTS_Core/UTSModule/Production/ProductionLinesManager.vb
Normal file
117
UTS_Core/UTSModule/Production/ProductionLinesManager.vb
Normal file
@@ -0,0 +1,117 @@
|
||||
Imports System.Data.Common
|
||||
Imports UTS_Core.Database
|
||||
Imports UTS_Core.UTSModule.DbTableModel.Customer
|
||||
|
||||
Namespace UTSModule.Production
|
||||
Public Class ProductionLinesManager
|
||||
''' <summary>产线管理器,全局唯一</summary>
|
||||
Private Shared _manager As ProductionLinesManager
|
||||
|
||||
''' <summary>初始化管理器线程锁</summary>
|
||||
Private Shared ReadOnly InitLock As New Object()
|
||||
|
||||
Private ReadOnly _lines As Dictionary(Of String, ProductionLineManager)
|
||||
|
||||
|
||||
Private Sub New()
|
||||
_lines = New Dictionary(Of String, ProductionLineManager)()
|
||||
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 创建单例管理器,并初始化管理器内容
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Shared Function CreateManager() As ProductionLinesManager
|
||||
If _manager Is Nothing Then
|
||||
SyncLock InitLock
|
||||
Threading.Thread.MemoryBarrier()
|
||||
If _manager Is Nothing Then
|
||||
_manager = New ProductionLinesManager
|
||||
_manager.LoadProductionLines()
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
Return _manager
|
||||
End Function
|
||||
|
||||
|
||||
Default Public ReadOnly Property Item(name As String) As ProductionLineManager
|
||||
Get
|
||||
Return _lines(name)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Default Public ReadOnly Property Item(index As Integer) As ProductionLineManager
|
||||
Get
|
||||
Return _lines.Values(index)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 获取所有产线的名字
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function GetLineNames() As String()
|
||||
Return _lines.Keys.ToArray()
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub LoadProductionLines()
|
||||
_lines.Clear()
|
||||
|
||||
Using db As New DbExecutor(UtsDb.LocalDbType, UtsDb.LocalConnString)
|
||||
db.Open()
|
||||
|
||||
Dim cmdText As String = db.CmdHelper.SearchAll(ProductionLineTable.TableName)
|
||||
|
||||
Using dbReader As DbDataReader = db.ExecuteReader(cmdText)
|
||||
While dbReader.Read()
|
||||
Dim id As Integer
|
||||
Dim name As String
|
||||
Dim desc As String
|
||||
Dim remark As String
|
||||
|
||||
Dim tmpItem As Object
|
||||
|
||||
tmpItem = dbReader($"{ProductionLineTable.ColNames.ID}")
|
||||
If IsDBNull(tmpItem) Then
|
||||
Throw New Exception($"Load ProductionLines Error:ID is Null.")
|
||||
Else
|
||||
id = CInt(tmpItem)
|
||||
End If
|
||||
|
||||
tmpItem = dbReader($"{ProductionLineTable.ColNames.Name}")
|
||||
If IsDBNull(tmpItem) Then
|
||||
Throw New Exception($"Load ProductionLines Error:Name is Null.")
|
||||
Else
|
||||
name = CStr(tmpItem)
|
||||
End If
|
||||
|
||||
tmpItem = dbReader($"{ProductionLineTable.ColNames.Description}")
|
||||
If IsDBNull(tmpItem) Then
|
||||
desc = String.Empty
|
||||
Else
|
||||
desc = CStr(tmpItem)
|
||||
End If
|
||||
|
||||
tmpItem = dbReader($"{ProductionLineTable.ColNames.Remark}")
|
||||
If IsDBNull(tmpItem) Then
|
||||
remark = String.Empty
|
||||
Else
|
||||
remark = CStr(tmpItem)
|
||||
End If
|
||||
|
||||
|
||||
_lines.Add(name, New ProductionLineManager(id, name, desc, remark))
|
||||
End While
|
||||
dbReader.Close()
|
||||
End Using
|
||||
|
||||
db.Close()
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
50
UTS_Core/UTSModule/Production/TestCmd.vb
Normal file
50
UTS_Core/UTSModule/Production/TestCmd.vb
Normal file
@@ -0,0 +1,50 @@
|
||||
Imports UTS_Core.UTSModule.DbTableModel.Manage
|
||||
|
||||
Namespace UTSModule.Production
|
||||
Public Class TestCmd
|
||||
Sub New()
|
||||
Params = New List(Of TestCmdParam)()
|
||||
End Sub
|
||||
|
||||
|
||||
Public Property CommandIndex() As String
|
||||
|
||||
Public Property CommandType() As String
|
||||
|
||||
Public Property CommandName() As String
|
||||
|
||||
Public Property CommandDesc() As String
|
||||
|
||||
Public Property ParamCount() As Integer
|
||||
|
||||
Public Property Params() As List(Of TestCmdParam)
|
||||
|
||||
Public Function InitCommand(dtRow As DataRow) As Boolean
|
||||
CommandIndex = dtRow.Item(UtsCmdListTable.ColNamesEnum.ID.ToString()).ToString()
|
||||
CommandType = dtRow.Item(UtsCmdListTable.ColNamesEnum.CmdType.ToString()).ToString()
|
||||
CommandName = dtRow.Item(UtsCmdListTable.ColNamesEnum.CmdName.ToString()).ToString()
|
||||
CommandDesc = dtRow.Item(UtsCmdListTable.ColNamesEnum.CmdDesc.ToString()).ToString()
|
||||
|
||||
ParamCount = CInt(dtRow.Item(UtsCmdListTable.ColNamesEnum.ParamCount.ToString()))
|
||||
|
||||
Params.Clear()
|
||||
|
||||
For i As Integer = 1 To ParamCount
|
||||
Try
|
||||
Dim param As New TestCmdParam With {
|
||||
.Desc = dtRow.Item("ParamDesc" & i).ToString(),
|
||||
.Type = dtRow.Item("ParamType" & i).ToString(),
|
||||
.LowerLimit = dtRow.Item("ParamLower" & i).ToString(),
|
||||
.UpperLimit = dtRow.Item("ParamUpper" & i).ToString(),
|
||||
.Value = dtRow.Item("ParamValue" & i).ToString()
|
||||
}
|
||||
Params.Add(param)
|
||||
Catch ex As Exception
|
||||
MsgBox($"CommandName :{CommandName},ParamCount:ParamCount,Error:{ex.Message}")
|
||||
Exit For
|
||||
End Try
|
||||
Next
|
||||
Return True
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
136
UTS_Core/UTSModule/Production/TestCmdManager.vb
Normal file
136
UTS_Core/UTSModule/Production/TestCmdManager.vb
Normal file
@@ -0,0 +1,136 @@
|
||||
Imports UTS_Core.Database
|
||||
|
||||
Namespace UTSModule.Production
|
||||
|
||||
Public Class TestCmdManager
|
||||
Private ReadOnly _command As Dictionary(Of String, Dictionary(Of String, TestCmd))
|
||||
|
||||
''' <summary>测试命令管理器,全局唯一</summary>
|
||||
Private Shared _manager As TestCmdManager
|
||||
|
||||
''' <summary>初始化测试器线程锁</summary>
|
||||
Private Shared ReadOnly InitLock As New Object()
|
||||
|
||||
Private Sub New()
|
||||
_command = New Dictionary(Of String, Dictionary(Of String, TestCmd))()
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 创建单例管理器,并初始化管理器内容
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Shared Function CreateManager() As TestCmdManager
|
||||
If _manager Is Nothing Then
|
||||
SyncLock InitLock
|
||||
Threading.Thread.MemoryBarrier()
|
||||
If _manager Is Nothing Then
|
||||
_manager = New TestCmdManager
|
||||
_manager.InitCommandHelper(UtsDb.LocalDbType, UtsDb.LocalConnString)
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
Return _manager
|
||||
End Function
|
||||
|
||||
|
||||
Public Function GetCommandTypes() As String()
|
||||
Return _command.Keys.ToArray()
|
||||
End Function
|
||||
|
||||
Public Function GetCommandNames(type As String) As String()
|
||||
If _command.ContainsKey(type) Then
|
||||
Return _command(type).Keys.ToArray()
|
||||
End If
|
||||
Return New String() {}
|
||||
End Function
|
||||
|
||||
|
||||
Public Function GetCommandCount(type As String) As Integer
|
||||
If _command.ContainsKey(type) Then
|
||||
Return _command(type).Count
|
||||
End If
|
||||
|
||||
Return 0
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 根据命令类型与命令名索引命令
|
||||
''' </summary>
|
||||
''' <param name="type"></param>
|
||||
''' <param name="index"></param>
|
||||
''' <returns></returns>
|
||||
Public Function GetCommand(type As String, index As Integer) As TestCmd
|
||||
Dim rtn As TestCmd = Nothing
|
||||
Try
|
||||
If index < GetCommandCount(type) Then
|
||||
rtn = _command(type).Values.ElementAt(index)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Console.WriteLine($"未查询到 type:{type} index{index} 命令存在!")
|
||||
End Try
|
||||
Return rtn
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 根据命令类型与命令名索引命令
|
||||
''' </summary>
|
||||
''' <param name="type"></param>
|
||||
''' <param name="name"></param>
|
||||
''' <returns></returns>
|
||||
Public Function GetCommand(type As String, name As String) As TestCmd
|
||||
Dim rtn As TestCmd = Nothing
|
||||
If _command.ContainsKey(type) Then
|
||||
If _command(type).ContainsKey(name) Then
|
||||
rtn = _command(type)(name)
|
||||
End If
|
||||
End If
|
||||
Return rtn
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Private Function SearchCommand(type As DbExecutor.DbTypeEnum, connString As String) As DataTable
|
||||
Using db As New DbExecutor(type, connString) '查询本地
|
||||
db.Open()
|
||||
|
||||
Dim tableName As String = DbTableModel.Manage.UtsCmdListTable.TableName
|
||||
Return db.ExecuteDataTable(db.CmdHelper.SearchAll(tableName))
|
||||
End Using
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 初始化版主信息
|
||||
''' </summary>
|
||||
''' <param name="dtCommand"></param>
|
||||
Public Sub InitCommandHelper(dtCommand As DataTable)
|
||||
_command.Clear()
|
||||
|
||||
For row As Integer = 0 To dtCommand.Rows.Count - 1
|
||||
Dim planCommand As New TestCmd
|
||||
planCommand.InitCommand(dtCommand.Rows(row))
|
||||
|
||||
If _command.ContainsKey(planCommand.CommandType) = False Then '添加新分组
|
||||
_command.Add(planCommand.CommandType, New Dictionary(Of String, TestCmd))
|
||||
End If
|
||||
|
||||
_command(planCommand.CommandType).Add(planCommand.CommandName, planCommand)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 初始化流程站帮助信息
|
||||
''' 从本地数据库中读取
|
||||
''' </summary>
|
||||
''' <param name="type">数据库类型</param>
|
||||
''' <param name="connString">数据库连接字符串</param>
|
||||
Public Sub InitCommandHelper(type As DbExecutor.DbTypeEnum, connString As String)
|
||||
'查询数据表
|
||||
Dim dtCommand As DataTable = SearchCommand(type, connString)
|
||||
|
||||
'赋值
|
||||
InitCommandHelper(dtCommand)
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
18
UTS_Core/UTSModule/Production/TestCmdParam.vb
Normal file
18
UTS_Core/UTSModule/Production/TestCmdParam.vb
Normal file
@@ -0,0 +1,18 @@
|
||||
Namespace UTSModule.Production
|
||||
Public Class TestCmdParam
|
||||
|
||||
Public Property Desc() As String
|
||||
|
||||
Public Property Type() As String
|
||||
|
||||
Public Property LowerLimit() As String
|
||||
|
||||
Public Property UpperLimit() As String
|
||||
|
||||
Public Property Value() As String
|
||||
|
||||
Public Function Clone() As TestCmdParam
|
||||
Return New TestCmdParam() With {.Desc = Desc, .Type = Type, .LowerLimit = LowerLimit, .UpperLimit = UpperLimit, .Value = Value}
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
116
UTS_Core/UTSModule/Project/DlgCreateProject.Designer.vb
generated
Normal file
116
UTS_Core/UTSModule/Project/DlgCreateProject.Designer.vb
generated
Normal file
@@ -0,0 +1,116 @@
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Namespace UTSModule.Project
|
||||
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class DlgCreateProject
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form 重写 Dispose,以清理组件列表。
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Windows 窗体设计器所必需的
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'注意: 以下过程是 Windows 窗体设计器所必需的
|
||||
'可以使用 Windows 窗体设计器修改它。
|
||||
'不要使用代码编辑器修改它。
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
|
||||
Me.OK_Button = New System.Windows.Forms.Button()
|
||||
Me.Cancel_Button = New System.Windows.Forms.Button()
|
||||
Me.CboProjectName = New System.Windows.Forms.ComboBox()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.TableLayoutPanel1.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'TableLayoutPanel1
|
||||
'
|
||||
Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.TableLayoutPanel1.ColumnCount = 2
|
||||
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
|
||||
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
|
||||
Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0)
|
||||
Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0)
|
||||
Me.TableLayoutPanel1.Location = New System.Drawing.Point(237, 107)
|
||||
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
|
||||
Me.TableLayoutPanel1.RowCount = 1
|
||||
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
|
||||
Me.TableLayoutPanel1.Size = New System.Drawing.Size(146, 27)
|
||||
Me.TableLayoutPanel1.TabIndex = 0
|
||||
'
|
||||
'OK_Button
|
||||
'
|
||||
Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None
|
||||
Me.OK_Button.Location = New System.Drawing.Point(3, 3)
|
||||
Me.OK_Button.Name = "OK_Button"
|
||||
Me.OK_Button.Size = New System.Drawing.Size(67, 21)
|
||||
Me.OK_Button.TabIndex = 0
|
||||
Me.OK_Button.Text = "确定"
|
||||
'
|
||||
'Cancel_Button
|
||||
'
|
||||
Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None
|
||||
Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
||||
Me.Cancel_Button.Location = New System.Drawing.Point(76, 3)
|
||||
Me.Cancel_Button.Name = "Cancel_Button"
|
||||
Me.Cancel_Button.Size = New System.Drawing.Size(67, 21)
|
||||
Me.Cancel_Button.TabIndex = 1
|
||||
Me.Cancel_Button.Text = "取消"
|
||||
'
|
||||
'CboProjectName
|
||||
'
|
||||
Me.CboProjectName.FormattingEnabled = True
|
||||
Me.CboProjectName.Location = New System.Drawing.Point(83, 54)
|
||||
Me.CboProjectName.Name = "CboProjectName"
|
||||
Me.CboProjectName.Size = New System.Drawing.Size(300, 20)
|
||||
Me.CboProjectName.TabIndex = 1
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Location = New System.Drawing.Point(12, 57)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(65, 12)
|
||||
Me.Label1.TabIndex = 2
|
||||
Me.Label1.Text = "项目名称:"
|
||||
'
|
||||
'DlgCreateProject
|
||||
'
|
||||
Me.AcceptButton = Me.OK_Button
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.CancelButton = Me.Cancel_Button
|
||||
Me.ClientSize = New System.Drawing.Size(395, 145)
|
||||
Me.Controls.Add(Me.Label1)
|
||||
Me.Controls.Add(Me.CboProjectName)
|
||||
Me.Controls.Add(Me.TableLayoutPanel1)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
|
||||
Me.MaximizeBox = False
|
||||
Me.MinimizeBox = False
|
||||
Me.Name = "DlgCreateProject"
|
||||
Me.ShowInTaskbar = False
|
||||
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
|
||||
Me.Text = "创建项目"
|
||||
Me.TableLayoutPanel1.ResumeLayout(False)
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
|
||||
Friend WithEvents OK_Button As System.Windows.Forms.Button
|
||||
Friend WithEvents Cancel_Button As System.Windows.Forms.Button
|
||||
Friend WithEvents CboProjectName As ComboBox
|
||||
Friend WithEvents Label1 As Label
|
||||
End Class
|
||||
End Namespace
|
||||
120
UTS_Core/UTSModule/Project/DlgCreateProject.resx
Normal file
120
UTS_Core/UTSModule/Project/DlgCreateProject.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
24
UTS_Core/UTSModule/Project/DlgCreateProject.vb
Normal file
24
UTS_Core/UTSModule/Project/DlgCreateProject.vb
Normal file
@@ -0,0 +1,24 @@
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class DlgCreateProject
|
||||
Public Property ProjectName() As String
|
||||
|
||||
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles OK_Button.Click
|
||||
If String.IsNullOrWhiteSpace(CboProjectName.Text) Then
|
||||
MsgBox($"请输入合法测试项目名称!")
|
||||
Return
|
||||
End If
|
||||
|
||||
ProjectName = CboProjectName.Text
|
||||
DialogResult = DialogResult.OK
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles Cancel_Button.Click
|
||||
DialogResult = DialogResult.Cancel
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
144
UTS_Core/UTSModule/Project/DlgLoadProject.Designer.vb
generated
Normal file
144
UTS_Core/UTSModule/Project/DlgLoadProject.Designer.vb
generated
Normal file
@@ -0,0 +1,144 @@
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Namespace UTSModule.Project
|
||||
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class DlgLoadProject
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form 重写 Dispose,以清理组件列表。
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Windows 窗体设计器所必需的
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'注意: 以下过程是 Windows 窗体设计器所必需的
|
||||
'可以使用 Windows 窗体设计器修改它。
|
||||
'不要使用代码编辑器修改它。
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
|
||||
Me.OK_Button = New System.Windows.Forms.Button()
|
||||
Me.Cancel_Button = New System.Windows.Forms.Button()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.CboProjectName = New System.Windows.Forms.ComboBox()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.CboLoadProjectMode = New System.Windows.Forms.ComboBox()
|
||||
Me.TableLayoutPanel1.SuspendLayout
|
||||
Me.SuspendLayout
|
||||
'
|
||||
'TableLayoutPanel1
|
||||
'
|
||||
Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
|
||||
Me.TableLayoutPanel1.ColumnCount = 2
|
||||
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50!))
|
||||
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50!))
|
||||
Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0)
|
||||
Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0)
|
||||
Me.TableLayoutPanel1.Location = New System.Drawing.Point(277, 89)
|
||||
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
|
||||
Me.TableLayoutPanel1.RowCount = 1
|
||||
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50!))
|
||||
Me.TableLayoutPanel1.Size = New System.Drawing.Size(146, 27)
|
||||
Me.TableLayoutPanel1.TabIndex = 0
|
||||
'
|
||||
'OK_Button
|
||||
'
|
||||
Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None
|
||||
Me.OK_Button.Location = New System.Drawing.Point(3, 3)
|
||||
Me.OK_Button.Name = "OK_Button"
|
||||
Me.OK_Button.Size = New System.Drawing.Size(67, 21)
|
||||
Me.OK_Button.TabIndex = 0
|
||||
Me.OK_Button.Text = "确定"
|
||||
'
|
||||
'Cancel_Button
|
||||
'
|
||||
Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None
|
||||
Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
||||
Me.Cancel_Button.Location = New System.Drawing.Point(76, 3)
|
||||
Me.Cancel_Button.Name = "Cancel_Button"
|
||||
Me.Cancel_Button.Size = New System.Drawing.Size(67, 21)
|
||||
Me.Cancel_Button.TabIndex = 1
|
||||
Me.Cancel_Button.Text = "取消"
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = true
|
||||
Me.Label1.Location = New System.Drawing.Point(32, 56)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(65, 12)
|
||||
Me.Label1.TabIndex = 4
|
||||
Me.Label1.Text = "项目名称:"
|
||||
'
|
||||
'CboProjectName
|
||||
'
|
||||
Me.CboProjectName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||
Me.CboProjectName.FormattingEnabled = true
|
||||
Me.CboProjectName.IntegralHeight = false
|
||||
Me.CboProjectName.Location = New System.Drawing.Point(103, 53)
|
||||
Me.CboProjectName.MaxDropDownItems = 16
|
||||
Me.CboProjectName.Name = "CboProjectName"
|
||||
Me.CboProjectName.Size = New System.Drawing.Size(300, 20)
|
||||
Me.CboProjectName.TabIndex = 3
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = true
|
||||
Me.Label2.Location = New System.Drawing.Point(32, 30)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(65, 12)
|
||||
Me.Label2.TabIndex = 6
|
||||
Me.Label2.Text = "加载模式:"
|
||||
'
|
||||
'CboLoadProjectMode
|
||||
'
|
||||
Me.CboLoadProjectMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||
Me.CboLoadProjectMode.FormattingEnabled = true
|
||||
Me.CboLoadProjectMode.Location = New System.Drawing.Point(103, 27)
|
||||
Me.CboLoadProjectMode.Name = "CboLoadProjectMode"
|
||||
Me.CboLoadProjectMode.Size = New System.Drawing.Size(300, 20)
|
||||
Me.CboLoadProjectMode.TabIndex = 5
|
||||
'
|
||||
'DlgLoadProject
|
||||
'
|
||||
Me.AcceptButton = Me.OK_Button
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 12!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.CancelButton = Me.Cancel_Button
|
||||
Me.ClientSize = New System.Drawing.Size(435, 127)
|
||||
Me.Controls.Add(Me.Label2)
|
||||
Me.Controls.Add(Me.CboLoadProjectMode)
|
||||
Me.Controls.Add(Me.Label1)
|
||||
Me.Controls.Add(Me.CboProjectName)
|
||||
Me.Controls.Add(Me.TableLayoutPanel1)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
|
||||
Me.MaximizeBox = false
|
||||
Me.MinimizeBox = false
|
||||
Me.Name = "DlgLoadProject"
|
||||
Me.ShowInTaskbar = false
|
||||
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
|
||||
Me.Text = "DlgLoadProject"
|
||||
Me.TableLayoutPanel1.ResumeLayout(false)
|
||||
Me.ResumeLayout(false)
|
||||
Me.PerformLayout
|
||||
|
||||
End Sub
|
||||
Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
|
||||
Friend WithEvents OK_Button As System.Windows.Forms.Button
|
||||
Friend WithEvents Cancel_Button As System.Windows.Forms.Button
|
||||
Friend WithEvents Label1 As Label
|
||||
Friend WithEvents CboProjectName As ComboBox
|
||||
Friend WithEvents Label2 As Label
|
||||
Friend WithEvents CboLoadProjectMode As ComboBox
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
120
UTS_Core/UTSModule/Project/DlgLoadProject.resx
Normal file
120
UTS_Core/UTSModule/Project/DlgLoadProject.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
47
UTS_Core/UTSModule/Project/DlgLoadProject.vb
Normal file
47
UTS_Core/UTSModule/Project/DlgLoadProject.vb
Normal file
@@ -0,0 +1,47 @@
|
||||
Imports System.Windows.Forms
|
||||
Imports UTS_Core.EnumExtend
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class DlgLoadProject
|
||||
Public Property LoadMode As ProjectInfo.InitializeModeEnum = ProjectInfo.InitializeModeEnum.RemoteDatabaseLoad
|
||||
|
||||
Public Property ProjectName() As String
|
||||
|
||||
Private Sub UpdateProjectCombobox()
|
||||
CboProjectName.Items.Clear()
|
||||
CboProjectName.Items.AddRange(ProjectInfo.LoadProjectList(LoadMode))
|
||||
If CboProjectName.Items.Count > 0 Then CboProjectName.SelectedIndex = 0
|
||||
End Sub
|
||||
|
||||
Private Sub DlgLoadProject_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Text = $"加载项目"
|
||||
|
||||
CboLoadProjectMode.Items.Clear()
|
||||
CboLoadProjectMode.Items.AddRange(EnumExtender.GetEnumAllDesc(GetType(ProjectInfo.InitializeModeEnum)))
|
||||
CboLoadProjectMode.SelectedIndex = LoadMode
|
||||
|
||||
UpdateProjectCombobox()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles OK_Button.Click
|
||||
ProjectName = CboProjectName.Text
|
||||
|
||||
DialogResult = DialogResult.OK
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles Cancel_Button.Click
|
||||
DialogResult = DialogResult.Cancel
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Private Sub CboLoadProjectMode_SelectedIndexChanged(sender As Object, e As EventArgs) Handles CboLoadProjectMode.SelectedIndexChanged
|
||||
If LoadMode <> CboLoadProjectMode.SelectedIndex Then
|
||||
LoadMode = CType([Enum].Parse(GetType(ProjectInfo.InitializeModeEnum), CboLoadProjectMode.SelectedIndex.ToString()), ProjectInfo.InitializeModeEnum)
|
||||
|
||||
UpdateProjectCombobox()
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
249
UTS_Core/UTSModule/Project/DlgLoadStation.Designer.vb
generated
Normal file
249
UTS_Core/UTSModule/Project/DlgLoadStation.Designer.vb
generated
Normal file
@@ -0,0 +1,249 @@
|
||||
|
||||
Namespace UTSModule.Project
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class DlgLoadStation
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form 重写 Dispose,以清理组件列表。
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Windows 窗体设计器所必需的
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'注意: 以下过程是 Windows 窗体设计器所必需的
|
||||
'可以使用 Windows 窗体设计器修改它。
|
||||
'不要使用代码编辑器修改它。
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
|
||||
Me.OK_Button = New System.Windows.Forms.Button()
|
||||
Me.Cancel_Button = New System.Windows.Forms.Button()
|
||||
Me.PicStationPreview = New System.Windows.Forms.PictureBox()
|
||||
Me.CboStation = New System.Windows.Forms.ComboBox()
|
||||
Me.LblStation = New System.Windows.Forms.Label()
|
||||
Me.CboProject = New System.Windows.Forms.ComboBox()
|
||||
Me.LblProject = New System.Windows.Forms.Label()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.GrpStationDesc = New System.Windows.Forms.GroupBox()
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
Me.RtxStationDesc = New System.Windows.Forms.RichTextBox()
|
||||
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
|
||||
Me.RtxProjectDesc = New System.Windows.Forms.RichTextBox()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.TableLayoutPanel1.SuspendLayout
|
||||
CType(Me.PicStationPreview,System.ComponentModel.ISupportInitialize).BeginInit
|
||||
Me.GrpStationDesc.SuspendLayout
|
||||
Me.GroupBox1.SuspendLayout
|
||||
Me.SuspendLayout
|
||||
'
|
||||
'TableLayoutPanel1
|
||||
'
|
||||
Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
|
||||
Me.TableLayoutPanel1.ColumnCount = 2
|
||||
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50!))
|
||||
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50!))
|
||||
Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0)
|
||||
Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0)
|
||||
Me.TableLayoutPanel1.Location = New System.Drawing.Point(534, 430)
|
||||
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
|
||||
Me.TableLayoutPanel1.RowCount = 1
|
||||
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50!))
|
||||
Me.TableLayoutPanel1.Size = New System.Drawing.Size(240, 39)
|
||||
Me.TableLayoutPanel1.TabIndex = 0
|
||||
'
|
||||
'OK_Button
|
||||
'
|
||||
Me.OK_Button.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.OK_Button.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
|
||||
Me.OK_Button.Location = New System.Drawing.Point(3, 3)
|
||||
Me.OK_Button.Name = "OK_Button"
|
||||
Me.OK_Button.Size = New System.Drawing.Size(114, 33)
|
||||
Me.OK_Button.TabIndex = 0
|
||||
Me.OK_Button.Text = "确定"
|
||||
'
|
||||
'Cancel_Button
|
||||
'
|
||||
Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
||||
Me.Cancel_Button.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.Cancel_Button.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
|
||||
Me.Cancel_Button.Location = New System.Drawing.Point(123, 3)
|
||||
Me.Cancel_Button.Name = "Cancel_Button"
|
||||
Me.Cancel_Button.Size = New System.Drawing.Size(114, 33)
|
||||
Me.Cancel_Button.TabIndex = 1
|
||||
Me.Cancel_Button.Text = "取消"
|
||||
'
|
||||
'PicStationPreview
|
||||
'
|
||||
Me.PicStationPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
|
||||
Me.PicStationPreview.Location = New System.Drawing.Point(24, 181)
|
||||
Me.PicStationPreview.Name = "PicStationPreview"
|
||||
Me.PicStationPreview.Size = New System.Drawing.Size(200, 200)
|
||||
Me.PicStationPreview.TabIndex = 5
|
||||
Me.PicStationPreview.TabStop = false
|
||||
'
|
||||
'CboStation
|
||||
'
|
||||
Me.CboStation.Font = New System.Drawing.Font("宋体", 12!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
|
||||
Me.CboStation.FormattingEnabled = true
|
||||
Me.CboStation.Location = New System.Drawing.Point(24, 49)
|
||||
Me.CboStation.Name = "CboStation"
|
||||
Me.CboStation.Size = New System.Drawing.Size(200, 24)
|
||||
Me.CboStation.TabIndex = 9
|
||||
'
|
||||
'LblStation
|
||||
'
|
||||
Me.LblStation.AutoSize = true
|
||||
Me.LblStation.Location = New System.Drawing.Point(6, 27)
|
||||
Me.LblStation.Name = "LblStation"
|
||||
Me.LblStation.Size = New System.Drawing.Size(41, 12)
|
||||
Me.LblStation.TabIndex = 8
|
||||
Me.LblStation.Text = "站位:"
|
||||
'
|
||||
'CboProject
|
||||
'
|
||||
Me.CboProject.Font = New System.Drawing.Font("宋体", 12!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
|
||||
Me.CboProject.FormattingEnabled = true
|
||||
Me.CboProject.Location = New System.Drawing.Point(24, 49)
|
||||
Me.CboProject.Name = "CboProject"
|
||||
Me.CboProject.Size = New System.Drawing.Size(200, 24)
|
||||
Me.CboProject.TabIndex = 7
|
||||
'
|
||||
'LblProject
|
||||
'
|
||||
Me.LblProject.AutoSize = true
|
||||
Me.LblProject.Location = New System.Drawing.Point(6, 27)
|
||||
Me.LblProject.Name = "LblProject"
|
||||
Me.LblProject.Size = New System.Drawing.Size(41, 12)
|
||||
Me.LblProject.TabIndex = 6
|
||||
Me.LblProject.Text = "项目:"
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = true
|
||||
Me.Label1.Location = New System.Drawing.Point(6, 166)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(41, 12)
|
||||
Me.Label1.TabIndex = 10
|
||||
Me.Label1.Text = "预览:"
|
||||
'
|
||||
'GrpStationDesc
|
||||
'
|
||||
Me.GrpStationDesc.Controls.Add(Me.Label3)
|
||||
Me.GrpStationDesc.Controls.Add(Me.RtxStationDesc)
|
||||
Me.GrpStationDesc.Controls.Add(Me.CboStation)
|
||||
Me.GrpStationDesc.Controls.Add(Me.LblStation)
|
||||
Me.GrpStationDesc.Location = New System.Drawing.Point(291, 15)
|
||||
Me.GrpStationDesc.Name = "GrpStationDesc"
|
||||
Me.GrpStationDesc.Size = New System.Drawing.Size(483, 400)
|
||||
Me.GrpStationDesc.TabIndex = 11
|
||||
Me.GrpStationDesc.TabStop = false
|
||||
Me.GrpStationDesc.Text = "站位描述"
|
||||
'
|
||||
'Label3
|
||||
'
|
||||
Me.Label3.AutoSize = true
|
||||
Me.Label3.Location = New System.Drawing.Point(6, 82)
|
||||
Me.Label3.Name = "Label3"
|
||||
Me.Label3.Size = New System.Drawing.Size(41, 12)
|
||||
Me.Label3.TabIndex = 11
|
||||
Me.Label3.Text = "简介:"
|
||||
'
|
||||
'RtxStationDesc
|
||||
'
|
||||
Me.RtxStationDesc.BorderStyle = System.Windows.Forms.BorderStyle.None
|
||||
Me.RtxStationDesc.Font = New System.Drawing.Font("宋体", 12!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
|
||||
Me.RtxStationDesc.ForeColor = System.Drawing.Color.Gray
|
||||
Me.RtxStationDesc.Location = New System.Drawing.Point(24, 97)
|
||||
Me.RtxStationDesc.Name = "RtxStationDesc"
|
||||
Me.RtxStationDesc.ReadOnly = true
|
||||
Me.RtxStationDesc.Size = New System.Drawing.Size(434, 284)
|
||||
Me.RtxStationDesc.TabIndex = 10
|
||||
Me.RtxStationDesc.Text = ""
|
||||
'
|
||||
'GroupBox1
|
||||
'
|
||||
Me.GroupBox1.Controls.Add(Me.RtxProjectDesc)
|
||||
Me.GroupBox1.Controls.Add(Me.Label2)
|
||||
Me.GroupBox1.Controls.Add(Me.CboProject)
|
||||
Me.GroupBox1.Controls.Add(Me.Label1)
|
||||
Me.GroupBox1.Controls.Add(Me.LblProject)
|
||||
Me.GroupBox1.Controls.Add(Me.PicStationPreview)
|
||||
Me.GroupBox1.Location = New System.Drawing.Point(23, 15)
|
||||
Me.GroupBox1.Name = "GroupBox1"
|
||||
Me.GroupBox1.Size = New System.Drawing.Size(240, 400)
|
||||
Me.GroupBox1.TabIndex = 12
|
||||
Me.GroupBox1.TabStop = false
|
||||
Me.GroupBox1.Text = "项目描述"
|
||||
'
|
||||
'RtxProjectDesc
|
||||
'
|
||||
Me.RtxProjectDesc.BorderStyle = System.Windows.Forms.BorderStyle.None
|
||||
Me.RtxProjectDesc.Font = New System.Drawing.Font("宋体", 12!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134,Byte))
|
||||
Me.RtxProjectDesc.Location = New System.Drawing.Point(24, 97)
|
||||
Me.RtxProjectDesc.Name = "RtxProjectDesc"
|
||||
Me.RtxProjectDesc.ReadOnly = true
|
||||
Me.RtxProjectDesc.Size = New System.Drawing.Size(200, 57)
|
||||
Me.RtxProjectDesc.TabIndex = 12
|
||||
Me.RtxProjectDesc.Text = ""
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = true
|
||||
Me.Label2.Location = New System.Drawing.Point(6, 82)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(41, 12)
|
||||
Me.Label2.TabIndex = 8
|
||||
Me.Label2.Text = "简介:"
|
||||
'
|
||||
'DlgLoadStation
|
||||
'
|
||||
Me.AcceptButton = Me.OK_Button
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 12!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.CancelButton = Me.Cancel_Button
|
||||
Me.ClientSize = New System.Drawing.Size(794, 470)
|
||||
Me.Controls.Add(Me.GroupBox1)
|
||||
Me.Controls.Add(Me.GrpStationDesc)
|
||||
Me.Controls.Add(Me.TableLayoutPanel1)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
|
||||
Me.MaximizeBox = false
|
||||
Me.MinimizeBox = false
|
||||
Me.Name = "DlgLoadStation"
|
||||
Me.ShowInTaskbar = false
|
||||
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
|
||||
Me.Text = "DlgLoadStation"
|
||||
Me.TableLayoutPanel1.ResumeLayout(false)
|
||||
CType(Me.PicStationPreview,System.ComponentModel.ISupportInitialize).EndInit
|
||||
Me.GrpStationDesc.ResumeLayout(false)
|
||||
Me.GrpStationDesc.PerformLayout
|
||||
Me.GroupBox1.ResumeLayout(false)
|
||||
Me.GroupBox1.PerformLayout
|
||||
Me.ResumeLayout(false)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
|
||||
Friend WithEvents OK_Button As System.Windows.Forms.Button
|
||||
Friend WithEvents Cancel_Button As System.Windows.Forms.Button
|
||||
Friend WithEvents PicStationPreview As Windows.Forms.PictureBox
|
||||
Friend WithEvents CboStation As Windows.Forms.ComboBox
|
||||
Friend WithEvents LblStation As Windows.Forms.Label
|
||||
Friend WithEvents CboProject As Windows.Forms.ComboBox
|
||||
Friend WithEvents LblProject As Windows.Forms.Label
|
||||
Friend WithEvents Label1 As Windows.Forms.Label
|
||||
Friend WithEvents GrpStationDesc As Windows.Forms.GroupBox
|
||||
Friend WithEvents GroupBox1 As Windows.Forms.GroupBox
|
||||
Friend WithEvents Label2 As Windows.Forms.Label
|
||||
Friend WithEvents Label3 As Windows.Forms.Label
|
||||
Friend WithEvents RtxStationDesc As Windows.Forms.RichTextBox
|
||||
Friend WithEvents RtxProjectDesc As Windows.Forms.RichTextBox
|
||||
End Class
|
||||
End Namespace
|
||||
120
UTS_Core/UTSModule/Project/DlgLoadStation.resx
Normal file
120
UTS_Core/UTSModule/Project/DlgLoadStation.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
134
UTS_Core/UTSModule/Project/DlgLoadStation.vb
Normal file
134
UTS_Core/UTSModule/Project/DlgLoadStation.vb
Normal file
@@ -0,0 +1,134 @@
|
||||
Imports System.Drawing
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class DlgLoadStation
|
||||
Public Property StationInfo() As StationInfo
|
||||
Public Property UserInfo() As Login.UserInfo
|
||||
|
||||
Private _projectInfo As ProjectInfo
|
||||
|
||||
Private _projectName As String
|
||||
|
||||
Private _stationName As String
|
||||
|
||||
Public Function InitProjectStationInfoWithoutShow(projectName As String, stationName As String) As Boolean
|
||||
Dim projectList As String() = ProjectInfo.LoadProjectList(ProjectInfo.InitializeModeEnum.LocalDatabaseLoad)
|
||||
If projectList.Contains(projectName) = False Then Return False
|
||||
|
||||
_projectInfo = New ProjectInfo(UserInfo.UserId, projectName, ProjectInfo.InitializeModeEnum.LocalDatabaseLoad)
|
||||
For Each projectStationInfo As StationInfo In _projectInfo.Station
|
||||
If projectStationInfo.Name = stationName Then
|
||||
StationInfo = projectStationInfo
|
||||
StationInfo.UserId = UserInfo.UserId
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
Return StationInfo IsNot Nothing
|
||||
End Function
|
||||
|
||||
Public Overloads Function ShowDialog(projectName As String, stationName As String) As DialogResult
|
||||
_projectName = projectName
|
||||
_stationName = stationName
|
||||
Return Me.ShowDialog
|
||||
End Function
|
||||
|
||||
Private Sub OK_Button_Click(ByVal sender As Object, ByVal e As EventArgs) Handles OK_Button.Click
|
||||
DialogResult = DialogResult.OK
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Private Sub Cancel_Button_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Cancel_Button.Click
|
||||
DialogResult = DialogResult.Cancel
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Private Sub InitPreviewImage()
|
||||
PicStationPreview.SizeMode = PictureBoxSizeMode.StretchImage
|
||||
End Sub
|
||||
|
||||
Private Sub InitializeForm()
|
||||
Text = $"请选择需要加载的项目"
|
||||
End Sub
|
||||
|
||||
Private Sub DlgLoadStation_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
InitializeForm()
|
||||
InitPreviewImage()
|
||||
UpdateProjectList()
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateProjectList()
|
||||
CboProject.Items.Clear()
|
||||
CboProject.Items.AddRange(ProjectInfo.LoadProjectList(ProjectInfo.InitializeModeEnum.LocalDatabaseLoad))
|
||||
|
||||
If String.IsNullOrEmpty(_projectName) = False Then
|
||||
For i As Integer = 0 To CboProject.Items.Count - 1
|
||||
If CboProject.Items(i).ToString() = _projectName Then
|
||||
CboProject.SelectedIndex = i
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
If CboProject.Items.Count > 0 Then CboProject.SelectedIndex = 0
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateProjectStation(stations As List(Of StationInfo))
|
||||
CboStation.Items.Clear()
|
||||
|
||||
For Each station As StationInfo In stations
|
||||
CboStation.Items.Add(station.Name)
|
||||
Next
|
||||
|
||||
|
||||
'添加所有站位描述
|
||||
RtxStationDesc.SuspendLayout()
|
||||
RtxStationDesc.Clear()
|
||||
For Each station As StationInfo In stations
|
||||
RtxStationDesc.AppendText($"{station.Name}:{station.Description}{vbNewLine}")
|
||||
Next
|
||||
RtxStationDesc.ResumeLayout(False)
|
||||
RtxStationDesc.PerformLayout()
|
||||
|
||||
If String.IsNullOrEmpty(_stationName) = False Then
|
||||
For i As Integer = 0 To CboStation.Items.Count - 1
|
||||
If CboStation.Items(i).ToString() = _stationName Then
|
||||
CboStation.SelectedIndex = i
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
If CboStation.Items.Count > 0 Then CboStation.SelectedIndex = 0
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CboProject_SelectedIndexChanged(sender As Object, e As EventArgs) Handles CboProject.SelectedIndexChanged
|
||||
_projectInfo = New ProjectInfo(UserInfo.UserId, CboProject.Text, ProjectInfo.InitializeModeEnum.LocalDatabaseLoad)
|
||||
|
||||
RtxProjectDesc.Text = _projectInfo.Description
|
||||
|
||||
If _projectInfo.PreviewImage IsNot Nothing Then
|
||||
PicStationPreview.Image = _projectInfo.PreviewImage
|
||||
End If
|
||||
|
||||
UpdateProjectStation(_projectInfo.Station)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CboStation_SelectedIndexChanged(sender As Object, e As EventArgs) Handles CboStation.SelectedIndexChanged
|
||||
Dim selectIndex As Integer = CboStation.SelectedIndex
|
||||
StationInfo = _projectInfo.Station.Item(selectIndex)
|
||||
StationInfo.UserId = UserInfo.UserId
|
||||
|
||||
Static lastSelectIndex As Integer = 0
|
||||
RtxStationDesc.Select(RtxStationDesc.GetFirstCharIndexFromLine(lastSelectIndex), RtxStationDesc.Lines(lastSelectIndex).Length)
|
||||
RtxStationDesc.SelectionColor = Color.Gray
|
||||
lastSelectIndex = selectIndex
|
||||
|
||||
|
||||
RtxStationDesc.Select(RtxStationDesc.GetFirstCharIndexFromLine(selectIndex), RtxStationDesc.Lines(selectIndex).Length)
|
||||
RtxStationDesc.SelectionColor = Color.Blue
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
479
UTS_Core/UTSModule/Project/FrmProject.Designer.vb
generated
Normal file
479
UTS_Core/UTSModule/Project/FrmProject.Designer.vb
generated
Normal file
@@ -0,0 +1,479 @@
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Namespace UTSModule.Project
|
||||
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class FrmProject
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form 重写 Dispose,以清理组件列表。
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Windows 窗体设计器所必需的
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'注意: 以下过程是 Windows 窗体设计器所必需的
|
||||
'可以使用 Windows 窗体设计器修改它。
|
||||
'不要使用代码编辑器修改它。
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmProject))
|
||||
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip()
|
||||
Me.TsBtnNewProject = New System.Windows.Forms.ToolStripButton()
|
||||
Me.TsBtnLoadProject = New System.Windows.Forms.ToolStripButton()
|
||||
Me.TsBtnCloneProject = New System.Windows.Forms.ToolStripButton()
|
||||
Me.TsBtnSaveProject = New System.Windows.Forms.ToolStripButton()
|
||||
Me.TsBtnReleaseProject = New System.Windows.Forms.ToolStripButton()
|
||||
Me.TsBtnDeleteProject = New System.Windows.Forms.ToolStripButton()
|
||||
Me.GroupBox2 = New System.Windows.Forms.GroupBox()
|
||||
Me.Label6 = New System.Windows.Forms.Label()
|
||||
Me.Panel1 = New System.Windows.Forms.Panel()
|
||||
Me.RadTestCreate = New System.Windows.Forms.RadioButton()
|
||||
Me.RadOrderCreate = New System.Windows.Forms.RadioButton()
|
||||
Me.CboProjectType = New System.Windows.Forms.ComboBox()
|
||||
Me.Label4 = New System.Windows.Forms.Label()
|
||||
Me.DtpValidDate = New System.Windows.Forms.DateTimePicker()
|
||||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
Me.NudPrice = New System.Windows.Forms.NumericUpDown()
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
Me.TxtRemark = New System.Windows.Forms.TextBox()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
|
||||
Me.PicProject = New System.Windows.Forms.PictureBox()
|
||||
Me.TxtDescription = New System.Windows.Forms.TextBox()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.TxtProjectName = New System.Windows.Forms.TextBox()
|
||||
Me.LblProjectNameTip = New System.Windows.Forms.Label()
|
||||
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
|
||||
Me.GrdStations = New FlexCell.Grid()
|
||||
Me.CtmStation = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.TsmAddStation = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.TsmRemoveStation = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.TsmMoveUpStation = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.TsmMoveDownStation = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.MsiStationPreview = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.SplProject = New System.Windows.Forms.SplitContainer()
|
||||
Me.ToolStrip1.SuspendLayout()
|
||||
Me.GroupBox2.SuspendLayout()
|
||||
Me.Panel1.SuspendLayout()
|
||||
CType(Me.NudPrice, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.GroupBox3.SuspendLayout()
|
||||
CType(Me.PicProject, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.GroupBox1.SuspendLayout()
|
||||
Me.CtmStation.SuspendLayout()
|
||||
CType(Me.SplProject, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplProject.Panel1.SuspendLayout()
|
||||
Me.SplProject.Panel2.SuspendLayout()
|
||||
Me.SplProject.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'ToolStrip1
|
||||
'
|
||||
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TsBtnNewProject, Me.TsBtnLoadProject, Me.TsBtnCloneProject, Me.TsBtnSaveProject, Me.TsBtnReleaseProject, Me.TsBtnDeleteProject})
|
||||
Me.ToolStrip1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.ToolStrip1.Name = "ToolStrip1"
|
||||
Me.ToolStrip1.Size = New System.Drawing.Size(670, 40)
|
||||
Me.ToolStrip1.TabIndex = 3
|
||||
Me.ToolStrip1.Text = "ToolStrip1"
|
||||
'
|
||||
'TsBtnNewProject
|
||||
'
|
||||
Me.TsBtnNewProject.Image = CType(resources.GetObject("TsBtnNewProject.Image"), System.Drawing.Image)
|
||||
Me.TsBtnNewProject.ImageTransparentColor = System.Drawing.Color.Magenta
|
||||
Me.TsBtnNewProject.Name = "TsBtnNewProject"
|
||||
Me.TsBtnNewProject.Size = New System.Drawing.Size(60, 37)
|
||||
Me.TsBtnNewProject.Text = "新建项目"
|
||||
Me.TsBtnNewProject.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
|
||||
'
|
||||
'TsBtnLoadProject
|
||||
'
|
||||
Me.TsBtnLoadProject.Image = CType(resources.GetObject("TsBtnLoadProject.Image"), System.Drawing.Image)
|
||||
Me.TsBtnLoadProject.ImageTransparentColor = System.Drawing.Color.Magenta
|
||||
Me.TsBtnLoadProject.Name = "TsBtnLoadProject"
|
||||
Me.TsBtnLoadProject.Size = New System.Drawing.Size(60, 37)
|
||||
Me.TsBtnLoadProject.Text = "加载项目"
|
||||
Me.TsBtnLoadProject.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
|
||||
'
|
||||
'TsBtnCloneProject
|
||||
'
|
||||
Me.TsBtnCloneProject.Image = CType(resources.GetObject("TsBtnCloneProject.Image"), System.Drawing.Image)
|
||||
Me.TsBtnCloneProject.ImageTransparentColor = System.Drawing.Color.Magenta
|
||||
Me.TsBtnCloneProject.Name = "TsBtnCloneProject"
|
||||
Me.TsBtnCloneProject.Size = New System.Drawing.Size(60, 37)
|
||||
Me.TsBtnCloneProject.Text = "克隆项目"
|
||||
Me.TsBtnCloneProject.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
|
||||
'
|
||||
'TsBtnSaveProject
|
||||
'
|
||||
Me.TsBtnSaveProject.Image = CType(resources.GetObject("TsBtnSaveProject.Image"), System.Drawing.Image)
|
||||
Me.TsBtnSaveProject.ImageTransparentColor = System.Drawing.Color.Magenta
|
||||
Me.TsBtnSaveProject.Name = "TsBtnSaveProject"
|
||||
Me.TsBtnSaveProject.Size = New System.Drawing.Size(60, 37)
|
||||
Me.TsBtnSaveProject.Text = "保存项目"
|
||||
Me.TsBtnSaveProject.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
|
||||
'
|
||||
'TsBtnReleaseProject
|
||||
'
|
||||
Me.TsBtnReleaseProject.Image = CType(resources.GetObject("TsBtnReleaseProject.Image"), System.Drawing.Image)
|
||||
Me.TsBtnReleaseProject.ImageTransparentColor = System.Drawing.Color.Magenta
|
||||
Me.TsBtnReleaseProject.Name = "TsBtnReleaseProject"
|
||||
Me.TsBtnReleaseProject.Size = New System.Drawing.Size(60, 37)
|
||||
Me.TsBtnReleaseProject.Text = "发布项目"
|
||||
Me.TsBtnReleaseProject.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
|
||||
'
|
||||
'TsBtnDeleteProject
|
||||
'
|
||||
Me.TsBtnDeleteProject.ForeColor = System.Drawing.Color.Black
|
||||
Me.TsBtnDeleteProject.Image = CType(resources.GetObject("TsBtnDeleteProject.Image"), System.Drawing.Image)
|
||||
Me.TsBtnDeleteProject.ImageTransparentColor = System.Drawing.Color.Magenta
|
||||
Me.TsBtnDeleteProject.Name = "TsBtnDeleteProject"
|
||||
Me.TsBtnDeleteProject.Size = New System.Drawing.Size(60, 37)
|
||||
Me.TsBtnDeleteProject.Text = "删除项目"
|
||||
Me.TsBtnDeleteProject.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
|
||||
'
|
||||
'GroupBox2
|
||||
'
|
||||
Me.GroupBox2.Controls.Add(Me.Label6)
|
||||
Me.GroupBox2.Controls.Add(Me.Panel1)
|
||||
Me.GroupBox2.Controls.Add(Me.CboProjectType)
|
||||
Me.GroupBox2.Controls.Add(Me.Label4)
|
||||
Me.GroupBox2.Controls.Add(Me.DtpValidDate)
|
||||
Me.GroupBox2.Controls.Add(Me.Label5)
|
||||
Me.GroupBox2.Controls.Add(Me.NudPrice)
|
||||
Me.GroupBox2.Controls.Add(Me.Label3)
|
||||
Me.GroupBox2.Controls.Add(Me.TxtRemark)
|
||||
Me.GroupBox2.Controls.Add(Me.Label2)
|
||||
Me.GroupBox2.Controls.Add(Me.GroupBox3)
|
||||
Me.GroupBox2.Controls.Add(Me.TxtDescription)
|
||||
Me.GroupBox2.Controls.Add(Me.Label1)
|
||||
Me.GroupBox2.Controls.Add(Me.TxtProjectName)
|
||||
Me.GroupBox2.Controls.Add(Me.LblProjectNameTip)
|
||||
Me.GroupBox2.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GroupBox2.Location = New System.Drawing.Point(0, 0)
|
||||
Me.GroupBox2.Name = "GroupBox2"
|
||||
Me.GroupBox2.Size = New System.Drawing.Size(670, 199)
|
||||
Me.GroupBox2.TabIndex = 5
|
||||
Me.GroupBox2.TabStop = False
|
||||
Me.GroupBox2.Text = "项目信息"
|
||||
'
|
||||
'Label6
|
||||
'
|
||||
Me.Label6.AutoSize = True
|
||||
Me.Label6.Location = New System.Drawing.Point(2, 74)
|
||||
Me.Label6.Name = "Label6"
|
||||
Me.Label6.Size = New System.Drawing.Size(59, 12)
|
||||
Me.Label6.TabIndex = 25
|
||||
Me.Label6.Text = "条码规则:"
|
||||
'
|
||||
'Panel1
|
||||
'
|
||||
Me.Panel1.Controls.Add(Me.RadTestCreate)
|
||||
Me.Panel1.Controls.Add(Me.RadOrderCreate)
|
||||
Me.Panel1.Location = New System.Drawing.Point(66, 69)
|
||||
Me.Panel1.Name = "Panel1"
|
||||
Me.Panel1.Size = New System.Drawing.Size(318, 22)
|
||||
Me.Panel1.TabIndex = 24
|
||||
'
|
||||
'RadTestCreate
|
||||
'
|
||||
Me.RadTestCreate.AutoSize = True
|
||||
Me.RadTestCreate.Location = New System.Drawing.Point(200, 3)
|
||||
Me.RadTestCreate.Name = "RadTestCreate"
|
||||
Me.RadTestCreate.Size = New System.Drawing.Size(83, 16)
|
||||
Me.RadTestCreate.TabIndex = 1
|
||||
Me.RadTestCreate.Text = "测试时生成"
|
||||
Me.RadTestCreate.UseVisualStyleBackColor = True
|
||||
'
|
||||
'RadOrderCreate
|
||||
'
|
||||
Me.RadOrderCreate.AutoSize = True
|
||||
Me.RadOrderCreate.Checked = True
|
||||
Me.RadOrderCreate.Location = New System.Drawing.Point(3, 3)
|
||||
Me.RadOrderCreate.Name = "RadOrderCreate"
|
||||
Me.RadOrderCreate.Size = New System.Drawing.Size(95, 16)
|
||||
Me.RadOrderCreate.TabIndex = 0
|
||||
Me.RadOrderCreate.TabStop = True
|
||||
Me.RadOrderCreate.Text = "跟随订单生成"
|
||||
Me.RadOrderCreate.UseVisualStyleBackColor = True
|
||||
'
|
||||
'CboProjectType
|
||||
'
|
||||
Me.CboProjectType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||
Me.CboProjectType.FormattingEnabled = True
|
||||
Me.CboProjectType.Location = New System.Drawing.Point(264, 19)
|
||||
Me.CboProjectType.Name = "CboProjectType"
|
||||
Me.CboProjectType.Size = New System.Drawing.Size(120, 20)
|
||||
Me.CboProjectType.TabIndex = 23
|
||||
'
|
||||
'Label4
|
||||
'
|
||||
Me.Label4.AutoSize = True
|
||||
Me.Label4.Location = New System.Drawing.Point(223, 22)
|
||||
Me.Label4.Name = "Label4"
|
||||
Me.Label4.Size = New System.Drawing.Size(35, 12)
|
||||
Me.Label4.TabIndex = 22
|
||||
Me.Label4.Text = "类型:"
|
||||
'
|
||||
'DtpValidDate
|
||||
'
|
||||
Me.DtpValidDate.CustomFormat = "yyyy-MM-dd"
|
||||
Me.DtpValidDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom
|
||||
Me.DtpValidDate.Location = New System.Drawing.Point(66, 45)
|
||||
Me.DtpValidDate.Name = "DtpValidDate"
|
||||
Me.DtpValidDate.Size = New System.Drawing.Size(134, 21)
|
||||
Me.DtpValidDate.TabIndex = 21
|
||||
'
|
||||
'Label5
|
||||
'
|
||||
Me.Label5.AutoSize = True
|
||||
Me.Label5.Location = New System.Drawing.Point(13, 51)
|
||||
Me.Label5.Name = "Label5"
|
||||
Me.Label5.Size = New System.Drawing.Size(47, 12)
|
||||
Me.Label5.TabIndex = 20
|
||||
Me.Label5.Text = "有效至:"
|
||||
'
|
||||
'NudPrice
|
||||
'
|
||||
Me.NudPrice.DecimalPlaces = 2
|
||||
Me.NudPrice.Location = New System.Drawing.Point(264, 45)
|
||||
Me.NudPrice.Maximum = New Decimal(New Integer() {20200202, 0, 0, 0})
|
||||
Me.NudPrice.Name = "NudPrice"
|
||||
Me.NudPrice.Size = New System.Drawing.Size(120, 21)
|
||||
Me.NudPrice.TabIndex = 9
|
||||
'
|
||||
'Label3
|
||||
'
|
||||
Me.Label3.AutoSize = True
|
||||
Me.Label3.Location = New System.Drawing.Point(223, 47)
|
||||
Me.Label3.Name = "Label3"
|
||||
Me.Label3.Size = New System.Drawing.Size(35, 12)
|
||||
Me.Label3.TabIndex = 8
|
||||
Me.Label3.Text = "单价:"
|
||||
'
|
||||
'TxtRemark
|
||||
'
|
||||
Me.TxtRemark.Location = New System.Drawing.Point(66, 163)
|
||||
Me.TxtRemark.Multiline = True
|
||||
Me.TxtRemark.Name = "TxtRemark"
|
||||
Me.TxtRemark.Size = New System.Drawing.Size(318, 32)
|
||||
Me.TxtRemark.TabIndex = 7
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Location = New System.Drawing.Point(25, 163)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(35, 12)
|
||||
Me.Label2.TabIndex = 6
|
||||
Me.Label2.Text = "备注:"
|
||||
'
|
||||
'GroupBox3
|
||||
'
|
||||
Me.GroupBox3.Controls.Add(Me.PicProject)
|
||||
Me.GroupBox3.Location = New System.Drawing.Point(411, 11)
|
||||
Me.GroupBox3.Name = "GroupBox3"
|
||||
Me.GroupBox3.Size = New System.Drawing.Size(237, 184)
|
||||
Me.GroupBox3.TabIndex = 5
|
||||
Me.GroupBox3.TabStop = False
|
||||
Me.GroupBox3.Text = "项目图像"
|
||||
'
|
||||
'PicProject
|
||||
'
|
||||
Me.PicProject.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.PicProject.Location = New System.Drawing.Point(3, 17)
|
||||
Me.PicProject.Name = "PicProject"
|
||||
Me.PicProject.Size = New System.Drawing.Size(231, 164)
|
||||
Me.PicProject.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
|
||||
Me.PicProject.TabIndex = 4
|
||||
Me.PicProject.TabStop = False
|
||||
'
|
||||
'TxtDescription
|
||||
'
|
||||
Me.TxtDescription.Location = New System.Drawing.Point(66, 94)
|
||||
Me.TxtDescription.Multiline = True
|
||||
Me.TxtDescription.Name = "TxtDescription"
|
||||
Me.TxtDescription.Size = New System.Drawing.Size(318, 64)
|
||||
Me.TxtDescription.TabIndex = 3
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Location = New System.Drawing.Point(25, 94)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(35, 12)
|
||||
Me.Label1.TabIndex = 2
|
||||
Me.Label1.Text = "描述:"
|
||||
'
|
||||
'TxtProjectName
|
||||
'
|
||||
Me.TxtProjectName.Location = New System.Drawing.Point(66, 19)
|
||||
Me.TxtProjectName.Name = "TxtProjectName"
|
||||
Me.TxtProjectName.Size = New System.Drawing.Size(134, 21)
|
||||
Me.TxtProjectName.TabIndex = 1
|
||||
'
|
||||
'LblProjectNameTip
|
||||
'
|
||||
Me.LblProjectNameTip.AutoSize = True
|
||||
Me.LblProjectNameTip.Location = New System.Drawing.Point(25, 22)
|
||||
Me.LblProjectNameTip.Name = "LblProjectNameTip"
|
||||
Me.LblProjectNameTip.Size = New System.Drawing.Size(35, 12)
|
||||
Me.LblProjectNameTip.TabIndex = 0
|
||||
Me.LblProjectNameTip.Text = "名称:"
|
||||
'
|
||||
'GroupBox1
|
||||
'
|
||||
Me.GroupBox1.Controls.Add(Me.GrdStations)
|
||||
Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GroupBox1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.GroupBox1.Name = "GroupBox1"
|
||||
Me.GroupBox1.Size = New System.Drawing.Size(670, 253)
|
||||
Me.GroupBox1.TabIndex = 6
|
||||
Me.GroupBox1.TabStop = False
|
||||
Me.GroupBox1.Text = "测试站信息"
|
||||
'
|
||||
'GrdStations
|
||||
'
|
||||
Me.GrdStations.BorderStyle = FlexCell.BorderStyleEnum.None
|
||||
Me.GrdStations.CheckedImage = Nothing
|
||||
Me.GrdStations.ContextMenuStrip = Me.CtmStation
|
||||
Me.GrdStations.DefaultFont = New System.Drawing.Font("宋体", 9.0!)
|
||||
Me.GrdStations.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GrdStations.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
|
||||
Me.GrdStations.GridColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer))
|
||||
Me.GrdStations.Location = New System.Drawing.Point(3, 17)
|
||||
Me.GrdStations.MultiSelect = False
|
||||
Me.GrdStations.Name = "GrdStations"
|
||||
Me.GrdStations.Size = New System.Drawing.Size(664, 233)
|
||||
Me.GrdStations.TabIndex = 1
|
||||
Me.GrdStations.UncheckedImage = Nothing
|
||||
'
|
||||
'CtmStation
|
||||
'
|
||||
Me.CtmStation.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TsmAddStation, Me.TsmRemoveStation, Me.TsmMoveUpStation, Me.TsmMoveDownStation, Me.MsiStationPreview})
|
||||
Me.CtmStation.Name = "CtmStation"
|
||||
Me.CtmStation.Size = New System.Drawing.Size(130, 114)
|
||||
'
|
||||
'TsmAddStation
|
||||
'
|
||||
Me.TsmAddStation.Name = "TsmAddStation"
|
||||
Me.TsmAddStation.Size = New System.Drawing.Size(129, 22)
|
||||
Me.TsmAddStation.Text = "(&A)添加站"
|
||||
'
|
||||
'TsmRemoveStation
|
||||
'
|
||||
Me.TsmRemoveStation.Name = "TsmRemoveStation"
|
||||
Me.TsmRemoveStation.Size = New System.Drawing.Size(129, 22)
|
||||
Me.TsmRemoveStation.Text = "(R)删除站"
|
||||
'
|
||||
'TsmMoveUpStation
|
||||
'
|
||||
Me.TsmMoveUpStation.Name = "TsmMoveUpStation"
|
||||
Me.TsmMoveUpStation.Size = New System.Drawing.Size(129, 22)
|
||||
Me.TsmMoveUpStation.Text = "(U)上移站"
|
||||
'
|
||||
'TsmMoveDownStation
|
||||
'
|
||||
Me.TsmMoveDownStation.Name = "TsmMoveDownStation"
|
||||
Me.TsmMoveDownStation.Size = New System.Drawing.Size(129, 22)
|
||||
Me.TsmMoveDownStation.Text = "(D)下移站"
|
||||
'
|
||||
'MsiStationPreview
|
||||
'
|
||||
Me.MsiStationPreview.Name = "MsiStationPreview"
|
||||
Me.MsiStationPreview.Size = New System.Drawing.Size(129, 22)
|
||||
Me.MsiStationPreview.Text = "(&P)预览图"
|
||||
'
|
||||
'SplProject
|
||||
'
|
||||
Me.SplProject.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplProject.Location = New System.Drawing.Point(0, 40)
|
||||
Me.SplProject.Name = "SplProject"
|
||||
Me.SplProject.Orientation = System.Windows.Forms.Orientation.Horizontal
|
||||
'
|
||||
'SplProject.Panel1
|
||||
'
|
||||
Me.SplProject.Panel1.Controls.Add(Me.GroupBox2)
|
||||
'
|
||||
'SplProject.Panel2
|
||||
'
|
||||
Me.SplProject.Panel2.Controls.Add(Me.GroupBox1)
|
||||
Me.SplProject.Size = New System.Drawing.Size(670, 456)
|
||||
Me.SplProject.SplitterDistance = 199
|
||||
Me.SplProject.TabIndex = 7
|
||||
'
|
||||
'FrmProject
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(670, 496)
|
||||
Me.Controls.Add(Me.SplProject)
|
||||
Me.Controls.Add(Me.ToolStrip1)
|
||||
Me.Name = "FrmProject"
|
||||
Me.Text = "FrmProject"
|
||||
Me.ToolStrip1.ResumeLayout(False)
|
||||
Me.ToolStrip1.PerformLayout()
|
||||
Me.GroupBox2.ResumeLayout(False)
|
||||
Me.GroupBox2.PerformLayout()
|
||||
Me.Panel1.ResumeLayout(False)
|
||||
Me.Panel1.PerformLayout()
|
||||
CType(Me.NudPrice, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.GroupBox3.ResumeLayout(False)
|
||||
CType(Me.PicProject, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.GroupBox1.ResumeLayout(False)
|
||||
Me.CtmStation.ResumeLayout(False)
|
||||
Me.SplProject.Panel1.ResumeLayout(False)
|
||||
Me.SplProject.Panel2.ResumeLayout(False)
|
||||
CType(Me.SplProject, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplProject.ResumeLayout(False)
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents ToolStrip1 As ToolStrip
|
||||
Friend WithEvents TsBtnNewProject As ToolStripButton
|
||||
Friend WithEvents TsBtnLoadProject As ToolStripButton
|
||||
Friend WithEvents TsBtnSaveProject As ToolStripButton
|
||||
Friend WithEvents TsBtnReleaseProject As ToolStripButton
|
||||
Friend WithEvents GroupBox2 As GroupBox
|
||||
Friend WithEvents TxtDescription As TextBox
|
||||
Friend WithEvents Label1 As Label
|
||||
Friend WithEvents TxtProjectName As TextBox
|
||||
Friend WithEvents LblProjectNameTip As Label
|
||||
Friend WithEvents GroupBox1 As GroupBox
|
||||
Friend WithEvents GrdStations As FlexCell.Grid
|
||||
Friend WithEvents SplProject As SplitContainer
|
||||
Friend WithEvents CtmStation As ContextMenuStrip
|
||||
Friend WithEvents TsmAddStation As ToolStripMenuItem
|
||||
Friend WithEvents TsmRemoveStation As ToolStripMenuItem
|
||||
Friend WithEvents TsmMoveUpStation As ToolStripMenuItem
|
||||
Friend WithEvents TsmMoveDownStation As ToolStripMenuItem
|
||||
Friend WithEvents TsBtnDeleteProject As ToolStripButton
|
||||
Friend WithEvents PicProject As PictureBox
|
||||
Friend WithEvents MsiStationPreview As ToolStripMenuItem
|
||||
Friend WithEvents GroupBox3 As GroupBox
|
||||
Friend WithEvents TxtRemark As TextBox
|
||||
Friend WithEvents Label2 As Label
|
||||
Friend WithEvents NudPrice As NumericUpDown
|
||||
Friend WithEvents Label3 As Label
|
||||
Friend WithEvents TsBtnCloneProject As ToolStripButton
|
||||
Friend WithEvents DtpValidDate As DateTimePicker
|
||||
Friend WithEvents Label5 As Label
|
||||
Friend WithEvents Label4 As Label
|
||||
Friend WithEvents CboProjectType As ComboBox
|
||||
Friend WithEvents Panel1 As Panel
|
||||
Friend WithEvents RadTestCreate As RadioButton
|
||||
Friend WithEvents RadOrderCreate As RadioButton
|
||||
Friend WithEvents Label6 As Label
|
||||
End Class
|
||||
End Namespace
|
||||
186
UTS_Core/UTSModule/Project/FrmProject.resx
Normal file
186
UTS_Core/UTSModule/Project/FrmProject.resx
Normal file
@@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="TsBtnNewProject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAB+SURBVDhPlZBLDsAgCER7Nu9/l7YbtjbTdMxIUZHkBfzw
|
||||
MB5mVkEp5c3g2Ak2k22JNqvkO17H6AVZwj/QvRm4017hG1lf5x0yFPgJuiadQBuj2k8mnQALwka/D9j4
|
||||
E/Cy1jotogn8H6gA2RMKNFQwIyVAVrYFM5aCDENBHqsPLCJwVXAvuTMAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="TsBtnLoadProject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEcSURBVDhPlZKxqsIwFIb7Bvc+idxHuPQVXFpQcOhe8Amc
|
||||
OqqzCBdU6HQfQIfunVwKoi7FQQeF9GrajufmhDYkTaMY+EjPyf//TZtY9aCUfhVFQRggQbBfSV4PFJ8v
|
||||
GekMf8HqzqE3jXhIhRwsqKyWxYpJ3bzcMpBD4jgG27Y1RACaZ+sEPvoLbmqCa/f7AzLyJ2gGcDO+bXe6
|
||||
ajugDypMiBJQluU3f2DiZ+YmT3eANWIyIyKgFsv/AOs2k4wSgIXneRBFEaRpyhew10ZbwNb3fU1oYrPe
|
||||
qAF5no/CMNSEJsbjiRqAty9JEk1ownEcNaA6BeK6riY2cdgf+SwC2Gf8BEGgCU2slis+iwB2mQZ4Ak3h
|
||||
K0QAIeQTi/cp4B9tCZE2c6oRhQAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="TsBtnCloneProject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEcSURBVDhPlZKxqsIwFIb7Bvc+idxHuPQVXFpQcOhe8Amc
|
||||
OqqzCBdU6HQfQIfunVwKoi7FQQeF9GrajufmhDYkTaMY+EjPyf//TZtY9aCUfhVFQRggQbBfSV4PFJ8v
|
||||
GekMf8HqzqE3jXhIhRwsqKyWxYpJ3bzcMpBD4jgG27Y1RACaZ+sEPvoLbmqCa/f7AzLyJ2gGcDO+bXe6
|
||||
ajugDypMiBJQluU3f2DiZ+YmT3eANWIyIyKgFsv/AOs2k4wSgIXneRBFEaRpyhew10ZbwNb3fU1oYrPe
|
||||
qAF5no/CMNSEJsbjiRqAty9JEk1ownEcNaA6BeK6riY2cdgf+SwC2Gf8BEGgCU2slis+iwB2mQZ4Ak3h
|
||||
K0QAIeQTi/cp4B9tCZE2c6oRhQAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="TsBtnSaveProject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABRSURBVDhPY6AK+Pbt239S8NevX+dDtUIASNDJyQmOP7z/
|
||||
CMfIYiC6ra0N0xBSDABhmCFQ7aQbAMJEG4CMkdXQ1gBi8KgBg9IAcjBUOyWAgQEAoTb4kYkPBE8AAAAA
|
||||
SUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="TsBtnReleaseProject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACQSURBVDhPxZDNDYAgDEYZwVGcgVmYhfUYgwOHakK4Ymoo
|
||||
qQ3y48UvecFC+yKomaSUsgBijHs5HgeHtNYVa+2ahAQHnDdcUlr6kQKS4H7rfhwHABt+dwVYtDDGZO+9
|
||||
mxLwQ2ogSQih1pwpAYIS7GsxJUD4ENWvLyyRAuKz4L8/kOuyQPIQjKgDMtw4ooywKHUBEuGL7JrhBKgA
|
||||
AAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="TsBtnDeleteProject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFrSURBVDhPnZM/SwNBEMXvCwj5ABapbGwsrKy0tdFWsEgp
|
||||
VnZpr9HWQqxVCFipRSoRTKGNWigiqQRRLCImxCAS5P6s85vbNXtyR8AHQ459897OzE4CYIypJEmyJ78m
|
||||
iqJ+mqYbSvyB0CE5HpaVQNC5ujCHs5Mavfb9iBTIdzWO49v2/q45mJowL2dN+NDSQSC3t+52tpQkmktz
|
||||
Zjh470tSBXO+L+trypEn+SdWmsFV4AyI6826tvP5+qyGnGFCJRhbaQYOIB6PGzkTbqMlvr2qqlaWR5kJ
|
||||
gcn34ENSzLxNLwbuZLl+XWDKK9m0YiAuq+BoYXps+TMMjMH5Qn8Gp6uLOkArGcGJi8pG4L8CF0gr21aa
|
||||
gdLO11dyYhbGvbVcUCOHCpyx4HfJArddLore2lb5BEdLnYcbXTIlfYPSRRFwxsaST0tfvbeWEsNuV3ec
|
||||
YBZFYh/MgP8CmysI1ZlVJsaJHSSvRjWEPfovguAHNGLazFL+H1IAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="CtmStation.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>129, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
429
UTS_Core/UTSModule/Project/FrmProject.vb
Normal file
429
UTS_Core/UTSModule/Project/FrmProject.vb
Normal file
@@ -0,0 +1,429 @@
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
Imports System.Windows.Forms
|
||||
Imports UTS_Core.UTSModule.Login
|
||||
Imports UTS_Core.UTSModule.Production
|
||||
Imports UTS_Core.UTSModule.Station
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class FrmProject
|
||||
|
||||
Private _userProject As ProjectInfo
|
||||
Private _userInfo As UserInfo
|
||||
Private _productTypeManager As ProductTypeManager
|
||||
|
||||
Public Sub ShowForm(parentControl As Control, userInfo As UserInfo)
|
||||
FormBorderStyle = FormBorderStyle.None
|
||||
TopLevel = False
|
||||
Dock = DockStyle.Fill
|
||||
Parent = parentControl
|
||||
|
||||
_userInfo = userInfo
|
||||
Show()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub EnabledSaveProject(isEnabled As Boolean)
|
||||
TsBtnSaveProject.Enabled = isEnabled
|
||||
TsBtnReleaseProject.Enabled = isEnabled
|
||||
TsBtnDeleteProject.Enabled = isEnabled
|
||||
|
||||
TxtProjectName.Enabled = isEnabled
|
||||
TxtDescription.Enabled = isEnabled
|
||||
GrdStations.Enabled = isEnabled
|
||||
PicProject.Enabled = isEnabled
|
||||
TxtRemark.Enabled = isEnabled
|
||||
NudPrice.Enabled = isEnabled
|
||||
|
||||
CboProjectType.Enabled = isEnabled
|
||||
DtpValidDate.Enabled = isEnabled
|
||||
|
||||
RadOrderCreate.Enabled = isEnabled
|
||||
RadTestCreate.Enabled = isEnabled
|
||||
End Sub
|
||||
|
||||
Private Sub InitializeForm()
|
||||
_productTypeManager = ProductTypeManager.CreateManager()
|
||||
CboProjectType.Items.AddRange(_productTypeManager.GetAllProductType())
|
||||
|
||||
EnabledSaveProject(_userProject IsNot Nothing)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub FrmProject_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
InitializeForm()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LoadProjectInitForm(project As ProjectInfo)
|
||||
TxtProjectName.Text = project.Name
|
||||
TxtDescription.Text = project.Description
|
||||
TxtRemark.Text = project.Remark
|
||||
PicProject.Image = project.MasterImage
|
||||
NudPrice.Value = project.Price
|
||||
|
||||
Select Case project.SnType
|
||||
Case 0
|
||||
RadTestCreate.Checked = True
|
||||
Case 1
|
||||
RadOrderCreate.Checked = True
|
||||
End Select
|
||||
|
||||
'todo:初始化产品类型ID
|
||||
CboProjectType.SelectedIndex = CboProjectType.Items.IndexOf(_productTypeManager.GetProductType(project.ProductTypeId))
|
||||
DtpValidDate.Value = project.EolDate
|
||||
|
||||
EnabledSaveProject(_userProject IsNot Nothing)
|
||||
ProjectStationGrid.InitTestStationGrid(GrdStations, project)
|
||||
End Sub
|
||||
|
||||
Private Sub TsBtnNewProject_Click(sender As Object, e As EventArgs) Handles TsBtnNewProject.Click
|
||||
Using dlg As New DlgCreateProject
|
||||
If dlg.ShowDialog() <> DialogResult.OK Then Return
|
||||
_userProject = New ProjectInfo(_userInfo.UserId, _userInfo.UserName, dlg.ProjectName)
|
||||
LoadProjectInitForm(_userProject)
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub TsBtnLoadProject_Click(sender As Object, e As EventArgs) Handles TsBtnLoadProject.Click
|
||||
Using dlg As New DlgLoadProject
|
||||
If dlg.ShowDialog() <> DialogResult.OK Then Return
|
||||
Try
|
||||
_userProject = New ProjectInfo(_userInfo.UserId, _userInfo.UserName, dlg.ProjectName, dlg.LoadMode)
|
||||
LoadProjectInitForm(_userProject) '初始化页面
|
||||
Catch ex As Exception
|
||||
MsgBox($"Load Project Error:{ex.Message}")
|
||||
End Try
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub TsBtnCloneProject_Click(sender As Object, e As EventArgs) Handles TsBtnCloneProject.Click
|
||||
Using dlg As New DlgLoadProject
|
||||
If dlg.ShowDialog() <> DialogResult.OK Then Return
|
||||
Try
|
||||
_userProject = New ProjectInfo(_userInfo.UserId, _userInfo.UserName, dlg.ProjectName, dlg.LoadMode)
|
||||
LoadProjectInitForm(_userProject) '初始化页面
|
||||
_userProject.Index = -1
|
||||
Catch ex As Exception
|
||||
MsgBox($"Clone Project Error:{ex.Message}")
|
||||
End Try
|
||||
End Using
|
||||
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 检测用户对项目的修改是否输入合法
|
||||
''' 不合法时会抛出异常
|
||||
''' </summary>
|
||||
Private Sub CheckUserAlter()
|
||||
If String.IsNullOrEmpty(TxtProjectName.Text) Then Throw New Exception($"项目名称不能空,请重新输入!")
|
||||
'后续可新增对项目名中非常规字符的检测
|
||||
|
||||
For row As Integer = 1 To GrdStations.Rows - 1
|
||||
If String.IsNullOrEmpty(GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.Name).Text) Then
|
||||
GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.Name).SetFocus()
|
||||
Throw New Exception($"项目站名不能为空,如若未使用,请右键删除该站!")
|
||||
|
||||
'后续可新增对项目站名中非常规字符的检测
|
||||
End If
|
||||
|
||||
|
||||
If String.IsNullOrEmpty(GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.Type).Text) Then
|
||||
GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.Type).SetFocus()
|
||||
Throw New Exception($"项目类型不能为空,如若未使用,请右键删除该站!")
|
||||
|
||||
'后续可新增对项目站名中非常规字符的检测
|
||||
End If
|
||||
|
||||
|
||||
If String.IsNullOrEmpty(GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.SnType).Text) Then
|
||||
GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.SnType).SetFocus()
|
||||
Throw New Exception($"项目条码规则不能为空,如若未使用,请右键删除该站!")
|
||||
|
||||
'后续可新增对项目站名中非常规字符的检测
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateProjectInfo(project As ProjectInfo)
|
||||
project.UserId = _userInfo.UserId '当前操作项目站用户索引
|
||||
project.UserName = _userInfo.UserName '当前操作项目站用户名称
|
||||
|
||||
If String.Compare(project.Name, TxtProjectName.Text) <> 0 Then
|
||||
project.Name = TxtProjectName.Text
|
||||
project.InfoChanged = True
|
||||
End If
|
||||
|
||||
'todo:检测产品类型修改
|
||||
Dim tmpIndex As Integer = _productTypeManager.GetProductIndex(CboProjectType.Text)
|
||||
If project.ProductTypeId <> tmpIndex Then
|
||||
project.ProductTypeId = tmpIndex
|
||||
project.InfoChanged = True
|
||||
End If
|
||||
|
||||
If String.Compare(project.Description, TxtDescription.Text) <> 0 Then
|
||||
project.Description = TxtDescription.Text
|
||||
project.InfoChanged = True
|
||||
End If
|
||||
|
||||
If String.Compare(project.Remark, TxtRemark.Text) <> 0 Then
|
||||
project.Remark = TxtRemark.Text
|
||||
project.InfoChanged = True
|
||||
End If
|
||||
|
||||
'Momo 2025-07-17 新增对项目有效期的修改检测
|
||||
MsgBox(DtpValidDate.Value)
|
||||
If String.Compare(project.EolDate.ToString, DtpValidDate.Value.ToString) <> 0 Then
|
||||
project.EolDate = DtpValidDate.Value
|
||||
project.InfoChanged = True
|
||||
End If
|
||||
|
||||
If project.Price <> NudPrice.Value Then
|
||||
project.Price = NudPrice.Value
|
||||
project.InfoChanged = True
|
||||
End If
|
||||
|
||||
If RadOrderCreate.Checked Then
|
||||
If project.SnType <> 1 Then
|
||||
project.SnType = 1
|
||||
project.InfoChanged = True
|
||||
End If
|
||||
ElseIf RadTestCreate.Checked Then
|
||||
If project.SnType <> 0 Then
|
||||
project.SnType = 0
|
||||
project.InfoChanged = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
For row As Integer = 1 To GrdStations.Rows - 1
|
||||
Dim info As ProcessStation = project.Station.Item(row - 1)
|
||||
With info
|
||||
.UserId = _userInfo.UserId '当前操作项目站用户名
|
||||
|
||||
Dim stationType As ProcessStation.StationTypeEnum = CType([Enum].Parse(GetType(ProcessStation.StationTypeEnum), GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.Type).Text), ProcessStation.StationTypeEnum)
|
||||
If .StationType <> stationType Then
|
||||
.StationType = stationType
|
||||
.TypeChange = True
|
||||
End If
|
||||
|
||||
Dim stationNum As Integer = row
|
||||
If .ArtworkOrder <> stationNum Then
|
||||
.ArtworkOrder = stationNum
|
||||
.InfoChanged = True
|
||||
End If
|
||||
|
||||
Dim stationName As String = GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.Name).Text
|
||||
If String.Compare(.Name, stationName) <> 0 Then
|
||||
.Name = stationName
|
||||
.InfoChanged = True
|
||||
End If
|
||||
|
||||
Dim stationDesc As String = GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.Description).Text
|
||||
If String.Compare(.Description, stationDesc) <> 0 Then
|
||||
.Description = stationDesc
|
||||
.InfoChanged = True
|
||||
End If
|
||||
|
||||
Dim snType As ProcessStation.SnTypeEnum = CType([Enum].Parse(GetType(ProcessStation.SnTypeEnum), GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.SnType).Text), ProcessStation.SnTypeEnum)
|
||||
If .SnType <> snType Then
|
||||
.SnType = snType
|
||||
.InfoChanged = True
|
||||
End If
|
||||
|
||||
Dim stationDevType As String = GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.DevType).Text
|
||||
If String.Compare(.DevType, stationDevType) <> 0 Then
|
||||
.DevType = stationDevType
|
||||
.InfoChanged = True
|
||||
End If
|
||||
|
||||
Dim stationDevApp As String = GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.DevApp).Text
|
||||
If String.Compare(.DevApp, stationDevApp) <> 0 Then
|
||||
.DevApp = stationDevApp
|
||||
.InfoChanged = True
|
||||
End If
|
||||
|
||||
Dim stationPacketName As String = GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.PacketName).Text
|
||||
If String.Compare(.Packet.FileName, stationPacketName) <> 0 Then
|
||||
.Packet.FileName = stationPacketName
|
||||
.InfoChanged = True
|
||||
End If
|
||||
End With
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub TsBtnSaveProject_Click(sender As Object, e As EventArgs) Handles TsBtnSaveProject.Click
|
||||
Try
|
||||
CheckUserAlter()
|
||||
UpdateProjectInfo(_userProject)
|
||||
|
||||
Dim filePath As String = UtsPath.ProjectFilePath(_userProject.Name)
|
||||
_userProject.ExportToXml(filePath)
|
||||
MsgBox($"Save {_userProject.Name} Project Succes!")
|
||||
Catch ex As Exception
|
||||
MsgBox($"Save {_userProject.Name} Project Fail,{ex.Message}")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub TsBtnReleaseProject_Click(sender As Object, e As EventArgs) Handles TsBtnReleaseProject.Click
|
||||
Try
|
||||
CheckUserAlter()
|
||||
|
||||
UpdateProjectInfo(_userProject)
|
||||
|
||||
Dim filePath As String = UtsPath.ProjectFilePath(_userProject.Name)
|
||||
_userProject.Release(filePath)
|
||||
|
||||
MsgBox($"Release {_userProject.Name} Project Succes!")
|
||||
Catch ex As Exception
|
||||
MsgBox($"Release {_userProject.Name} Project Fail,{ex.Message}")
|
||||
Return
|
||||
End Try
|
||||
|
||||
Try
|
||||
'通过AUTS STUDIO添加机型后,需要调用网站API,更新网站缓存,否则网页不会显示新增的机型信息
|
||||
'临时屏蔽,待新网站完成后此步骤重新启用
|
||||
'’Dim msg As String = GetData("http://uts-data.com/api/Common/ClearCache")
|
||||
'’Console.WriteLine($"Msg:{msg}")
|
||||
Catch ex As Exception
|
||||
MsgBox($"更新缓存数据失败,{ex.Message}")
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetData(url As String) As String
|
||||
Dim request As HttpWebRequest = CType(WebRequest.Create(url & "?" & $"cmd=UP&dbName={UtsDb.RemotePrivateDb}"), HttpWebRequest)
|
||||
request.Accept = "text/html,application/xhtml+xml,*/*"
|
||||
request.ContentType = "application/json"
|
||||
request.Method = "GET"
|
||||
|
||||
Dim sr As New StreamReader(request.GetResponse().GetResponseStream)
|
||||
Return sr.ReadToEnd
|
||||
End Function
|
||||
#Region "测试站检测"
|
||||
|
||||
Private Sub GrdStations_ButtonClick(sender As Object, e As FlexCell.Grid.ButtonClickEventArgs) Handles GrdStations.ButtonClick
|
||||
Select Case e.Col
|
||||
Case ProjectStationGrid.ColNameEnum.PacketName
|
||||
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub TsmAddStation_Click(sender As Object, e As EventArgs) Handles TsmAddStation.Click
|
||||
GrdStations.AddItem(String.Empty)
|
||||
|
||||
_userProject.Station.Add(New ProcessStation(_userProject))
|
||||
End Sub
|
||||
|
||||
Private Sub TsmRemoveStation_Click(sender As Object, e As EventArgs) Handles TsmRemoveStation.Click
|
||||
If GrdStations.Selection Is Nothing Then Return
|
||||
|
||||
If GrdStations.Cell(GrdStations.Selection.FirstRow, ProjectStationGrid.ColNameEnum.Name).Text.Length = 0 Then
|
||||
_userProject.Station.RemoveAt(GrdStations.Selection.FirstRow - 1)
|
||||
GrdStations.Selection.DeleteByRow()
|
||||
Else
|
||||
If MsgBox("数据库会删除对应测试站,该操作不可逆,是否继续此操作?", MsgBoxStyle.OkCancel) = MsgBoxResult.Ok Then
|
||||
GrdStations.Selection.DeleteByRow()
|
||||
|
||||
_userProject.DeleteStation.Add(_userProject.Station.Item(GrdStations.Selection.FirstRow - 1))
|
||||
_userProject.Station.RemoveAt(GrdStations.Selection.FirstRow - 1)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub TsmMoveUpStation_Click(sender As Object, e As EventArgs) Handles TsmMoveUpStation.Click
|
||||
Dim row As Integer = GrdStations.Selection.FirstRow
|
||||
If row = 1 Then Return
|
||||
GrdStations.Row(row).Position -= 1
|
||||
|
||||
|
||||
Dim stationIndex As Integer = row - 1
|
||||
Dim srcProcessStation As ProcessStation = _userProject.Station.Item(stationIndex)
|
||||
_userProject.Station.Item(stationIndex) = _userProject.Station.Item(stationIndex - 1)
|
||||
_userProject.Station.Item(stationIndex - 1) = srcProcessStation
|
||||
End Sub
|
||||
|
||||
Private Sub TsmMoveDownStation_Click(sender As Object, e As EventArgs) Handles TsmMoveDownStation.Click
|
||||
Dim row As Integer = GrdStations.Selection.FirstRow
|
||||
If row = GrdStations.Rows - 1 Then Return
|
||||
GrdStations.Row(row).Position += 1
|
||||
|
||||
|
||||
Dim stationIndex As Integer = row - 1
|
||||
Dim srcProcessStation As ProcessStation = _userProject.Station.Item(stationIndex)
|
||||
_userProject.Station.Item(stationIndex) = _userProject.Station.Item(stationIndex + 1)
|
||||
_userProject.Station.Item(stationIndex + 1) = srcProcessStation
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub TsBtnDeleteProject_Click(sender As Object, e As EventArgs) Handles TsBtnDeleteProject.Click
|
||||
If MsgBox("是否确定删除该项目", MsgBoxStyle.OkCancel) = MsgBoxResult.Ok Then
|
||||
If _userProject Is Nothing Then Return
|
||||
Try
|
||||
_userProject.Delete()
|
||||
_userProject = Nothing
|
||||
EnabledSaveProject(_userProject IsNot Nothing)
|
||||
ProjectStationGrid.InitTestStationGrid(GrdStations)
|
||||
MsgBox("删除完成!")
|
||||
Catch ex As Exception
|
||||
MsgBox("删除失败:" & ex.Message)
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub PicProject_DoubleClick(sender As Object, e As EventArgs) Handles PicProject.DoubleClick
|
||||
Using dlgFile As New OpenFileDialog
|
||||
dlgFile.Filter = $"设备图像 (*.bmp;*.gif;*.jpg;*.png)|*.bmp;*.gif;*.jpg;*.png"
|
||||
If dlgFile.ShowDialog() <> DialogResult.OK Then Return
|
||||
|
||||
Dim imagePath As String = dlgFile.FileName
|
||||
|
||||
_userProject.MasterImage = ImageProcessor.ImageProcessor.CompressImageWithWidth(CType(ImageProcessor.ImageProcessor.GetBitmapImage(imagePath), Drawing.Bitmap), 600)
|
||||
_userProject.PreviewImage = ImageProcessor.ImageProcessor.CompressImageWithWidth(New Drawing.Bitmap(_userProject.MasterImage), 120)
|
||||
|
||||
_userProject.ImageName = $"P_{_userProject.Name}_{Now:yyyyMMdd_HHmmss}.png"
|
||||
|
||||
PicProject.Image = _userProject.MasterImage
|
||||
If _userProject.PreviewImageChanged = False Then _userProject.PreviewImageChanged = True
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub MsiStationPreview_Click(sender As Object, e As EventArgs) Handles MsiStationPreview.Click
|
||||
Dim row As Integer = GrdStations.Selection.FirstRow
|
||||
If row >= GrdStations.Rows OrElse row < 1 Then Return
|
||||
|
||||
Using dlgFile As New OpenFileDialog
|
||||
dlgFile.Filter = $"设备图像 (*.bmp;*.gif;*.jpg;*.png)|*.bmp;*.gif;*.jpg;*.png"
|
||||
If dlgFile.ShowDialog() <> DialogResult.OK Then Return
|
||||
|
||||
Dim imagePath As String = dlgFile.FileName
|
||||
|
||||
_userProject.Station(row - 1).PreViewImage = ImageProcessor.ImageProcessor.CompressImageWithWidth(CType(ImageProcessor.ImageProcessor.GetBitmapImage(imagePath), Drawing.Bitmap), 600)
|
||||
If _userProject.Station(row - 1).PreviewImageChanged = False Then _userProject.Station(row - 1).PreviewImageChanged = True
|
||||
|
||||
Dim imgKey As String
|
||||
If String.IsNullOrEmpty(GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.Preview).ImageKey) Then
|
||||
imgKey = GrdStations.Images.Count().ToString()
|
||||
Else
|
||||
imgKey = GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.Preview).ImageKey
|
||||
GrdStations.Images.Remove(imgKey)
|
||||
End If
|
||||
|
||||
GrdStations.Images.Add(_userProject.Station(row - 1).PreViewImage, imgKey)
|
||||
GrdStations.Cell(row, ProjectStationGrid.ColNameEnum.Preview).SetImage(imgKey)
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
Private Sub GrdStations_Load(sender As Object, e As EventArgs) Handles GrdStations.Load
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
351
UTS_Core/UTSModule/Project/FrmStationDesign.Designer.vb
generated
Normal file
351
UTS_Core/UTSModule/Project/FrmStationDesign.Designer.vb
generated
Normal file
@@ -0,0 +1,351 @@
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Namespace UTSModule.Project
|
||||
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class FrmStationDesign
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form 重写 Dispose,以清理组件列表。
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Windows 窗体设计器所必需的
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'注意: 以下过程是 Windows 窗体设计器所必需的
|
||||
'可以使用 Windows 窗体设计器修改它。
|
||||
'不要使用代码编辑器修改它。
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmStationDesign))
|
||||
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip()
|
||||
Me.TsBtnReleaseStation = New System.Windows.Forms.ToolStripButton()
|
||||
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
|
||||
Me.GroupBox4 = New System.Windows.Forms.GroupBox()
|
||||
Me.TxtTestStation = New System.Windows.Forms.TextBox()
|
||||
Me.TxtProjectName = New System.Windows.Forms.TextBox()
|
||||
Me.NudStationVersion = New System.Windows.Forms.NumericUpDown()
|
||||
Me.ChkAutoAugment = New System.Windows.Forms.CheckBox()
|
||||
Me.Label7 = New System.Windows.Forms.Label()
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
Me.Label4 = New System.Windows.Forms.Label()
|
||||
Me.TxtEditPwd = New System.Windows.Forms.TextBox()
|
||||
Me.DtpValidDate = New System.Windows.Forms.DateTimePicker()
|
||||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
|
||||
Me.PicStation = New System.Windows.Forms.PictureBox()
|
||||
Me.SplitContainer2 = New System.Windows.Forms.SplitContainer()
|
||||
Me.GroupBox2 = New System.Windows.Forms.GroupBox()
|
||||
Me.RtxCurrentImprint = New System.Windows.Forms.RichTextBox()
|
||||
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
|
||||
Me.RtxHistoryImprint = New System.Windows.Forms.RichTextBox()
|
||||
Me.ToolStrip1.SuspendLayout
|
||||
CType(Me.SplitContainer1,System.ComponentModel.ISupportInitialize).BeginInit
|
||||
Me.SplitContainer1.Panel1.SuspendLayout
|
||||
Me.SplitContainer1.Panel2.SuspendLayout
|
||||
Me.SplitContainer1.SuspendLayout
|
||||
Me.GroupBox4.SuspendLayout
|
||||
CType(Me.NudStationVersion,System.ComponentModel.ISupportInitialize).BeginInit
|
||||
Me.GroupBox3.SuspendLayout
|
||||
CType(Me.PicStation,System.ComponentModel.ISupportInitialize).BeginInit
|
||||
CType(Me.SplitContainer2,System.ComponentModel.ISupportInitialize).BeginInit
|
||||
Me.SplitContainer2.Panel1.SuspendLayout
|
||||
Me.SplitContainer2.Panel2.SuspendLayout
|
||||
Me.SplitContainer2.SuspendLayout
|
||||
Me.GroupBox2.SuspendLayout
|
||||
Me.GroupBox1.SuspendLayout
|
||||
Me.SuspendLayout
|
||||
'
|
||||
'ToolStrip1
|
||||
'
|
||||
Me.ToolStrip1.BackColor = System.Drawing.SystemColors.Control
|
||||
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TsBtnReleaseStation})
|
||||
Me.ToolStrip1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.ToolStrip1.Name = "ToolStrip1"
|
||||
Me.ToolStrip1.Size = New System.Drawing.Size(800, 25)
|
||||
Me.ToolStrip1.TabIndex = 6
|
||||
Me.ToolStrip1.Text = "ToolStrip1"
|
||||
'
|
||||
'TsBtnReleaseStation
|
||||
'
|
||||
Me.TsBtnReleaseStation.BackColor = System.Drawing.SystemColors.Control
|
||||
Me.TsBtnReleaseStation.Image = CType(resources.GetObject("TsBtnReleaseStation.Image"),System.Drawing.Image)
|
||||
Me.TsBtnReleaseStation.ImageTransparentColor = System.Drawing.Color.Magenta
|
||||
Me.TsBtnReleaseStation.Name = "TsBtnReleaseStation"
|
||||
Me.TsBtnReleaseStation.Size = New System.Drawing.Size(76, 22)
|
||||
Me.TsBtnReleaseStation.Text = "发布站包"
|
||||
'
|
||||
'SplitContainer1
|
||||
'
|
||||
Me.SplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainer1.Location = New System.Drawing.Point(0, 25)
|
||||
Me.SplitContainer1.Name = "SplitContainer1"
|
||||
'
|
||||
'SplitContainer1.Panel1
|
||||
'
|
||||
Me.SplitContainer1.Panel1.Controls.Add(Me.GroupBox4)
|
||||
Me.SplitContainer1.Panel1.Controls.Add(Me.GroupBox3)
|
||||
'
|
||||
'SplitContainer1.Panel2
|
||||
'
|
||||
Me.SplitContainer1.Panel2.Controls.Add(Me.SplitContainer2)
|
||||
Me.SplitContainer1.Size = New System.Drawing.Size(800, 425)
|
||||
Me.SplitContainer1.SplitterDistance = 475
|
||||
Me.SplitContainer1.TabIndex = 7
|
||||
'
|
||||
'GroupBox4
|
||||
'
|
||||
Me.GroupBox4.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
|
||||
Me.GroupBox4.Controls.Add(Me.TxtTestStation)
|
||||
Me.GroupBox4.Controls.Add(Me.TxtProjectName)
|
||||
Me.GroupBox4.Controls.Add(Me.NudStationVersion)
|
||||
Me.GroupBox4.Controls.Add(Me.ChkAutoAugment)
|
||||
Me.GroupBox4.Controls.Add(Me.Label7)
|
||||
Me.GroupBox4.Controls.Add(Me.Label3)
|
||||
Me.GroupBox4.Controls.Add(Me.Label4)
|
||||
Me.GroupBox4.Controls.Add(Me.TxtEditPwd)
|
||||
Me.GroupBox4.Controls.Add(Me.DtpValidDate)
|
||||
Me.GroupBox4.Controls.Add(Me.Label5)
|
||||
Me.GroupBox4.Location = New System.Drawing.Point(3, 3)
|
||||
Me.GroupBox4.Name = "GroupBox4"
|
||||
Me.GroupBox4.Size = New System.Drawing.Size(469, 120)
|
||||
Me.GroupBox4.TabIndex = 25
|
||||
Me.GroupBox4.TabStop = false
|
||||
Me.GroupBox4.Text = "基本信息"
|
||||
'
|
||||
'TxtTestStation
|
||||
'
|
||||
Me.TxtTestStation.Location = New System.Drawing.Point(296, 28)
|
||||
Me.TxtTestStation.Name = "TxtTestStation"
|
||||
Me.TxtTestStation.ReadOnly = true
|
||||
Me.TxtTestStation.Size = New System.Drawing.Size(137, 21)
|
||||
Me.TxtTestStation.TabIndex = 1
|
||||
'
|
||||
'TxtProjectName
|
||||
'
|
||||
Me.TxtProjectName.Location = New System.Drawing.Point(71, 28)
|
||||
Me.TxtProjectName.Name = "TxtProjectName"
|
||||
Me.TxtProjectName.ReadOnly = true
|
||||
Me.TxtProjectName.Size = New System.Drawing.Size(136, 21)
|
||||
Me.TxtProjectName.TabIndex = 1
|
||||
'
|
||||
'NudStationVersion
|
||||
'
|
||||
Me.NudStationVersion.Enabled = false
|
||||
Me.NudStationVersion.Location = New System.Drawing.Point(296, 82)
|
||||
Me.NudStationVersion.Name = "NudStationVersion"
|
||||
Me.NudStationVersion.Size = New System.Drawing.Size(137, 21)
|
||||
Me.NudStationVersion.TabIndex = 25
|
||||
'
|
||||
'ChkAutoAugment
|
||||
'
|
||||
Me.ChkAutoAugment.AutoSize = true
|
||||
Me.ChkAutoAugment.Checked = true
|
||||
Me.ChkAutoAugment.CheckState = System.Windows.Forms.CheckState.Checked
|
||||
Me.ChkAutoAugment.Location = New System.Drawing.Point(218, 85)
|
||||
Me.ChkAutoAugment.Name = "ChkAutoAugment"
|
||||
Me.ChkAutoAugment.Size = New System.Drawing.Size(72, 16)
|
||||
Me.ChkAutoAugment.TabIndex = 24
|
||||
Me.ChkAutoAugment.Text = "版本递增"
|
||||
Me.ChkAutoAugment.UseVisualStyleBackColor = true
|
||||
'
|
||||
'Label7
|
||||
'
|
||||
Me.Label7.AutoSize = true
|
||||
Me.Label7.Location = New System.Drawing.Point(231, 33)
|
||||
Me.Label7.Name = "Label7"
|
||||
Me.Label7.Size = New System.Drawing.Size(59, 12)
|
||||
Me.Label7.TabIndex = 23
|
||||
Me.Label7.Text = "测试站名:"
|
||||
'
|
||||
'Label3
|
||||
'
|
||||
Me.Label3.AutoSize = true
|
||||
Me.Label3.Location = New System.Drawing.Point(6, 31)
|
||||
Me.Label3.Name = "Label3"
|
||||
Me.Label3.Size = New System.Drawing.Size(59, 12)
|
||||
Me.Label3.TabIndex = 10
|
||||
Me.Label3.Text = "测试项目:"
|
||||
'
|
||||
'Label4
|
||||
'
|
||||
Me.Label4.AutoSize = true
|
||||
Me.Label4.Location = New System.Drawing.Point(6, 58)
|
||||
Me.Label4.Name = "Label4"
|
||||
Me.Label4.Size = New System.Drawing.Size(59, 12)
|
||||
Me.Label4.TabIndex = 16
|
||||
Me.Label4.Text = "编辑密码:"
|
||||
'
|
||||
'TxtEditPwd
|
||||
'
|
||||
Me.TxtEditPwd.Location = New System.Drawing.Point(71, 55)
|
||||
Me.TxtEditPwd.Name = "TxtEditPwd"
|
||||
Me.TxtEditPwd.Size = New System.Drawing.Size(136, 21)
|
||||
Me.TxtEditPwd.TabIndex = 17
|
||||
'
|
||||
'DtpValidDate
|
||||
'
|
||||
Me.DtpValidDate.Location = New System.Drawing.Point(296, 55)
|
||||
Me.DtpValidDate.Name = "DtpValidDate"
|
||||
Me.DtpValidDate.Size = New System.Drawing.Size(137, 21)
|
||||
Me.DtpValidDate.TabIndex = 19
|
||||
'
|
||||
'Label5
|
||||
'
|
||||
Me.Label5.AutoSize = true
|
||||
Me.Label5.Location = New System.Drawing.Point(231, 60)
|
||||
Me.Label5.Name = "Label5"
|
||||
Me.Label5.Size = New System.Drawing.Size(59, 12)
|
||||
Me.Label5.TabIndex = 18
|
||||
Me.Label5.Text = "有效日期:"
|
||||
'
|
||||
'GroupBox3
|
||||
'
|
||||
Me.GroupBox3.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
|
||||
Me.GroupBox3.Controls.Add(Me.PicStation)
|
||||
Me.GroupBox3.Location = New System.Drawing.Point(3, 129)
|
||||
Me.GroupBox3.Name = "GroupBox3"
|
||||
Me.GroupBox3.Size = New System.Drawing.Size(469, 292)
|
||||
Me.GroupBox3.TabIndex = 24
|
||||
Me.GroupBox3.TabStop = false
|
||||
Me.GroupBox3.Text = "图像"
|
||||
'
|
||||
'PicStation
|
||||
'
|
||||
Me.PicStation.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.PicStation.Location = New System.Drawing.Point(3, 17)
|
||||
Me.PicStation.Name = "PicStation"
|
||||
Me.PicStation.Size = New System.Drawing.Size(463, 272)
|
||||
Me.PicStation.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
|
||||
Me.PicStation.TabIndex = 0
|
||||
Me.PicStation.TabStop = false
|
||||
'
|
||||
'SplitContainer2
|
||||
'
|
||||
Me.SplitContainer2.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainer2.Location = New System.Drawing.Point(0, 0)
|
||||
Me.SplitContainer2.Name = "SplitContainer2"
|
||||
Me.SplitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal
|
||||
'
|
||||
'SplitContainer2.Panel1
|
||||
'
|
||||
Me.SplitContainer2.Panel1.Controls.Add(Me.GroupBox2)
|
||||
'
|
||||
'SplitContainer2.Panel2
|
||||
'
|
||||
Me.SplitContainer2.Panel2.Controls.Add(Me.GroupBox1)
|
||||
Me.SplitContainer2.Size = New System.Drawing.Size(321, 425)
|
||||
Me.SplitContainer2.SplitterDistance = 115
|
||||
Me.SplitContainer2.TabIndex = 0
|
||||
'
|
||||
'GroupBox2
|
||||
'
|
||||
Me.GroupBox2.Controls.Add(Me.RtxCurrentImprint)
|
||||
Me.GroupBox2.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GroupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.GroupBox2.Location = New System.Drawing.Point(0, 0)
|
||||
Me.GroupBox2.Name = "GroupBox2"
|
||||
Me.GroupBox2.Size = New System.Drawing.Size(321, 115)
|
||||
Me.GroupBox2.TabIndex = 1
|
||||
Me.GroupBox2.TabStop = false
|
||||
Me.GroupBox2.Text = "当前说明"
|
||||
'
|
||||
'RtxCurrentImprint
|
||||
'
|
||||
Me.RtxCurrentImprint.BorderStyle = System.Windows.Forms.BorderStyle.None
|
||||
Me.RtxCurrentImprint.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.RtxCurrentImprint.Location = New System.Drawing.Point(3, 17)
|
||||
Me.RtxCurrentImprint.Name = "RtxCurrentImprint"
|
||||
Me.RtxCurrentImprint.Size = New System.Drawing.Size(315, 95)
|
||||
Me.RtxCurrentImprint.TabIndex = 0
|
||||
Me.RtxCurrentImprint.Text = ""
|
||||
'
|
||||
'GroupBox1
|
||||
'
|
||||
Me.GroupBox1.Controls.Add(Me.RtxHistoryImprint)
|
||||
Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.GroupBox1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.GroupBox1.Name = "GroupBox1"
|
||||
Me.GroupBox1.Size = New System.Drawing.Size(321, 306)
|
||||
Me.GroupBox1.TabIndex = 0
|
||||
Me.GroupBox1.TabStop = false
|
||||
Me.GroupBox1.Text = "历史说明"
|
||||
'
|
||||
'RtxHistoryImprint
|
||||
'
|
||||
Me.RtxHistoryImprint.BorderStyle = System.Windows.Forms.BorderStyle.None
|
||||
Me.RtxHistoryImprint.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.RtxHistoryImprint.Location = New System.Drawing.Point(3, 17)
|
||||
Me.RtxHistoryImprint.Name = "RtxHistoryImprint"
|
||||
Me.RtxHistoryImprint.Size = New System.Drawing.Size(315, 286)
|
||||
Me.RtxHistoryImprint.TabIndex = 0
|
||||
Me.RtxHistoryImprint.Text = ""
|
||||
'
|
||||
'FrmStationDesign
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 12!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Controls.Add(Me.SplitContainer1)
|
||||
Me.Controls.Add(Me.ToolStrip1)
|
||||
Me.Enabled = false
|
||||
Me.Name = "FrmStationDesign"
|
||||
Me.Text = "FrmStationDesign"
|
||||
Me.ToolStrip1.ResumeLayout(false)
|
||||
Me.ToolStrip1.PerformLayout
|
||||
Me.SplitContainer1.Panel1.ResumeLayout(false)
|
||||
Me.SplitContainer1.Panel2.ResumeLayout(false)
|
||||
CType(Me.SplitContainer1,System.ComponentModel.ISupportInitialize).EndInit
|
||||
Me.SplitContainer1.ResumeLayout(false)
|
||||
Me.GroupBox4.ResumeLayout(false)
|
||||
Me.GroupBox4.PerformLayout
|
||||
CType(Me.NudStationVersion,System.ComponentModel.ISupportInitialize).EndInit
|
||||
Me.GroupBox3.ResumeLayout(false)
|
||||
CType(Me.PicStation,System.ComponentModel.ISupportInitialize).EndInit
|
||||
Me.SplitContainer2.Panel1.ResumeLayout(false)
|
||||
Me.SplitContainer2.Panel2.ResumeLayout(false)
|
||||
CType(Me.SplitContainer2,System.ComponentModel.ISupportInitialize).EndInit
|
||||
Me.SplitContainer2.ResumeLayout(false)
|
||||
Me.GroupBox2.ResumeLayout(false)
|
||||
Me.GroupBox1.ResumeLayout(false)
|
||||
Me.ResumeLayout(false)
|
||||
Me.PerformLayout
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents ToolStrip1 As ToolStrip
|
||||
Friend WithEvents TsBtnReleaseStation As ToolStripButton
|
||||
Friend WithEvents SplitContainer1 As SplitContainer
|
||||
Friend WithEvents GroupBox4 As GroupBox
|
||||
Friend WithEvents TxtTestStation As TextBox
|
||||
Friend WithEvents TxtProjectName As TextBox
|
||||
Friend WithEvents NudStationVersion As NumericUpDown
|
||||
Friend WithEvents ChkAutoAugment As CheckBox
|
||||
Friend WithEvents Label7 As Label
|
||||
Friend WithEvents Label3 As Label
|
||||
Friend WithEvents Label4 As Label
|
||||
Friend WithEvents TxtEditPwd As TextBox
|
||||
Friend WithEvents DtpValidDate As DateTimePicker
|
||||
Friend WithEvents Label5 As Label
|
||||
Friend WithEvents GroupBox3 As GroupBox
|
||||
Friend WithEvents PicStation As PictureBox
|
||||
Friend WithEvents SplitContainer2 As SplitContainer
|
||||
Friend WithEvents GroupBox2 As GroupBox
|
||||
Friend WithEvents GroupBox1 As GroupBox
|
||||
Friend WithEvents RtxCurrentImprint As RichTextBox
|
||||
Friend WithEvents RtxHistoryImprint As RichTextBox
|
||||
End Class
|
||||
End Namespace
|
||||
139
UTS_Core/UTSModule/Project/FrmStationDesign.resx
Normal file
139
UTS_Core/UTSModule/Project/FrmStationDesign.resx
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="TsBtnReleaseStation.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
162
UTS_Core/UTSModule/Project/FrmStationDesign.vb
Normal file
162
UTS_Core/UTSModule/Project/FrmStationDesign.vb
Normal file
@@ -0,0 +1,162 @@
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class FrmStationDesign
|
||||
|
||||
Private _isAutoAugment As Boolean = True
|
||||
|
||||
Public Property StationPacket() As ProjectStationPacket
|
||||
|
||||
|
||||
Public Sub ShowForm(parentControl As Control)
|
||||
FormBorderStyle = FormBorderStyle.None
|
||||
TopLevel = False
|
||||
Dock = DockStyle.Fill
|
||||
Parent = parentControl
|
||||
|
||||
Enabled = StationPacket IsNot Nothing
|
||||
|
||||
Show()
|
||||
End Sub
|
||||
|
||||
Public Sub ShowForm(parentControl As Control, packet As ProjectStationPacket)
|
||||
FormBorderStyle = FormBorderStyle.None
|
||||
TopLevel = False
|
||||
Dock = DockStyle.Fill
|
||||
Parent = parentControl
|
||||
|
||||
UpdateStationPacket(packet)
|
||||
Enabled = StationPacket IsNot Nothing
|
||||
Show()
|
||||
End Sub
|
||||
|
||||
Public Sub Station_Changed(station As StationInfo)
|
||||
UpdateStationPacket(station.Packet)
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>修改窗体标题</summary>
|
||||
Private Sub ShowFormTitle()
|
||||
Text = $"{My.Application.Info.ProductName} StationDesign"
|
||||
End Sub
|
||||
|
||||
Private Sub ShowFormTitle(packetName As String)
|
||||
Text = $"{My.Application.Info.ProductName} StationDesign -- {packetName}"
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub UpdateStationPacket(packet As ProjectStationPacket)
|
||||
StationPacket = packet
|
||||
Enabled = StationPacket IsNot Nothing
|
||||
If StationPacket IsNot Nothing Then
|
||||
ShowFormTitle(StationPacket.Name)
|
||||
LoadProjectInitForm()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub LoadProjectInitForm()
|
||||
TxtProjectName.Text = StationPacket.ParentStation.ParentProject.Name
|
||||
TxtTestStation.Text = StationPacket.ParentStation.Name
|
||||
TxtEditPwd.Text = StationPacket.PassWord
|
||||
|
||||
|
||||
NudStationVersion.Text = CType(StationPacket.StationVersion, String)
|
||||
PicStation.Image = StationPacket.StationImage
|
||||
RtxHistoryImprint.Text = ProjectStationPacket.PacketImprintsToString(StationPacket.HistoryImprints)
|
||||
RtxCurrentImprint.Text = StationPacket.CurrentImprint.ToString()
|
||||
|
||||
If StationPacket.ValidDate >= DtpValidDate.MaxDate Then
|
||||
DtpValidDate.Value = Now.AddMonths(1) '默认有效期一个月
|
||||
ElseIf StationPacket.ValidDate <= DtpValidDate.MinDate Then
|
||||
DtpValidDate.Value = Now.AddMonths(1) '默认有效期一个月
|
||||
Else
|
||||
DtpValidDate.Value = StationPacket.ValidDate
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub InitForm()
|
||||
ShowFormTitle()
|
||||
End Sub
|
||||
|
||||
Private Sub FrmStationDesign_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
InitForm()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub PicStation_DoubleClick(sender As Object, e As EventArgs) Handles PicStation.DoubleClick
|
||||
Using dlgOpenFile As New OpenFileDialog
|
||||
dlgOpenFile.Filter = $"设备图像 (*.bmp;*.gif;*.jpg;*.png)|*.bmp;*.gif;*.jpg;*.png"
|
||||
If dlgOpenFile.ShowDialog = DialogResult.OK Then
|
||||
Try
|
||||
Dim imagePath As String = dlgOpenFile.FileName
|
||||
PicStation.Image = ImageProcessor.ImageProcessor.GetBitmapImage(imagePath)
|
||||
|
||||
'更新图像预览图
|
||||
If String.IsNullOrEmpty(StationPacket.ImageFileName) Then '若图像路径不存在,则更新图像路径
|
||||
Dim imgSavePath As String = $"{UtsPath.StationPacketResourceDirPath(StationPacket.Name)}\{StationPacket.ParentStation.Index}.jpg"
|
||||
PicStation.Image.Save(imgSavePath)
|
||||
|
||||
StationPacket.ImageFileName = $"{StationPacket.ParentStation.Index}.jpg" '更新站图像路径
|
||||
Else
|
||||
Dim imgSavePath As String = $"{UtsPath.StationPacketResourceDirPath(StationPacket.Name)}\{StationPacket.ImageFileName}"
|
||||
PicStation.Image.Save(imgSavePath)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox($"设置项目图像失败,{ex.Message}")
|
||||
End Try
|
||||
End If
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub UpdateStationPacket()
|
||||
StationPacket.ModifiedTime = Now
|
||||
StationPacket.PassWord = TxtEditPwd.Text
|
||||
StationPacket.ValidDate = DtpValidDate.Value
|
||||
StationPacket.CurrentImprint = New StationPacketImprint(RtxCurrentImprint.Text)
|
||||
If _isAutoAugment Then
|
||||
StationPacket.StationVersion += 1
|
||||
Else
|
||||
StationPacket.StationVersion = CInt(NudStationVersion.Value)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AfterReleasePacketSuccess()
|
||||
RtxCurrentImprint.Text = StationPacket.CurrentImprint.ToString()
|
||||
RtxHistoryImprint.Text = ProjectStationPacket.PacketImprintsToString(StationPacket.HistoryImprints)
|
||||
NudStationVersion.Value = StationPacket.StationVersion
|
||||
|
||||
ShowFormTitle(StationPacket.Name)
|
||||
End Sub
|
||||
|
||||
Private Sub AfterReleasePacketFail()
|
||||
RtxCurrentImprint.Text = StationPacket.CurrentImprint.ToString()
|
||||
RtxHistoryImprint.Text = ProjectStationPacket.PacketImprintsToString(StationPacket.HistoryImprints)
|
||||
NudStationVersion.Value = StationPacket.StationVersion
|
||||
|
||||
ShowFormTitle(StationPacket.Name)
|
||||
End Sub
|
||||
|
||||
Private Sub TsBtnReleaseStation_Click(sender As Object, e As EventArgs) Handles TsBtnReleaseStation.Click
|
||||
Try
|
||||
UpdateStationPacket()
|
||||
StationPacket.ReleasePacket()
|
||||
AfterReleasePacketSuccess()
|
||||
|
||||
' RaiseEvent ReleaseStationSuccessed(StationPacket.ParentStation)
|
||||
MsgBox($"项目站包 {StationPacket.FileName} 发布成功!")
|
||||
Catch ex As Exception
|
||||
MsgBox($"项目站包发布失败,{ex.Message}")
|
||||
|
||||
AfterReleasePacketFail()
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub ChkAutoAugment_CheckedChanged(sender As Object, e As EventArgs) Handles ChkAutoAugment.CheckedChanged
|
||||
_isAutoAugment = ChkAutoAugment.Checked
|
||||
NudStationVersion.Enabled = Not _isAutoAugment
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
601
UTS_Core/UTSModule/Project/FrmStationPlan.Designer.vb
generated
Normal file
601
UTS_Core/UTSModule/Project/FrmStationPlan.Designer.vb
generated
Normal file
@@ -0,0 +1,601 @@
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Namespace UTSModule.Project
|
||||
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class FrmStationPlan
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form 重写 Dispose,以清理组件列表。
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Windows 窗体设计器所必需的
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'注意: 以下过程是 Windows 窗体设计器所必需的
|
||||
'可以使用 Windows 窗体设计器修改它。
|
||||
'不要使用代码编辑器修改它。
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmStationPlan))
|
||||
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip()
|
||||
Me.TsBtnReleaseStation = New System.Windows.Forms.ToolStripButton()
|
||||
Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
|
||||
Me.TsBtnLockedEdit = New System.Windows.Forms.ToolStripButton()
|
||||
Me.TsBtnMouseFollow = New System.Windows.Forms.ToolStripButton()
|
||||
Me.SplStationPlan = New System.Windows.Forms.SplitContainer()
|
||||
Me.SplPlanDesign = New System.Windows.Forms.SplitContainer()
|
||||
Me.GrpStationTest = New System.Windows.Forms.GroupBox()
|
||||
Me.GrdTestPlan = New FlexCell.Grid()
|
||||
Me.CmsStationPlan = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.MsiAddPlanRow = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.MsiPlanAddRow = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.MsiPlanAddRows = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.删除一行ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.修改主题ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.默认主题ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.调整字体ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.ConsoleToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.微软雅黑ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.调整字色ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.红色ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.橙色ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.其他ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.调整背景ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.红色ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.橙色ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.其他ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.对齐方式ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.上左ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.上左ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.上层居右ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.中层居左ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.中层居中ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.中层居右ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.下层居左ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.下层居中ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.下层居右ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.内容自适应ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.刷新ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.GrpSingleRowInfo = New System.Windows.Forms.GroupBox()
|
||||
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
|
||||
Me.GrdSingleRowInfo = New FlexCell.Grid()
|
||||
Me.CmsSingleRow = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.RtxColTip = New System.Windows.Forms.RichTextBox()
|
||||
Me.GrpOutputInfo = New System.Windows.Forms.GroupBox()
|
||||
Me.TabControl1 = New System.Windows.Forms.TabControl()
|
||||
Me.TpOutputInfo = New System.Windows.Forms.TabPage()
|
||||
Me.RtxOutputInfo = New System.Windows.Forms.RichTextBox()
|
||||
Me.TpTerminal = New System.Windows.Forms.TabPage()
|
||||
Me.RtxTerminal = New System.Windows.Forms.RichTextBox()
|
||||
Me.ToolStrip1.SuspendLayout()
|
||||
CType(Me.SplStationPlan, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplStationPlan.Panel1.SuspendLayout()
|
||||
Me.SplStationPlan.Panel2.SuspendLayout()
|
||||
Me.SplStationPlan.SuspendLayout()
|
||||
CType(Me.SplPlanDesign, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplPlanDesign.Panel1.SuspendLayout()
|
||||
Me.SplPlanDesign.Panel2.SuspendLayout()
|
||||
Me.SplPlanDesign.SuspendLayout()
|
||||
Me.GrpStationTest.SuspendLayout()
|
||||
Me.CmsStationPlan.SuspendLayout()
|
||||
Me.GrpSingleRowInfo.SuspendLayout()
|
||||
CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainer1.Panel1.SuspendLayout()
|
||||
Me.SplitContainer1.Panel2.SuspendLayout()
|
||||
Me.SplitContainer1.SuspendLayout()
|
||||
Me.GrpOutputInfo.SuspendLayout()
|
||||
Me.TabControl1.SuspendLayout()
|
||||
Me.TpOutputInfo.SuspendLayout()
|
||||
Me.TpTerminal.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'ToolStrip1
|
||||
'
|
||||
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TsBtnReleaseStation, Me.ToolStripSeparator1, Me.TsBtnLockedEdit, Me.TsBtnMouseFollow})
|
||||
Me.ToolStrip1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.ToolStrip1.Name = "ToolStrip1"
|
||||
Me.ToolStrip1.Size = New System.Drawing.Size(784, 25)
|
||||
Me.ToolStrip1.TabIndex = 7
|
||||
Me.ToolStrip1.Text = "ToolStrip1"
|
||||
'
|
||||
'TsBtnReleaseStation
|
||||
'
|
||||
Me.TsBtnReleaseStation.Image = CType(resources.GetObject("TsBtnReleaseStation.Image"), System.Drawing.Image)
|
||||
Me.TsBtnReleaseStation.ImageTransparentColor = System.Drawing.Color.Magenta
|
||||
Me.TsBtnReleaseStation.Name = "TsBtnReleaseStation"
|
||||
Me.TsBtnReleaseStation.Size = New System.Drawing.Size(76, 22)
|
||||
Me.TsBtnReleaseStation.Text = "发布站包"
|
||||
'
|
||||
'ToolStripSeparator1
|
||||
'
|
||||
Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
|
||||
Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25)
|
||||
'
|
||||
'TsBtnLockedEdit
|
||||
'
|
||||
Me.TsBtnLockedEdit.Image = CType(resources.GetObject("TsBtnLockedEdit.Image"), System.Drawing.Image)
|
||||
Me.TsBtnLockedEdit.ImageTransparentColor = System.Drawing.Color.Magenta
|
||||
Me.TsBtnLockedEdit.Name = "TsBtnLockedEdit"
|
||||
Me.TsBtnLockedEdit.Size = New System.Drawing.Size(76, 22)
|
||||
Me.TsBtnLockedEdit.Text = "解锁编辑"
|
||||
'
|
||||
'TsBtnMouseFollow
|
||||
'
|
||||
Me.TsBtnMouseFollow.Image = CType(resources.GetObject("TsBtnMouseFollow.Image"), System.Drawing.Image)
|
||||
Me.TsBtnMouseFollow.ImageTransparentColor = System.Drawing.Color.Magenta
|
||||
Me.TsBtnMouseFollow.Name = "TsBtnMouseFollow"
|
||||
Me.TsBtnMouseFollow.Size = New System.Drawing.Size(76, 22)
|
||||
Me.TsBtnMouseFollow.Text = "光标预览"
|
||||
'
|
||||
'SplStationPlan
|
||||
'
|
||||
Me.SplStationPlan.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplStationPlan.Location = New System.Drawing.Point(0, 25)
|
||||
Me.SplStationPlan.Name = "SplStationPlan"
|
||||
Me.SplStationPlan.Orientation = System.Windows.Forms.Orientation.Horizontal
|
||||
'
|
||||
'SplStationPlan.Panel1
|
||||
'
|
||||
Me.SplStationPlan.Panel1.Controls.Add(Me.SplPlanDesign)
|
||||
'
|
||||
'SplStationPlan.Panel2
|
||||
'
|
||||
Me.SplStationPlan.Panel2.Controls.Add(Me.GrpOutputInfo)
|
||||
Me.SplStationPlan.Size = New System.Drawing.Size(784, 536)
|
||||
Me.SplStationPlan.SplitterDistance = 396
|
||||
Me.SplStationPlan.TabIndex = 9
|
||||
'
|
||||
'SplPlanDesign
|
||||
'
|
||||
Me.SplPlanDesign.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplPlanDesign.Location = New System.Drawing.Point(0, 0)
|
||||
Me.SplPlanDesign.Name = "SplPlanDesign"
|
||||
'
|
||||
'SplPlanDesign.Panel1
|
||||
'
|
||||
Me.SplPlanDesign.Panel1.Controls.Add(Me.GrpStationTest)
|
||||
'
|
||||
'SplPlanDesign.Panel2
|
||||
'
|
||||
Me.SplPlanDesign.Panel2.Controls.Add(Me.GrpSingleRowInfo)
|
||||
Me.SplPlanDesign.Size = New System.Drawing.Size(784, 396)
|
||||
Me.SplPlanDesign.SplitterDistance = 524
|
||||
Me.SplPlanDesign.TabIndex = 0
|
||||
'
|
||||
'GrpStationTest
|
||||
'
|
||||
Me.GrpStationTest.Controls.Add(Me.GrdTestPlan)
|
||||
Me.GrpStationTest.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GrpStationTest.Location = New System.Drawing.Point(0, 0)
|
||||
Me.GrpStationTest.Name = "GrpStationTest"
|
||||
Me.GrpStationTest.Size = New System.Drawing.Size(524, 396)
|
||||
Me.GrpStationTest.TabIndex = 45
|
||||
Me.GrpStationTest.TabStop = False
|
||||
Me.GrpStationTest.Text = "完整流程"
|
||||
'
|
||||
'GrdTestPlan
|
||||
'
|
||||
Me.GrdTestPlan.BorderColor = System.Drawing.Color.Transparent
|
||||
Me.GrdTestPlan.BorderStyle = FlexCell.BorderStyleEnum.None
|
||||
Me.GrdTestPlan.CheckedImage = CType(resources.GetObject("GrdTestPlan.CheckedImage"), System.Drawing.Bitmap)
|
||||
Me.GrdTestPlan.ContextMenuStrip = Me.CmsStationPlan
|
||||
Me.GrdTestPlan.DefaultFont = New System.Drawing.Font("宋体", 9.0!)
|
||||
Me.GrdTestPlan.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GrdTestPlan.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
|
||||
Me.GrdTestPlan.GridColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer))
|
||||
Me.GrdTestPlan.Location = New System.Drawing.Point(3, 17)
|
||||
Me.GrdTestPlan.Name = "GrdTestPlan"
|
||||
Me.GrdTestPlan.Size = New System.Drawing.Size(518, 376)
|
||||
Me.GrdTestPlan.TabIndex = 44
|
||||
Me.GrdTestPlan.UncheckedImage = CType(resources.GetObject("GrdTestPlan.UncheckedImage"), System.Drawing.Bitmap)
|
||||
'
|
||||
'CmsStationPlan
|
||||
'
|
||||
Me.CmsStationPlan.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MsiAddPlanRow, Me.删除一行ToolStripMenuItem, Me.修改主题ToolStripMenuItem, Me.调整字体ToolStripMenuItem, Me.调整字色ToolStripMenuItem, Me.调整背景ToolStripMenuItem, Me.对齐方式ToolStripMenuItem, Me.内容自适应ToolStripMenuItem, Me.刷新ToolStripMenuItem})
|
||||
Me.CmsStationPlan.Name = "CmsStationPlan"
|
||||
Me.CmsStationPlan.Size = New System.Drawing.Size(181, 224)
|
||||
'
|
||||
'MsiAddPlanRow
|
||||
'
|
||||
Me.MsiAddPlanRow.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MsiPlanAddRow, Me.MsiPlanAddRows})
|
||||
Me.MsiAddPlanRow.Name = "MsiAddPlanRow"
|
||||
Me.MsiAddPlanRow.Size = New System.Drawing.Size(180, 22)
|
||||
Me.MsiAddPlanRow.Text = "新增流程行"
|
||||
'
|
||||
'MsiPlanAddRow
|
||||
'
|
||||
Me.MsiPlanAddRow.Name = "MsiPlanAddRow"
|
||||
Me.MsiPlanAddRow.Size = New System.Drawing.Size(180, 22)
|
||||
Me.MsiPlanAddRow.Text = "新增一行"
|
||||
'
|
||||
'MsiPlanAddRows
|
||||
'
|
||||
Me.MsiPlanAddRows.Name = "MsiPlanAddRows"
|
||||
Me.MsiPlanAddRows.Size = New System.Drawing.Size(180, 22)
|
||||
Me.MsiPlanAddRows.Text = "新增多行"
|
||||
'
|
||||
'删除一行ToolStripMenuItem
|
||||
'
|
||||
Me.删除一行ToolStripMenuItem.Name = "删除一行ToolStripMenuItem"
|
||||
Me.删除一行ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.删除一行ToolStripMenuItem.Text = "删除流程行"
|
||||
'
|
||||
'修改主题ToolStripMenuItem
|
||||
'
|
||||
Me.修改主题ToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.默认主题ToolStripMenuItem})
|
||||
Me.修改主题ToolStripMenuItem.Name = "修改主题ToolStripMenuItem"
|
||||
Me.修改主题ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.修改主题ToolStripMenuItem.Text = "修改主题"
|
||||
'
|
||||
'默认主题ToolStripMenuItem
|
||||
'
|
||||
Me.默认主题ToolStripMenuItem.Name = "默认主题ToolStripMenuItem"
|
||||
Me.默认主题ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.默认主题ToolStripMenuItem.Text = "默认主题"
|
||||
'
|
||||
'调整字体ToolStripMenuItem
|
||||
'
|
||||
Me.调整字体ToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ConsoleToolStripMenuItem, Me.微软雅黑ToolStripMenuItem})
|
||||
Me.调整字体ToolStripMenuItem.Name = "调整字体ToolStripMenuItem"
|
||||
Me.调整字体ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.调整字体ToolStripMenuItem.Text = "修改字体"
|
||||
'
|
||||
'ConsoleToolStripMenuItem
|
||||
'
|
||||
Me.ConsoleToolStripMenuItem.Name = "ConsoleToolStripMenuItem"
|
||||
Me.ConsoleToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.ConsoleToolStripMenuItem.Text = "Console"
|
||||
'
|
||||
'微软雅黑ToolStripMenuItem
|
||||
'
|
||||
Me.微软雅黑ToolStripMenuItem.Name = "微软雅黑ToolStripMenuItem"
|
||||
Me.微软雅黑ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.微软雅黑ToolStripMenuItem.Text = "微软雅黑"
|
||||
'
|
||||
'调整字色ToolStripMenuItem
|
||||
'
|
||||
Me.调整字色ToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.红色ToolStripMenuItem, Me.橙色ToolStripMenuItem, Me.其他ToolStripMenuItem1})
|
||||
Me.调整字色ToolStripMenuItem.Name = "调整字色ToolStripMenuItem"
|
||||
Me.调整字色ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.调整字色ToolStripMenuItem.Text = "修改字色"
|
||||
'
|
||||
'红色ToolStripMenuItem
|
||||
'
|
||||
Me.红色ToolStripMenuItem.Name = "红色ToolStripMenuItem"
|
||||
Me.红色ToolStripMenuItem.Size = New System.Drawing.Size(109, 22)
|
||||
Me.红色ToolStripMenuItem.Text = "红色"
|
||||
'
|
||||
'橙色ToolStripMenuItem
|
||||
'
|
||||
Me.橙色ToolStripMenuItem.Name = "橙色ToolStripMenuItem"
|
||||
Me.橙色ToolStripMenuItem.Size = New System.Drawing.Size(109, 22)
|
||||
Me.橙色ToolStripMenuItem.Text = "橙色"
|
||||
'
|
||||
'其他ToolStripMenuItem1
|
||||
'
|
||||
Me.其他ToolStripMenuItem1.Name = "其他ToolStripMenuItem1"
|
||||
Me.其他ToolStripMenuItem1.Size = New System.Drawing.Size(109, 22)
|
||||
Me.其他ToolStripMenuItem1.Text = "其他..."
|
||||
'
|
||||
'调整背景ToolStripMenuItem
|
||||
'
|
||||
Me.调整背景ToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.红色ToolStripMenuItem1, Me.橙色ToolStripMenuItem1, Me.其他ToolStripMenuItem})
|
||||
Me.调整背景ToolStripMenuItem.Name = "调整背景ToolStripMenuItem"
|
||||
Me.调整背景ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.调整背景ToolStripMenuItem.Text = "修改背景色"
|
||||
'
|
||||
'红色ToolStripMenuItem1
|
||||
'
|
||||
Me.红色ToolStripMenuItem1.Name = "红色ToolStripMenuItem1"
|
||||
Me.红色ToolStripMenuItem1.Size = New System.Drawing.Size(180, 22)
|
||||
Me.红色ToolStripMenuItem1.Text = "红色"
|
||||
'
|
||||
'橙色ToolStripMenuItem1
|
||||
'
|
||||
Me.橙色ToolStripMenuItem1.Name = "橙色ToolStripMenuItem1"
|
||||
Me.橙色ToolStripMenuItem1.Size = New System.Drawing.Size(180, 22)
|
||||
Me.橙色ToolStripMenuItem1.Text = "橙色"
|
||||
'
|
||||
'其他ToolStripMenuItem
|
||||
'
|
||||
Me.其他ToolStripMenuItem.Name = "其他ToolStripMenuItem"
|
||||
Me.其他ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.其他ToolStripMenuItem.Text = "其他..."
|
||||
'
|
||||
'对齐方式ToolStripMenuItem
|
||||
'
|
||||
Me.对齐方式ToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.上左ToolStripMenuItem, Me.上左ToolStripMenuItem1, Me.上层居右ToolStripMenuItem, Me.中层居左ToolStripMenuItem, Me.中层居中ToolStripMenuItem, Me.中层居右ToolStripMenuItem, Me.下层居左ToolStripMenuItem, Me.下层居中ToolStripMenuItem, Me.下层居右ToolStripMenuItem})
|
||||
Me.对齐方式ToolStripMenuItem.Name = "对齐方式ToolStripMenuItem"
|
||||
Me.对齐方式ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.对齐方式ToolStripMenuItem.Text = "对齐方式"
|
||||
'
|
||||
'上左ToolStripMenuItem
|
||||
'
|
||||
Me.上左ToolStripMenuItem.Name = "上左ToolStripMenuItem"
|
||||
Me.上左ToolStripMenuItem.Size = New System.Drawing.Size(124, 22)
|
||||
Me.上左ToolStripMenuItem.Text = "上层居左"
|
||||
'
|
||||
'上左ToolStripMenuItem1
|
||||
'
|
||||
Me.上左ToolStripMenuItem1.Name = "上左ToolStripMenuItem1"
|
||||
Me.上左ToolStripMenuItem1.Size = New System.Drawing.Size(124, 22)
|
||||
Me.上左ToolStripMenuItem1.Text = "上层居中"
|
||||
'
|
||||
'上层居右ToolStripMenuItem
|
||||
'
|
||||
Me.上层居右ToolStripMenuItem.Name = "上层居右ToolStripMenuItem"
|
||||
Me.上层居右ToolStripMenuItem.Size = New System.Drawing.Size(124, 22)
|
||||
Me.上层居右ToolStripMenuItem.Text = "上层居右"
|
||||
'
|
||||
'中层居左ToolStripMenuItem
|
||||
'
|
||||
Me.中层居左ToolStripMenuItem.Name = "中层居左ToolStripMenuItem"
|
||||
Me.中层居左ToolStripMenuItem.Size = New System.Drawing.Size(124, 22)
|
||||
Me.中层居左ToolStripMenuItem.Text = "中层居左"
|
||||
'
|
||||
'中层居中ToolStripMenuItem
|
||||
'
|
||||
Me.中层居中ToolStripMenuItem.Name = "中层居中ToolStripMenuItem"
|
||||
Me.中层居中ToolStripMenuItem.Size = New System.Drawing.Size(124, 22)
|
||||
Me.中层居中ToolStripMenuItem.Text = "中层居中"
|
||||
'
|
||||
'中层居右ToolStripMenuItem
|
||||
'
|
||||
Me.中层居右ToolStripMenuItem.Name = "中层居右ToolStripMenuItem"
|
||||
Me.中层居右ToolStripMenuItem.Size = New System.Drawing.Size(124, 22)
|
||||
Me.中层居右ToolStripMenuItem.Text = "中层居右"
|
||||
'
|
||||
'下层居左ToolStripMenuItem
|
||||
'
|
||||
Me.下层居左ToolStripMenuItem.Name = "下层居左ToolStripMenuItem"
|
||||
Me.下层居左ToolStripMenuItem.Size = New System.Drawing.Size(124, 22)
|
||||
Me.下层居左ToolStripMenuItem.Text = "下层居左"
|
||||
'
|
||||
'下层居中ToolStripMenuItem
|
||||
'
|
||||
Me.下层居中ToolStripMenuItem.Name = "下层居中ToolStripMenuItem"
|
||||
Me.下层居中ToolStripMenuItem.Size = New System.Drawing.Size(124, 22)
|
||||
Me.下层居中ToolStripMenuItem.Text = "下层居中"
|
||||
'
|
||||
'下层居右ToolStripMenuItem
|
||||
'
|
||||
Me.下层居右ToolStripMenuItem.Name = "下层居右ToolStripMenuItem"
|
||||
Me.下层居右ToolStripMenuItem.Size = New System.Drawing.Size(124, 22)
|
||||
Me.下层居右ToolStripMenuItem.Text = "下层居右"
|
||||
'
|
||||
'内容自适应ToolStripMenuItem
|
||||
'
|
||||
Me.内容自适应ToolStripMenuItem.Name = "内容自适应ToolStripMenuItem"
|
||||
Me.内容自适应ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.内容自适应ToolStripMenuItem.Text = "内容自适应"
|
||||
'
|
||||
'刷新ToolStripMenuItem
|
||||
'
|
||||
Me.刷新ToolStripMenuItem.Name = "刷新ToolStripMenuItem"
|
||||
Me.刷新ToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.刷新ToolStripMenuItem.Text = "刷新提示"
|
||||
'
|
||||
'GrpSingleRowInfo
|
||||
'
|
||||
Me.GrpSingleRowInfo.Controls.Add(Me.SplitContainer1)
|
||||
Me.GrpSingleRowInfo.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GrpSingleRowInfo.Location = New System.Drawing.Point(0, 0)
|
||||
Me.GrpSingleRowInfo.Name = "GrpSingleRowInfo"
|
||||
Me.GrpSingleRowInfo.Size = New System.Drawing.Size(256, 396)
|
||||
Me.GrpSingleRowInfo.TabIndex = 1
|
||||
Me.GrpSingleRowInfo.TabStop = False
|
||||
Me.GrpSingleRowInfo.Text = "单行信息"
|
||||
'
|
||||
'SplitContainer1
|
||||
'
|
||||
Me.SplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2
|
||||
Me.SplitContainer1.Location = New System.Drawing.Point(3, 17)
|
||||
Me.SplitContainer1.Name = "SplitContainer1"
|
||||
Me.SplitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal
|
||||
'
|
||||
'SplitContainer1.Panel1
|
||||
'
|
||||
Me.SplitContainer1.Panel1.Controls.Add(Me.GrdSingleRowInfo)
|
||||
'
|
||||
'SplitContainer1.Panel2
|
||||
'
|
||||
Me.SplitContainer1.Panel2.Controls.Add(Me.RtxColTip)
|
||||
Me.SplitContainer1.Size = New System.Drawing.Size(250, 376)
|
||||
Me.SplitContainer1.SplitterDistance = 294
|
||||
Me.SplitContainer1.TabIndex = 1
|
||||
'
|
||||
'GrdSingleRowInfo
|
||||
'
|
||||
Me.GrdSingleRowInfo.BorderColor = System.Drawing.Color.Transparent
|
||||
Me.GrdSingleRowInfo.BorderStyle = FlexCell.BorderStyleEnum.None
|
||||
Me.GrdSingleRowInfo.CheckedImage = Nothing
|
||||
Me.GrdSingleRowInfo.ContextMenuStrip = Me.CmsSingleRow
|
||||
Me.GrdSingleRowInfo.DefaultFont = New System.Drawing.Font("宋体", 9.0!)
|
||||
Me.GrdSingleRowInfo.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GrdSingleRowInfo.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
|
||||
Me.GrdSingleRowInfo.GridColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer))
|
||||
Me.GrdSingleRowInfo.Location = New System.Drawing.Point(0, 0)
|
||||
Me.GrdSingleRowInfo.Name = "GrdSingleRowInfo"
|
||||
Me.GrdSingleRowInfo.ScrollBars = FlexCell.ScrollBarsEnum.Vertical
|
||||
Me.GrdSingleRowInfo.Size = New System.Drawing.Size(250, 294)
|
||||
Me.GrdSingleRowInfo.TabIndex = 0
|
||||
Me.GrdSingleRowInfo.UncheckedImage = Nothing
|
||||
'
|
||||
'CmsSingleRow
|
||||
'
|
||||
Me.CmsSingleRow.Name = "CmsSingleRow"
|
||||
Me.CmsSingleRow.Size = New System.Drawing.Size(61, 4)
|
||||
'
|
||||
'RtxColTip
|
||||
'
|
||||
Me.RtxColTip.BorderStyle = System.Windows.Forms.BorderStyle.None
|
||||
Me.RtxColTip.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.RtxColTip.Enabled = False
|
||||
Me.RtxColTip.Location = New System.Drawing.Point(0, 0)
|
||||
Me.RtxColTip.Name = "RtxColTip"
|
||||
Me.RtxColTip.Size = New System.Drawing.Size(250, 78)
|
||||
Me.RtxColTip.TabIndex = 0
|
||||
Me.RtxColTip.Text = ""
|
||||
'
|
||||
'GrpOutputInfo
|
||||
'
|
||||
Me.GrpOutputInfo.Controls.Add(Me.TabControl1)
|
||||
Me.GrpOutputInfo.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GrpOutputInfo.Location = New System.Drawing.Point(0, 0)
|
||||
Me.GrpOutputInfo.Name = "GrpOutputInfo"
|
||||
Me.GrpOutputInfo.Size = New System.Drawing.Size(784, 136)
|
||||
Me.GrpOutputInfo.TabIndex = 0
|
||||
Me.GrpOutputInfo.TabStop = False
|
||||
Me.GrpOutputInfo.Text = "输出内容"
|
||||
'
|
||||
'TabControl1
|
||||
'
|
||||
Me.TabControl1.Controls.Add(Me.TpOutputInfo)
|
||||
Me.TabControl1.Controls.Add(Me.TpTerminal)
|
||||
Me.TabControl1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.TabControl1.Location = New System.Drawing.Point(3, 17)
|
||||
Me.TabControl1.Name = "TabControl1"
|
||||
Me.TabControl1.SelectedIndex = 0
|
||||
Me.TabControl1.Size = New System.Drawing.Size(778, 116)
|
||||
Me.TabControl1.TabIndex = 1
|
||||
'
|
||||
'TpOutputInfo
|
||||
'
|
||||
Me.TpOutputInfo.Controls.Add(Me.RtxOutputInfo)
|
||||
Me.TpOutputInfo.Location = New System.Drawing.Point(4, 22)
|
||||
Me.TpOutputInfo.Name = "TpOutputInfo"
|
||||
Me.TpOutputInfo.Padding = New System.Windows.Forms.Padding(3)
|
||||
Me.TpOutputInfo.Size = New System.Drawing.Size(770, 90)
|
||||
Me.TpOutputInfo.TabIndex = 0
|
||||
Me.TpOutputInfo.Text = "输出信息"
|
||||
Me.TpOutputInfo.UseVisualStyleBackColor = True
|
||||
'
|
||||
'RtxOutputInfo
|
||||
'
|
||||
Me.RtxOutputInfo.BorderStyle = System.Windows.Forms.BorderStyle.None
|
||||
Me.RtxOutputInfo.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.RtxOutputInfo.Location = New System.Drawing.Point(3, 3)
|
||||
Me.RtxOutputInfo.Name = "RtxOutputInfo"
|
||||
Me.RtxOutputInfo.Size = New System.Drawing.Size(764, 84)
|
||||
Me.RtxOutputInfo.TabIndex = 0
|
||||
Me.RtxOutputInfo.Text = ""
|
||||
'
|
||||
'TpTerminal
|
||||
'
|
||||
Me.TpTerminal.Controls.Add(Me.RtxTerminal)
|
||||
Me.TpTerminal.Location = New System.Drawing.Point(4, 22)
|
||||
Me.TpTerminal.Name = "TpTerminal"
|
||||
Me.TpTerminal.Size = New System.Drawing.Size(770, 90)
|
||||
Me.TpTerminal.TabIndex = 1
|
||||
Me.TpTerminal.Text = "运行终端"
|
||||
Me.TpTerminal.UseVisualStyleBackColor = True
|
||||
'
|
||||
'RtxTerminal
|
||||
'
|
||||
Me.RtxTerminal.BorderStyle = System.Windows.Forms.BorderStyle.None
|
||||
Me.RtxTerminal.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.RtxTerminal.Location = New System.Drawing.Point(0, 0)
|
||||
Me.RtxTerminal.Name = "RtxTerminal"
|
||||
Me.RtxTerminal.Size = New System.Drawing.Size(770, 90)
|
||||
Me.RtxTerminal.TabIndex = 0
|
||||
Me.RtxTerminal.Text = ""
|
||||
'
|
||||
'FrmStationPlan
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(784, 561)
|
||||
Me.Controls.Add(Me.SplStationPlan)
|
||||
Me.Controls.Add(Me.ToolStrip1)
|
||||
Me.Name = "FrmStationPlan"
|
||||
Me.Text = "FrmStationPlan"
|
||||
Me.ToolStrip1.ResumeLayout(False)
|
||||
Me.ToolStrip1.PerformLayout()
|
||||
Me.SplStationPlan.Panel1.ResumeLayout(False)
|
||||
Me.SplStationPlan.Panel2.ResumeLayout(False)
|
||||
CType(Me.SplStationPlan, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplStationPlan.ResumeLayout(False)
|
||||
Me.SplPlanDesign.Panel1.ResumeLayout(False)
|
||||
Me.SplPlanDesign.Panel2.ResumeLayout(False)
|
||||
CType(Me.SplPlanDesign, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplPlanDesign.ResumeLayout(False)
|
||||
Me.GrpStationTest.ResumeLayout(False)
|
||||
Me.CmsStationPlan.ResumeLayout(False)
|
||||
Me.GrpSingleRowInfo.ResumeLayout(False)
|
||||
Me.SplitContainer1.Panel1.ResumeLayout(False)
|
||||
Me.SplitContainer1.Panel2.ResumeLayout(False)
|
||||
CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainer1.ResumeLayout(False)
|
||||
Me.GrpOutputInfo.ResumeLayout(False)
|
||||
Me.TabControl1.ResumeLayout(False)
|
||||
Me.TpOutputInfo.ResumeLayout(False)
|
||||
Me.TpTerminal.ResumeLayout(False)
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents ToolStrip1 As ToolStrip
|
||||
Friend WithEvents SplStationPlan As SplitContainer
|
||||
Friend WithEvents SplPlanDesign As SplitContainer
|
||||
Friend WithEvents GrdTestPlan As FlexCell.Grid
|
||||
Friend WithEvents GrdSingleRowInfo As FlexCell.Grid
|
||||
Friend WithEvents TsBtnReleaseStation As ToolStripButton
|
||||
Friend WithEvents GrpStationTest As GroupBox
|
||||
Friend WithEvents GrpSingleRowInfo As GroupBox
|
||||
Friend WithEvents GrpOutputInfo As GroupBox
|
||||
Friend WithEvents RtxOutputInfo As RichTextBox
|
||||
Friend WithEvents TabControl1 As TabControl
|
||||
Friend WithEvents TpOutputInfo As TabPage
|
||||
Friend WithEvents ToolStripSeparator1 As ToolStripSeparator
|
||||
Friend WithEvents TsBtnLockedEdit As ToolStripButton
|
||||
Friend WithEvents CmsStationPlan As ContextMenuStrip
|
||||
Friend WithEvents MsiAddPlanRow As ToolStripMenuItem
|
||||
Friend WithEvents 删除一行ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 修改主题ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 调整字体ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 调整字色ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 调整背景ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 对齐方式ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 内容自适应ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 刷新ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents MsiPlanAddRow As ToolStripMenuItem
|
||||
Friend WithEvents MsiPlanAddRows As ToolStripMenuItem
|
||||
Friend WithEvents 默认主题ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents ConsoleToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 微软雅黑ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 红色ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 橙色ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 其他ToolStripMenuItem1 As ToolStripMenuItem
|
||||
Friend WithEvents 红色ToolStripMenuItem1 As ToolStripMenuItem
|
||||
Friend WithEvents 橙色ToolStripMenuItem1 As ToolStripMenuItem
|
||||
Friend WithEvents 其他ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 上左ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 上左ToolStripMenuItem1 As ToolStripMenuItem
|
||||
Friend WithEvents 上层居右ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 中层居左ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 中层居中ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 中层居右ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 下层居左ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 下层居中ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents 下层居右ToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents CmsSingleRow As ContextMenuStrip
|
||||
Friend WithEvents TpTerminal As TabPage
|
||||
Friend WithEvents RtxTerminal As RichTextBox
|
||||
Friend WithEvents SplitContainer1 As SplitContainer
|
||||
Friend WithEvents RtxColTip As RichTextBox
|
||||
Friend WithEvents TsBtnMouseFollow As ToolStripButton
|
||||
End Class
|
||||
End Namespace
|
||||
239
UTS_Core/UTSModule/Project/FrmStationPlan.resx
Normal file
239
UTS_Core/UTSModule/Project/FrmStationPlan.resx
Normal file
@@ -0,0 +1,239 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="ToolStrip1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="TsBtnReleaseStation.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="TsBtnLockedEdit.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="TsBtnMouseFollow.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="SplStationPlan.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="SplPlanDesign.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GrpStationTest.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GrdTestPlan.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="GrdTestPlan.CheckedImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
Qk3OAAAAAAAAAHYAAAAoAAAACwAAAAsAAAABAAQAAAAAAAAAAADEDgAAxA4AABAAAAAQAAAAAAAA/wAA
|
||||
gP8AgAD/AICA/4AAAP+AAID/gIAA/8DAwP+AgID/AAD//wD/AP8A/////wAA//8A/////wD//////4iI
|
||||
iIiIgAAAj/////+AAACP/w///4AAAI/wAP//gAAAjwAAD/+AAACPAPAA/4AAAI8P/wAPgAAAj///8A+A
|
||||
AACP////D4AAAI//////gAAAiIiIiIiAAAA=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="CmsStationPlan.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>129, 17</value>
|
||||
</metadata>
|
||||
<data name="GrdTestPlan.UncheckedImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
Qk3OAAAAAAAAAHYAAAAoAAAACwAAAAsAAAABAAQAAAAAAAAAAADEDgAAxA4AABAAAAAQAAAAAAAA/wAA
|
||||
gP8AgAD/AICA/4AAAP+AAID/gIAA/8DAwP+AgID/AAD//wD/AP8A/////wAA//8A/////wD//////4iI
|
||||
iIiIgAAAj/////+AAACP/////4AAAI//////gAAAj/////+AAACP/////4AAAI//////gAAAj/////+A
|
||||
AACP/////4AAAI//////gAAAiIiIiIiAAAA=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="GrpSingleRowInfo.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="SplitContainer1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GrdSingleRowInfo.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CmsSingleRow.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>273, 17</value>
|
||||
</metadata>
|
||||
<metadata name="RtxColTip.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GrpOutputInfo.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TabControl1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TpOutputInfo.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="RtxOutputInfo.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TpTerminal.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="RtxTerminal.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
711
UTS_Core/UTSModule/Project/FrmStationPlan.vb
Normal file
711
UTS_Core/UTSModule/Project/FrmStationPlan.vb
Normal file
@@ -0,0 +1,711 @@
|
||||
Imports System.Drawing
|
||||
Imports System.Windows.Forms
|
||||
Imports FlexCell
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class FrmStationPlan
|
||||
Private _isShown As Boolean
|
||||
|
||||
Public Property StationPlan() As ProjectStationPlan
|
||||
|
||||
Public Property StationPlanCommandHelpers As Dictionary(Of String, StationPlanCommandHelper)
|
||||
|
||||
Public Property StationPlanColHelpers() As Dictionary(Of String, PlanColHelper)
|
||||
|
||||
Public Sub ShowForm(parentControl As Control)
|
||||
FormBorderStyle = FormBorderStyle.None
|
||||
TopLevel = False
|
||||
Dock = DockStyle.Fill
|
||||
Parent = parentControl
|
||||
Enabled = StationPlan IsNot Nothing
|
||||
|
||||
Show()
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub Station_Changed(station As StationInfo)
|
||||
StationPlan = station.Packet.StationPlan
|
||||
|
||||
Enabled = StationPlan IsNot Nothing
|
||||
|
||||
If StationPlan IsNot Nothing Then
|
||||
GrdTestPlan.AutoRedraw = False
|
||||
|
||||
GrdTestPlan.LoadFromStream(StationPlan.StationPlanGrid.ExportToStream())
|
||||
GrdTestPlan.ComboBox(StationPlanGrid.ColNameEnum.Command).Items.Clear()
|
||||
GrdTestPlan.ComboBox(StationPlanGrid.ColNameEnum.Command).Items.AddRange(StationPlanCommandHelpers.Keys.ToArray())
|
||||
|
||||
GrdTestPlan.AutoRedraw = True
|
||||
GrdTestPlan.Refresh()
|
||||
|
||||
StationPlan.StationPlanGrid.Dispose() '清空资源
|
||||
StationPlan.StationPlanGrid = GrdTestPlan '保证站包与站流程表指向内容一致
|
||||
|
||||
LockedTestPlanGrid(StationPlan.TestPlanLocked)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub LockedTestPlanGrid(testPlanLocked As Boolean)
|
||||
GrdTestPlan.Range(1, 1, GrdTestPlan.Rows - 1, GrdTestPlan.Cols - 1).Locked = testPlanLocked
|
||||
If testPlanLocked Then
|
||||
TsBtnLockedEdit.Text = $"解锁表格"
|
||||
TsBtnLockedEdit.ForeColor = Color.Red
|
||||
Else
|
||||
TsBtnLockedEdit.Text = $"加锁表格"
|
||||
TsBtnLockedEdit.ForeColor = Color.Green
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub TsBtnLockedEdit_Click(sender As Object, e As EventArgs) Handles TsBtnLockedEdit.Click
|
||||
If StationPlan.TestPlanLocked Then
|
||||
If StationPlan.ParentPacket.PassWord.Length > 0 Then
|
||||
Dim pwd As String = InputBox(String.Empty, $"请输入解锁密码")
|
||||
If String.Compare(pwd, StationPlan.ParentPacket.PassWord) <> 0 Then Return
|
||||
End If
|
||||
StationPlan.TestPlanLocked = False
|
||||
LockedTestPlanGrid(StationPlan.TestPlanLocked)
|
||||
Else
|
||||
StationPlan.TestPlanLocked = True
|
||||
LockedTestPlanGrid(StationPlan.TestPlanLocked)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub InitStationPlanCommandHelper()
|
||||
Try
|
||||
StationPlanCommandHelpers = StationPlanCommandHelper.InitCommandHelper(Database.Sqlite.ConnectionParams.Path, Database.Sqlite.ConnectionParams.Password)
|
||||
Catch ex As Exception
|
||||
Console.WriteLine($"InitStationPlanCommandHelper Error:{ex.Message}")
|
||||
End Try
|
||||
If StationPlanCommandHelpers Is Nothing Then
|
||||
StationPlanCommandHelpers = New Dictionary(Of String, StationPlanCommandHelper)()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub InitStationPlanColHelper()
|
||||
Try
|
||||
StationPlanColHelpers = PlanColHelper.InitPlanColHelper(Database.Sqlite.ConnectionParams.Path, Database.Sqlite.ConnectionParams.Password)
|
||||
Catch ex As Exception
|
||||
Console.WriteLine($"InitStationPlanColHelper Error:{ex.Message}")
|
||||
End Try
|
||||
|
||||
If StationPlanColHelpers Is Nothing Then
|
||||
StationPlanColHelpers = New Dictionary(Of String, PlanColHelper)()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub InitForm()
|
||||
Dim commands As String() = StationPlanCommandHelpers.Keys.ToArray()
|
||||
StationPlanGrid.InitGrid(GrdTestPlan, commands)
|
||||
SingleRowGrid.InitGrid(GrdSingleRowInfo, commands)
|
||||
End Sub
|
||||
|
||||
Private Sub FrmStationPlan_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
_isShown = False
|
||||
|
||||
InitStationPlanCommandHelper()
|
||||
|
||||
InitStationPlanColHelper()
|
||||
|
||||
InitForm()
|
||||
|
||||
_isShown = True
|
||||
End Sub
|
||||
|
||||
Private Sub TsBtnReleaseStation_Click(sender As Object, e As EventArgs) Handles TsBtnReleaseStation.Click
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "TestPlan"
|
||||
|
||||
Private Sub TestPlanSelChange(selRow As Integer, selCol As Integer)
|
||||
Static lastRow As Integer = 0
|
||||
Static lastCol As Integer = 0
|
||||
|
||||
If selRow < 1 OrElse selRow > GrdTestPlan.Rows - 1 Then Return
|
||||
If selCol < 0 OrElse selCol > GrdTestPlan.Cols - 1 Then Return
|
||||
|
||||
_cellChanged = GridCellChangedEnum.TestPlanSelChange
|
||||
|
||||
If lastRow <> selRow Then
|
||||
SyncTestPlanRow(selRow)
|
||||
ChangeSingleRowGridColName()
|
||||
|
||||
UpdateSingleRowTip(TestPlanColToSingleRow(selCol))
|
||||
lastRow = selRow
|
||||
End If
|
||||
|
||||
If lastCol <> selCol Then
|
||||
SingleRowSelChange(TestPlanColToSingleRow(selCol))
|
||||
lastCol = selCol
|
||||
End If
|
||||
|
||||
_cellChanged = GridCellChangedEnum.None
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 流程表格选中行修改时,将流程表格某行的内容,填充到单行信息表中
|
||||
''' </summary>
|
||||
''' <param name="selRow"></param>
|
||||
Private Sub SyncTestPlanRow(selRow As Integer)
|
||||
Dim col As Integer = SingleRowGrid.ColNameEnum.ColValue
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Step, col).Text = selRow.ToString()
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.[Label], col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.[Label]).Text
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Action, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Action).Text
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Command, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Command).Text
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Description, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Description).Text
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Retry, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Retry).Text
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.RetryInterval, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.RetryInterval).Text
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Record, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Record).Text
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.RecordName, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.RecordName).Text
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.PassGoto, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.PassGoto).Text
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.FailGoto, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.FailGoto).Text
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.ErrorCode, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.ErrorCode).Text
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.ErrorMessage, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.ErrorMessage).Text
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Help, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Help).Text
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter1, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Parameter1).Text
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter2, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Parameter2).Text
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter3, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Parameter3).Text
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter4, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Parameter4).Text
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter5, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Parameter5).Text
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter6, col).Text = GrdTestPlan.Cell(selRow, StationPlanGrid.ColNameEnum.Parameter6).Text
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 命令变更时,修改单行信息表中列名
|
||||
''' </summary>
|
||||
Private Sub ChangeSingleRowGridColName()
|
||||
Static colNameChanged As Boolean = False
|
||||
|
||||
Dim col As Integer = SingleRowGrid.ColNameEnum.ColValue
|
||||
Dim command As String = GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Command, col).Text
|
||||
Dim nameCol As Integer = SingleRowGrid.ColNameEnum.ColName
|
||||
|
||||
If String.IsNullOrEmpty(command) OrElse StationPlanCommandHelpers.ContainsKey(command) = False Then
|
||||
If colNameChanged Then
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter1, nameCol).Text = SingleRowGrid.RowNameEnum.Parameter1.ToString()
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter2, nameCol).Text = SingleRowGrid.RowNameEnum.Parameter2.ToString()
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter3, nameCol).Text = SingleRowGrid.RowNameEnum.Parameter3.ToString()
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter4, nameCol).Text = SingleRowGrid.RowNameEnum.Parameter4.ToString()
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter5, nameCol).Text = SingleRowGrid.RowNameEnum.Parameter5.ToString()
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter6, nameCol).Text = SingleRowGrid.RowNameEnum.Parameter6.ToString()
|
||||
|
||||
colNameChanged = False
|
||||
End If
|
||||
Else
|
||||
Dim commandHelper As StationPlanCommandHelper = StationPlanCommandHelpers.Item(command)
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter1, nameCol).Text = commandHelper.Params(0).Desc
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter2, nameCol).Text = commandHelper.Params(1).Desc
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter3, nameCol).Text = commandHelper.Params(2).Desc
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter4, nameCol).Text = commandHelper.Params(3).Desc
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter5, nameCol).Text = commandHelper.Params(4).Desc
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter6, nameCol).Text = commandHelper.Params(5).Desc
|
||||
|
||||
If colNameChanged = False Then colNameChanged = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub GrdTestPlan_SelChange(sender As Object, e As Grid.SelChangeEventArgs) Handles GrdTestPlan.SelChange
|
||||
TestPlanSelChange(e.FirstRow, e.FirstCol)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 测试流程表列号转换成单行信息表的对应行号
|
||||
''' </summary>
|
||||
''' <param name="col"></param>
|
||||
''' <returns></returns>
|
||||
Private Function TestPlanColToSingleRow(col As Integer) As Integer
|
||||
Dim row As Integer
|
||||
Select Case col
|
||||
Case StationPlanGrid.ColNameEnum.Step
|
||||
row = SingleRowGrid.RowNameEnum.Step
|
||||
|
||||
Case StationPlanGrid.ColNameEnum.[Label]
|
||||
row = SingleRowGrid.RowNameEnum.[Label]
|
||||
Case StationPlanGrid.ColNameEnum.Action
|
||||
row = SingleRowGrid.RowNameEnum.Action
|
||||
|
||||
Case StationPlanGrid.ColNameEnum.Command
|
||||
row = SingleRowGrid.RowNameEnum.Command
|
||||
Case StationPlanGrid.ColNameEnum.Description
|
||||
row = SingleRowGrid.RowNameEnum.Description
|
||||
|
||||
Case StationPlanGrid.ColNameEnum.Parameter1
|
||||
row = SingleRowGrid.RowNameEnum.Parameter1
|
||||
Case StationPlanGrid.ColNameEnum.Parameter2
|
||||
row = SingleRowGrid.RowNameEnum.Parameter2
|
||||
Case StationPlanGrid.ColNameEnum.Parameter3
|
||||
row = SingleRowGrid.RowNameEnum.Parameter3
|
||||
Case StationPlanGrid.ColNameEnum.Parameter4
|
||||
row = SingleRowGrid.RowNameEnum.Parameter4
|
||||
Case StationPlanGrid.ColNameEnum.Parameter5
|
||||
row = SingleRowGrid.RowNameEnum.Parameter5
|
||||
Case StationPlanGrid.ColNameEnum.Parameter6
|
||||
row = SingleRowGrid.RowNameEnum.Parameter6
|
||||
|
||||
Case StationPlanGrid.ColNameEnum.Retry
|
||||
row = SingleRowGrid.RowNameEnum.Retry
|
||||
Case StationPlanGrid.ColNameEnum.RetryInterval
|
||||
row = SingleRowGrid.RowNameEnum.RetryInterval
|
||||
|
||||
Case StationPlanGrid.ColNameEnum.Record
|
||||
row = SingleRowGrid.RowNameEnum.Record
|
||||
Case StationPlanGrid.ColNameEnum.RecordName
|
||||
row = SingleRowGrid.RowNameEnum.RecordName
|
||||
|
||||
Case StationPlanGrid.ColNameEnum.PassGoto
|
||||
row = SingleRowGrid.RowNameEnum.PassGoto
|
||||
Case StationPlanGrid.ColNameEnum.FailGoto
|
||||
row = SingleRowGrid.RowNameEnum.FailGoto
|
||||
|
||||
Case StationPlanGrid.ColNameEnum.ErrorCode
|
||||
row = SingleRowGrid.RowNameEnum.ErrorCode
|
||||
Case StationPlanGrid.ColNameEnum.ErrorMessage
|
||||
row = SingleRowGrid.RowNameEnum.ErrorMessage
|
||||
|
||||
Case StationPlanGrid.ColNameEnum.Help
|
||||
row = SingleRowGrid.RowNameEnum.Help
|
||||
Case Else
|
||||
Console.WriteLine($"SyncTestPlanChange Unknown Col:{col}")
|
||||
End Select
|
||||
Return row
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 测试流程表内容修改时,同步更新单行信息表内容
|
||||
''' </summary>
|
||||
''' <param name="e"></param>
|
||||
Private Sub SyncTestPlanChange(e As Grid.CellChangingEventArgs)
|
||||
Dim row As Integer = TestPlanColToSingleRow(e.Col)
|
||||
Dim col As Integer = SingleRowGrid.ColNameEnum.ColValue
|
||||
|
||||
GrdSingleRowInfo.Cell(row, col).Text = GrdTestPlan.Cell(e.Row, e.Col).Text
|
||||
End Sub
|
||||
|
||||
Private _dropDownRow As Integer
|
||||
Private _dropDownCol As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 测试流程表格命令变更时,应用帮助信息
|
||||
''' </summary>
|
||||
Private Sub GrdTestPlanCommandChanged()
|
||||
Dim key As String = GrdTestPlan.Cell(_dropDownRow, _dropDownCol).Text
|
||||
If StationPlanCommandHelpers.ContainsKey(key) Then
|
||||
Dim planCommandHelper As StationPlanCommandHelper = StationPlanCommandHelpers.Item(key)
|
||||
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.Action).Text = "1"
|
||||
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.Description).Text = planCommandHelper.CommandDesc
|
||||
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.Parameter1).Text = planCommandHelper.Params(0).Value
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.Parameter2).Text = planCommandHelper.Params(1).Value
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.Parameter3).Text = planCommandHelper.Params(2).Value
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.Parameter4).Text = planCommandHelper.Params(3).Value
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.Parameter5).Text = planCommandHelper.Params(4).Value
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.Parameter6).Text = planCommandHelper.Params(5).Value
|
||||
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.Retry).Text = planCommandHelper.Retry
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.RetryInterval).Text = planCommandHelper.RetryInterval
|
||||
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.Record).Text = planCommandHelper.Record
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.RecordName).Text = planCommandHelper.RecordName
|
||||
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.PassGoto).Text = planCommandHelper.PassGoto
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.FailGoto).Text = planCommandHelper.FailGoto
|
||||
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.ErrorCode).Text = planCommandHelper.ErrorCode
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.ErrorMessage).Text = planCommandHelper.ErrorMessage
|
||||
|
||||
GrdTestPlan.Cell(_dropDownRow, StationPlanGrid.ColNameEnum.Help).Text = planCommandHelper.Help
|
||||
End If
|
||||
|
||||
ChangeSingleRowGridColName() '变更单行信息表列名
|
||||
End Sub
|
||||
|
||||
Private Sub GrdTestPlan_CellChanging(sender As Object, e As Grid.CellChangingEventArgs) Handles GrdTestPlan.CellChanging
|
||||
If _isShown = False Then Return
|
||||
If _cellChanged = GridCellChangedEnum.None Then _cellChanged = GridCellChangedEnum.TestPlan
|
||||
|
||||
If _cellChanged = GridCellChangedEnum.TestPlan Then
|
||||
SyncTestPlanChange(e)
|
||||
_cellChanged = GridCellChangedEnum.None
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GrdTestPlan_ComboClick(sender As Object, e As Grid.ComboClickEventArgs) Handles GrdTestPlan.ComboClick
|
||||
If _dropDownCol = StationPlanGrid.ColNameEnum.Command Then
|
||||
GrdTestPlanCommandChanged()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GrdTestPlan_ComboDropDown(sender As Object, e As Grid.ComboDropDownEventArgs) Handles GrdTestPlan.ComboDropDown
|
||||
_dropDownRow = e.Row
|
||||
_dropDownCol = e.Col
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "SingleRow"
|
||||
Enum GridCellChangedEnum
|
||||
None
|
||||
TestPlan
|
||||
SingleRowInfo
|
||||
TestPlanSelChange
|
||||
End Enum
|
||||
|
||||
Private _cellChanged As GridCellChangedEnum = GridCellChangedEnum.None
|
||||
|
||||
Private _grdSingleRowDropRow As Integer
|
||||
Private _grdSingleRowDropCol As Integer
|
||||
|
||||
Private Function SingleRowToTestPlanCol(row As Integer) As Integer
|
||||
Dim col As Integer
|
||||
Select Case row
|
||||
Case SingleRowGrid.RowNameEnum.[Label]
|
||||
col = StationPlanGrid.ColNameEnum.[Label]
|
||||
Case SingleRowGrid.RowNameEnum.Action
|
||||
col = StationPlanGrid.ColNameEnum.Action
|
||||
|
||||
Case SingleRowGrid.RowNameEnum.Command
|
||||
col = StationPlanGrid.ColNameEnum.Command
|
||||
Case SingleRowGrid.RowNameEnum.Description
|
||||
col = StationPlanGrid.ColNameEnum.Description
|
||||
|
||||
Case SingleRowGrid.RowNameEnum.Parameter1
|
||||
col = StationPlanGrid.ColNameEnum.Parameter1
|
||||
Case SingleRowGrid.RowNameEnum.Parameter2
|
||||
col = StationPlanGrid.ColNameEnum.Parameter2
|
||||
Case SingleRowGrid.RowNameEnum.Parameter3
|
||||
col = StationPlanGrid.ColNameEnum.Parameter3
|
||||
Case SingleRowGrid.RowNameEnum.Parameter4
|
||||
col = StationPlanGrid.ColNameEnum.Parameter4
|
||||
Case SingleRowGrid.RowNameEnum.Parameter5
|
||||
col = StationPlanGrid.ColNameEnum.Parameter5
|
||||
Case SingleRowGrid.RowNameEnum.Parameter6
|
||||
col = StationPlanGrid.ColNameEnum.Parameter6
|
||||
|
||||
Case SingleRowGrid.RowNameEnum.Retry
|
||||
col = StationPlanGrid.ColNameEnum.Retry
|
||||
Case SingleRowGrid.RowNameEnum.RetryInterval
|
||||
col = StationPlanGrid.ColNameEnum.RetryInterval
|
||||
|
||||
Case SingleRowGrid.RowNameEnum.Record
|
||||
col = StationPlanGrid.ColNameEnum.Record
|
||||
Case SingleRowGrid.RowNameEnum.RecordName
|
||||
col = StationPlanGrid.ColNameEnum.RecordName
|
||||
|
||||
Case SingleRowGrid.RowNameEnum.PassGoto
|
||||
col = StationPlanGrid.ColNameEnum.PassGoto
|
||||
Case SingleRowGrid.RowNameEnum.FailGoto
|
||||
col = StationPlanGrid.ColNameEnum.FailGoto
|
||||
|
||||
Case SingleRowGrid.RowNameEnum.ErrorCode
|
||||
col = StationPlanGrid.ColNameEnum.ErrorCode
|
||||
Case SingleRowGrid.RowNameEnum.ErrorMessage
|
||||
col = StationPlanGrid.ColNameEnum.ErrorMessage
|
||||
|
||||
Case SingleRowGrid.RowNameEnum.Help
|
||||
col = StationPlanGrid.ColNameEnum.Help
|
||||
Case Else
|
||||
Console.WriteLine($"SyncSingleRowChange Unknown Row:{row}")
|
||||
End Select
|
||||
Return col
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 单行信息表格内容修改时,同步修改测试流程表的内容
|
||||
''' </summary>
|
||||
''' <param name="e"></param>
|
||||
Private Sub SyncSingleRowChange(e As Grid.CellChangingEventArgs)
|
||||
If e.Col <> SingleRowGrid.ColNameEnum.ColValue Then Return
|
||||
|
||||
If GrdTestPlan.Selection Is Nothing Then Return
|
||||
If GrdTestPlan.Selection.FirstRow <= 0 OrElse GrdTestPlan.Selection.LastCol >= GrdTestPlan.Cols Then Return
|
||||
|
||||
Dim col As Integer = SingleRowToTestPlanCol(e.Row)
|
||||
Dim row As Integer = GrdTestPlan.Selection.FirstRow
|
||||
GrdTestPlan.Cell(row, col).Text = GrdSingleRowInfo.Cell(e.Row, e.Col).Text
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 单行信息表格命令修改后,同步刷新本身信息
|
||||
''' </summary>
|
||||
Private Sub GrdSingleRowInfoCommandChanged()
|
||||
Dim key As String = GrdSingleRowInfo.Cell(_grdSingleRowDropRow, _grdSingleRowDropCol).Text
|
||||
If StationPlanCommandHelpers.ContainsKey(key) Then
|
||||
Dim planCommandHelper As StationPlanCommandHelper = StationPlanCommandHelpers.Item(key)
|
||||
Dim col As Integer = SingleRowGrid.ColNameEnum.ColValue
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Action, col).Text = "1"
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Description, col).Text = planCommandHelper.CommandDesc
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter1, col).Text = planCommandHelper.Params(0).Value
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter2, col).Text = planCommandHelper.Params(1).Value
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter3, col).Text = planCommandHelper.Params(2).Value
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter4, col).Text = planCommandHelper.Params(3).Value
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter5, col).Text = planCommandHelper.Params(4).Value
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Parameter6, col).Text = planCommandHelper.Params(5).Value
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Retry, col).Text = planCommandHelper.Retry
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.RetryInterval, col).Text = planCommandHelper.RetryInterval
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Record, col).Text = planCommandHelper.Record
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.RecordName, col).Text = planCommandHelper.RecordName
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.PassGoto, col).Text = planCommandHelper.PassGoto
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.FailGoto, col).Text = planCommandHelper.FailGoto
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.ErrorCode, col).Text = planCommandHelper.ErrorCode
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.ErrorMessage, col).Text = planCommandHelper.ErrorMessage
|
||||
|
||||
GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Help, col).Text = planCommandHelper.Help
|
||||
End If
|
||||
End Sub
|
||||
Private Sub GrdSingleRowInfo_CellChanging(sender As Object, e As Grid.CellChangingEventArgs) Handles GrdSingleRowInfo.CellChanging
|
||||
If _isShown = False Then Return
|
||||
If _cellChanged = GridCellChangedEnum.None Then _cellChanged = GridCellChangedEnum.SingleRowInfo
|
||||
|
||||
If _cellChanged = GridCellChangedEnum.SingleRowInfo Then
|
||||
SyncSingleRowChange(e)
|
||||
_cellChanged = GridCellChangedEnum.None
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GrdSingleRowInfo_ComboDropDown(sender As Object, e As Grid.ComboDropDownEventArgs) Handles GrdSingleRowInfo.ComboDropDown
|
||||
_grdSingleRowDropRow = e.Row
|
||||
_grdSingleRowDropCol = e.Col
|
||||
|
||||
Select Case e.Row
|
||||
Case SingleRowGrid.RowNameEnum.Command
|
||||
GrdSingleRowInfo.ComboBox(0).Items.Clear()
|
||||
GrdSingleRowInfo.ComboBox(0).Items.AddRange(StationPlanCommandHelpers.Keys.ToArray())
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub GrdSingleRowInfo_ComboClick(sender As Object, e As Grid.ComboClickEventArgs) Handles GrdSingleRowInfo.ComboClick
|
||||
If _grdSingleRowDropRow = SingleRowGrid.RowNameEnum.Command Then
|
||||
GrdSingleRowInfoCommandChanged()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "TestPlan 右键菜单"
|
||||
Private Sub MsiAddPlanRow_Click(sender As Object, e As EventArgs) Handles MsiAddPlanRow.Click, MsiPlanAddRow.Click
|
||||
If GrdTestPlan.Selection Is Nothing Then
|
||||
GrdTestPlan.AddItem("")
|
||||
Else
|
||||
GrdTestPlan.InsertRow(GrdTestPlan.Selection.FirstRow, 1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub 删除一行ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 删除一行ToolStripMenuItem.Click
|
||||
If GrdTestPlan.Selection IsNot Nothing Then
|
||||
GrdTestPlan.Selection.DeleteByRow()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub 内容自适应ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 内容自适应ToolStripMenuItem.Click
|
||||
GrdTestPlan.AutoSize = Not GrdTestPlan.AutoSize
|
||||
If GrdTestPlan.AutoSize Then
|
||||
GrdTestPlan.AutoSize = False
|
||||
内容自适应ToolStripMenuItem.Text = $"取消自适应"
|
||||
Else
|
||||
GrdTestPlan.AutoSize = True
|
||||
内容自适应ToolStripMenuItem.Text = $"内容自适应"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub 调整字体ToolStripMenuItem_DropDownItemClicked(sender As Object, e As ToolStripItemClickedEventArgs) Handles 调整字体ToolStripMenuItem.DropDownItemClicked
|
||||
GrdTestPlan.Selection.FontName = e.ClickedItem.Text
|
||||
End Sub
|
||||
|
||||
Private Sub 调整字色ToolStripMenuItem_DropDownItemClicked(sender As Object, e As ToolStripItemClickedEventArgs) Handles 调整字色ToolStripMenuItem.DropDownItemClicked
|
||||
GrdTestPlan.Selection.ForeColor = e.ClickedItem.ForeColor
|
||||
End Sub
|
||||
|
||||
Private Sub 调整背景ToolStripMenuItem_DropDownItemClicked(sender As Object, e As ToolStripItemClickedEventArgs) Handles 调整背景ToolStripMenuItem.DropDownItemClicked
|
||||
GrdTestPlan.Selection.BackColor = e.ClickedItem.BackColor
|
||||
End Sub
|
||||
|
||||
Private Sub 对齐方式ToolStripMenuItem_DropDownItemClicked(sender As Object, e As ToolStripItemClickedEventArgs) Handles 对齐方式ToolStripMenuItem.DropDownItemClicked
|
||||
Dim alignment As AlignmentEnum = AlignmentEnum.CenterCenter
|
||||
Select Case e.ClickedItem.Text
|
||||
Case "上层居左"
|
||||
alignment = AlignmentEnum.LeftTop
|
||||
Case "上层居中"
|
||||
alignment = AlignmentEnum.CenterTop
|
||||
Case "上层居右"
|
||||
alignment = AlignmentEnum.RightTop
|
||||
Case "中层居左"
|
||||
alignment = AlignmentEnum.LeftCenter
|
||||
Case "中层居中"
|
||||
alignment = AlignmentEnum.CenterCenter
|
||||
Case "中层居右"
|
||||
alignment = AlignmentEnum.RightCenter
|
||||
Case "下层居左"
|
||||
alignment = AlignmentEnum.LeftBottom
|
||||
Case "下层居中"
|
||||
alignment = AlignmentEnum.CenterBottom
|
||||
Case "下层居右"
|
||||
alignment = AlignmentEnum.RightBottom
|
||||
Case Else
|
||||
Console.WriteLine($"对齐方式ToolStripMenuItem_DropDownItemClicked Unknown Text:{e.ClickedItem.Text}")
|
||||
End Select
|
||||
GrdTestPlan.Selection.Alignment = alignment
|
||||
End Sub
|
||||
|
||||
Private Sub 修改主题ToolStripMenuItem_DropDownItemClicked(sender As Object, e As ToolStripItemClickedEventArgs) Handles 修改主题ToolStripMenuItem.DropDownItemClicked
|
||||
Select Case e.ClickedItem.Text
|
||||
Case "默认主题"
|
||||
|
||||
Case Else
|
||||
Console.WriteLine($"修改主题ToolStripMenuItem_DropDownItemClicked Unknown Text:{e.ClickedItem.Text}")
|
||||
End Select
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "TestPlan光标追随"
|
||||
Private _mouseFollow As Boolean = False '是否开启鼠标跟随功能
|
||||
Private _mouseMoveLastRow As Integer = 0 '鼠标移动上次所在行
|
||||
|
||||
Private Sub TsBtnMouseFollow_Click(sender As Object, e As EventArgs) Handles TsBtnMouseFollow.Click
|
||||
If _mouseFollow Then
|
||||
_mouseFollow = False
|
||||
|
||||
GrdTestPlan.Range(_mouseMoveLastRow, 1, _mouseMoveLastRow, GrdTestPlan.Cols - 1).Borders(EdgeEnum.Outside) = LineStyleEnum.None
|
||||
|
||||
TsBtnMouseFollow.Text = $"光标预览"
|
||||
Else
|
||||
_mouseFollow = True
|
||||
TsBtnMouseFollow.Text = $"取消预览"
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub TestPlanMouseMoveChangeBorders(mouseRow As Integer)
|
||||
If _mouseMoveLastRow = mouseRow Then Return
|
||||
If mouseRow < 1 OrElse mouseRow > GrdTestPlan.Rows - 1 Then Return
|
||||
|
||||
GrdTestPlan.Range(_mouseMoveLastRow, 1, _mouseMoveLastRow, GrdTestPlan.Cols - 1).Borders(EdgeEnum.Outside) = LineStyleEnum.None
|
||||
|
||||
GrdTestPlan.Range(mouseRow, 1, mouseRow, GrdTestPlan.Cols - 1).Borders(EdgeEnum.Outside) = LineStyleEnum.Thin
|
||||
|
||||
_mouseMoveLastRow = mouseRow
|
||||
End Sub
|
||||
|
||||
Private Sub TestPlanMouseMove()
|
||||
If _mouseFollow = False Then Return
|
||||
|
||||
Dim mouseRow As Integer = GrdTestPlan.MouseRow
|
||||
Dim mouseCol As Integer = GrdTestPlan.MouseCol
|
||||
|
||||
TestPlanSelChange(mouseRow, mouseCol)
|
||||
|
||||
TestPlanMouseMoveChangeBorders(mouseRow)
|
||||
End Sub
|
||||
|
||||
Private Sub GrdTestPlan_MouseMove(sender As Object, e As MouseEventArgs) Handles GrdTestPlan.MouseMove
|
||||
TestPlanMouseMove()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub GrdTestPlan_Scroll(sender As Object, e As EventArgs) Handles GrdTestPlan.Scroll
|
||||
TestPlanMouseMove()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "SingleRow 提示选择列"
|
||||
Private _lastSingleRowSelCol As Integer
|
||||
Private _lastSingleRowSelRow As Integer
|
||||
|
||||
Private Sub UpdatePlanColNameTip(colName As String)
|
||||
If StationPlanColHelpers.ContainsKey(colName) Then
|
||||
Dim colHelper As PlanColHelper = StationPlanColHelpers.Item(colName)
|
||||
RtxColTip.SuspendLayout()
|
||||
RtxColTip.Clear()
|
||||
|
||||
RtxColTip.AppendText($"{colHelper.ColName}{vbCrLf}")
|
||||
RtxColTip.AppendText($"类型:{colHelper.ColType}{vbCrLf}")
|
||||
RtxColTip.AppendText($"描述:{colHelper.ColDesc}{vbCrLf}")
|
||||
RtxColTip.ResumeLayout(False)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub UpdateCommandTip(colName As String, command As String, paramIndex As Integer)
|
||||
If StationPlanCommandHelpers.ContainsKey(command) Then
|
||||
Dim commandHelper As StationPlanCommandHelper = StationPlanCommandHelpers.Item(command)
|
||||
RtxColTip.SuspendLayout()
|
||||
RtxColTip.Clear()
|
||||
|
||||
RtxColTip.AppendText($"{colName}{vbCrLf}")
|
||||
RtxColTip.AppendText($"类型:{commandHelper.Params(paramIndex).Type}{vbCrLf}")
|
||||
RtxColTip.AppendText($"上限:{commandHelper.Params(paramIndex).UpperLimit}{vbCrLf}")
|
||||
RtxColTip.AppendText($"下限:{commandHelper.Params(paramIndex).LowerLimit}{vbCrLf}")
|
||||
RtxColTip.AppendText($"描述:{commandHelper.Params(paramIndex).Desc}{vbCrLf}")
|
||||
RtxColTip.ResumeLayout(False)
|
||||
Else
|
||||
RtxColTip.AppendText($"{colName}{vbCrLf}")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 单行信息表格更新当前行
|
||||
''' </summary>
|
||||
''' <param name="row"></param>
|
||||
Private Sub UpdateSingleRowTip(row As Integer)
|
||||
Dim colName As String = GrdSingleRowInfo.Cell(row, SingleRowGrid.ColNameEnum.ColName).Text
|
||||
|
||||
If row >= SingleRowGrid.RowNameEnum.Parameter1 AndAlso row <= SingleRowGrid.RowNameEnum.Parameter6 Then
|
||||
Dim command As String = GrdSingleRowInfo.Cell(SingleRowGrid.RowNameEnum.Command, SingleRowGrid.ColNameEnum.ColValue).Text
|
||||
If String.IsNullOrEmpty(command) Then
|
||||
UpdatePlanColNameTip(colName)
|
||||
Else
|
||||
UpdateCommandTip(colName, command, row - SingleRowGrid.RowNameEnum.Parameter1)
|
||||
End If
|
||||
Else
|
||||
UpdatePlanColNameTip(colName)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub SingleRowSelChange(row As Integer)
|
||||
If _lastSingleRowSelRow = row Then Return
|
||||
|
||||
'新增命令切换处理
|
||||
|
||||
GrdSingleRowInfo.Cell(_lastSingleRowSelRow, SingleRowGrid.ColNameEnum.ColName).FontBold = False
|
||||
|
||||
GrdSingleRowInfo.Cell(row, SingleRowGrid.ColNameEnum.ColName).FontBold = True
|
||||
|
||||
UpdateSingleRowTip(row) '更新列提示
|
||||
|
||||
_lastSingleRowSelRow = row
|
||||
End Sub
|
||||
|
||||
Private Sub GrdSingleRowInfo_SelChange(sender As Object, e As Grid.SelChangeEventArgs) Handles GrdSingleRowInfo.SelChange
|
||||
SingleRowSelChange(e.FirstRow)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
57
UTS_Core/UTSModule/Project/PlanColHelper.vb
Normal file
57
UTS_Core/UTSModule/Project/PlanColHelper.vb
Normal file
@@ -0,0 +1,57 @@
|
||||
Imports System.Data.SQLite
|
||||
Imports UTS_Core.Database.Sqlite
|
||||
Imports UTS_Core.UTSModule.DatabaseTable
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class PlanColHelper
|
||||
Property ColName() As String
|
||||
|
||||
Property ColType() As String
|
||||
|
||||
Property ColDesc() As String
|
||||
|
||||
|
||||
Private Shared Function SearchPlanCol(path As String, password As String) As DataTable
|
||||
Dim connectString As String = CommandHelpers.ConnectionString(path, password)
|
||||
Using sqliteConn As New SQLiteConnection(connectString)
|
||||
sqliteConn.Open()
|
||||
Dim tableName As String = StationPlanColHelperTable.TableName
|
||||
Dim colNames As New List(Of String)
|
||||
colNames.Add(StationPlanColHelperTable.ColNamesEnum.ID.ToString())
|
||||
colNames.Add(StationPlanColHelperTable.ColNamesEnum.ColName.ToString())
|
||||
colNames.Add(StationPlanColHelperTable.ColNamesEnum.ColType.ToString())
|
||||
colNames.Add(StationPlanColHelperTable.ColNamesEnum.ColDesc.ToString())
|
||||
|
||||
Return Executor.Search(sqliteConn, tableName, colNames)
|
||||
End Using
|
||||
End Function
|
||||
|
||||
|
||||
Public Function InitPlanColHelper(dtRow As DataRow) As Boolean
|
||||
ColName = dtRow.Item(StationPlanColHelperTable.ColNamesEnum.ColName).ToString()
|
||||
ColType = dtRow.Item(StationPlanColHelperTable.ColNamesEnum.ColType).ToString()
|
||||
ColDesc = dtRow.Item(StationPlanColHelperTable.ColNamesEnum.ColDesc).ToString()
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Shared Function InitPlanColHelper(dtPlanCol As DataTable) As Dictionary(Of String, PlanColHelper)
|
||||
Dim dicCommandHelpers As New Dictionary(Of String, PlanColHelper)
|
||||
|
||||
For row As Integer = 0 To dtPlanCol.Rows.Count - 1
|
||||
Dim colHelper As New PlanColHelper
|
||||
colHelper.InitPlanColHelper(dtPlanCol.Rows(row))
|
||||
|
||||
dicCommandHelpers.Add(colHelper.ColName, colHelper)
|
||||
Next
|
||||
|
||||
Return dicCommandHelpers
|
||||
End Function
|
||||
|
||||
Public Shared Function InitPlanColHelper(path As String, password As String) As Dictionary(Of String, PlanColHelper)
|
||||
Dim dtPlanCol As DataTable = SearchPlanCol(path, password)
|
||||
|
||||
Return InitPlanColHelper(dtPlanCol)
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
1292
UTS_Core/UTSModule/Project/ProjectInfo.vb
Normal file
1292
UTS_Core/UTSModule/Project/ProjectInfo.vb
Normal file
File diff suppressed because it is too large
Load Diff
129
UTS_Core/UTSModule/Project/ProjectStationGrid.vb
Normal file
129
UTS_Core/UTSModule/Project/ProjectStationGrid.vb
Normal file
@@ -0,0 +1,129 @@
|
||||
Imports System.Drawing
|
||||
Imports UTS_Core.UTSModule.Station
|
||||
|
||||
Namespace UTSModule.Project
|
||||
|
||||
Public Class ProjectStationGrid
|
||||
Public Enum ColNameEnum
|
||||
''' <summary>
|
||||
''' 工艺站序号
|
||||
''' </summary>
|
||||
Sn
|
||||
''' <summary>
|
||||
''' 工艺站名称
|
||||
''' </summary>
|
||||
Name
|
||||
''' <summary>
|
||||
''' 工艺站类型,下拉选择
|
||||
''' </summary>
|
||||
Type
|
||||
|
||||
''' <summary>
|
||||
''' 工艺站预览图,按键加载
|
||||
''' </summary>
|
||||
Preview
|
||||
|
||||
''' <summary>
|
||||
''' 工艺站描述
|
||||
''' </summary>
|
||||
Description
|
||||
|
||||
''' <summary>
|
||||
''' 条码生成方式,1.系统生成,2.用户录入
|
||||
''' </summary>
|
||||
SnType
|
||||
|
||||
''' <summary>
|
||||
''' 允许测试设备类型
|
||||
''' </summary>
|
||||
DevType
|
||||
|
||||
''' <summary>
|
||||
''' 允许测试软件名称
|
||||
''' </summary>
|
||||
DevApp
|
||||
|
||||
''' <summary>
|
||||
''' 工艺站包名,按键加载
|
||||
''' </summary>
|
||||
PacketName
|
||||
|
||||
Max
|
||||
End Enum
|
||||
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 初始化测试站表格
|
||||
''' </summary>
|
||||
''' <param name="grd">表格控件</param>
|
||||
Public Shared Sub InitTestStationGrid(grd As FlexCell.Grid, Optional userProject As ProjectInfo = Nothing)
|
||||
With grd
|
||||
.AutoRedraw = False
|
||||
.NewFile() '清空表格格式
|
||||
.Images.Clear() '清空缓存图
|
||||
|
||||
.Rows = 1
|
||||
.Cols = ColNameEnum.Max
|
||||
|
||||
.DisplayRowNumber = True '首列显示数字
|
||||
.ExtendLastCol = True '最后一列自动扩充
|
||||
.MultiSelect = False '是否允许选择多行
|
||||
.BackColorFixed = Color.FromArgb(255, 227, 228, 225)
|
||||
.BackColorFixedSel = Color.FromArgb(255, 201, 226, 244)
|
||||
.BackColorBkg = Color.FromArgb(255, 248, 232, 226)
|
||||
.BackColor1 = Color.FromArgb(255, 225, 246, 236)
|
||||
.BackColor2 = Color.FromArgb(255, 247, 247, 228)
|
||||
.BorderStyle = FlexCell.BorderStyleEnum.None
|
||||
.GridColor = Color.FromArgb(255, 148, 190, 231)
|
||||
.DefaultRowHeight = 40 '默认行高
|
||||
.DefaultFont = New Font("微软雅黑", 12)
|
||||
.Range(0, 0, 0, .Cols - 1).Font = New Font($"幼圆", 10) '首行样式
|
||||
|
||||
|
||||
.Column(ColNameEnum.Type).CellType = FlexCell.CellTypeEnum.ComboBox
|
||||
.ComboBox(ColNameEnum.Type).Items.AddRange([Enum].GetNames(GetType(ProcessStation.StationTypeEnum)))
|
||||
|
||||
.Column(ColNameEnum.SnType).CellType = FlexCell.CellTypeEnum.ComboBox
|
||||
.ComboBox(ColNameEnum.SnType).Items.AddRange([Enum].GetNames(GetType(ProcessStation.SnTypeEnum)))
|
||||
|
||||
.Column(ColNameEnum.PacketName).CellType = FlexCell.CellTypeEnum.Button
|
||||
|
||||
.Column(ColNameEnum.Description).Width = 240
|
||||
|
||||
For col As Integer = 0 To ColNameEnum.Max - 1
|
||||
.Cell(0, col).Text = [Enum].GetName(GetType(ColNameEnum), col) '设置列名
|
||||
Next
|
||||
|
||||
If userProject IsNot Nothing Then
|
||||
Dim row As Integer = 1
|
||||
For Each stationInfo As ProcessStation In userProject.Station
|
||||
If row > .Rows - 1 Then .AddItem(String.Empty)
|
||||
|
||||
.Cell(row, ColNameEnum.Name).Text = stationInfo.Name
|
||||
.Cell(row, ColNameEnum.Type).Text = stationInfo.StationType.ToString()
|
||||
.Cell(row, ColNameEnum.SnType).Text = stationInfo.SnType.ToString()
|
||||
|
||||
.Cell(row, ColNameEnum.Description).Text = stationInfo.Description
|
||||
.Cell(row, ColNameEnum.PacketName).Text = stationInfo.Packet.FileName
|
||||
|
||||
.Cell(row, ColNameEnum.DevType).Text = stationInfo.DevType
|
||||
.Cell(row, ColNameEnum.DevApp).Text = stationInfo.DevApp
|
||||
|
||||
If stationInfo.PreViewImage IsNot Nothing Then
|
||||
Dim imgKey As String = .Images.Count().ToString()
|
||||
.Images.Add(stationInfo.PreViewImage, imgKey) '添加预览图
|
||||
.Cell(row, ColNameEnum.Preview).SetImage(imgKey)
|
||||
End If
|
||||
|
||||
row += 1
|
||||
Next
|
||||
End If
|
||||
|
||||
.AutoRedraw = True
|
||||
.Refresh()
|
||||
End With
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
119
UTS_Core/UTSModule/Project/ProjectStationInfo.vb
Normal file
119
UTS_Core/UTSModule/Project/ProjectStationInfo.vb
Normal file
@@ -0,0 +1,119 @@
|
||||
Imports System.Drawing
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class StationInfo
|
||||
Sub New(project As ProjectInfo)
|
||||
Index = String.Empty
|
||||
SerialNumber = String.Empty
|
||||
Name = String.Empty
|
||||
Description = String.Empty
|
||||
|
||||
DevType = String.Empty
|
||||
DevApp = String.Empty
|
||||
|
||||
UserId = String.Empty
|
||||
|
||||
Packet = New ProjectStationPacket(Me)
|
||||
ParentProject = project
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 项目站索引,项目站唯一索引,新建站时自动生成,生成后不能修改
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Index As String
|
||||
|
||||
''' <summary>
|
||||
''' 项目站名称
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Name As String
|
||||
|
||||
''' <summary>
|
||||
''' 项目站序号,表示该站在项目站总流程中测试顺序
|
||||
''' 例如T01,表示当前为第一站
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property SerialNumber() As String
|
||||
|
||||
''' <summary>
|
||||
''' 使用测试站的设备类型
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DevType() As String
|
||||
|
||||
''' <summary>
|
||||
''' 使用测试站的设备软件名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DevApp() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 项目站内容描述
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Description As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 项目站当前操作人员,为当前登录人员账号
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property UserId As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 项目站关联的项目站包信息
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Packet() As ProjectStationPacket
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 项目站所属项目信息
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property ParentProject() As ProjectInfo
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 站序号已被修改
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property SerialNumberChanged() As Boolean
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 站名已被修改
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property NameChanged() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 站描述已被修改
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DescriptionChanged() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 站包名已被修改
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property PacketNameChanged() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 站包设备类型已被修改
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DevTypeChanged() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 站包设备应用程序已被修改
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DevAppChanged() As Boolean
|
||||
End Class
|
||||
End Namespace
|
||||
654
UTS_Core/UTSModule/Project/ProjectStationPacket.vb
Normal file
654
UTS_Core/UTSModule/Project/ProjectStationPacket.vb
Normal file
@@ -0,0 +1,654 @@
|
||||
Imports System.Data.SQLite
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports System.Xml
|
||||
Imports FlexCell
|
||||
Imports UTS_Core.Security
|
||||
Imports UTS_Core.Database.Sqlite
|
||||
Imports UTS_Core.UTSModule.DatabaseTable
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class ProjectStationPacket
|
||||
Sub New(station As StationInfo)
|
||||
CurrentImprint = New StationPacketImprint()
|
||||
HistoryImprints = New List(Of StationPacketImprint)()
|
||||
StationPlan = New ProjectStationPlan(Me)
|
||||
|
||||
StationVersion = 1 '项目站版本从一开始
|
||||
|
||||
ParentStation = station
|
||||
|
||||
End Sub
|
||||
|
||||
Private _image As Drawing.Image
|
||||
Private _imageFileName As String
|
||||
Private _fileName As String
|
||||
Private _name As String
|
||||
|
||||
''' <summary>测试包文件名称,不含.uts后缀</summary>
|
||||
Public ReadOnly Property Name() As String
|
||||
Get
|
||||
Return _name
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>测试包文件名称,含.uts后缀</summary>
|
||||
Public Property FileName() As String
|
||||
Get
|
||||
Return _fileName
|
||||
End Get
|
||||
Set(value As String)
|
||||
_fileName = value
|
||||
_name = Path.GetFileNameWithoutExtension(_fileName)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
''' <summary>测试站包版本</summary>
|
||||
Public Property StationVersion As Integer
|
||||
|
||||
|
||||
''' <summary>修改项目流程时所需密码</summary>
|
||||
Public Property PassWord As String
|
||||
|
||||
|
||||
''' <summary>测试站包有效日期</summary>
|
||||
Public Property ValidDate As Date
|
||||
|
||||
|
||||
''' <summary>测试站包创建时间</summary>
|
||||
Public Property CreateTime As Date
|
||||
|
||||
|
||||
''' <summary>测试站包修改时间</summary>
|
||||
Public Property ModifiedTime As Date
|
||||
|
||||
|
||||
''' <summary>发布测试站包的应用程序版本</summary>
|
||||
Public Property AppVersion() As Version
|
||||
|
||||
|
||||
''' <summary>发布测试站包的图片</summary>
|
||||
Public ReadOnly Property StationImage As Drawing.Image
|
||||
Get
|
||||
Return _image
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' 项目站包历史发布说明
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property HistoryImprints() As List(Of StationPacketImprint)
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 当前版本发布说明
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property CurrentImprint() As StationPacketImprint
|
||||
|
||||
Public Shared Function PacketImprintsToString(imprints As List(Of StationPacketImprint)) As String
|
||||
Dim strReturn As New StringBuilder
|
||||
For Each imprint As StationPacketImprint In imprints
|
||||
strReturn.Append($"{imprint.FileName}{vbNewLine}")
|
||||
strReturn.Append($"{imprint.Creator}{vbNewLine}")
|
||||
strReturn.Append(vbNewLine)
|
||||
|
||||
strReturn.Append(imprint.ToString())
|
||||
|
||||
strReturn.Append(vbNewLine)
|
||||
strReturn.Append(String.Empty.PadRight(40, "-"c))
|
||||
strReturn.Append(vbNewLine)
|
||||
Next
|
||||
|
||||
Return strReturn.ToString() '将历史记录转换成文本
|
||||
End Function
|
||||
|
||||
Public Property ImageFileName() As String
|
||||
Get
|
||||
Return _imageFileName
|
||||
End Get
|
||||
Set(value As String)
|
||||
_imageFileName = value
|
||||
Try
|
||||
Dim imagePath As String = $"{UtsPath.StationPacketResourceDirPath(Name)}\{_imageFileName}"
|
||||
If File.Exists(imagePath) Then
|
||||
_image = ImageProcessor.ImageProcessor.GetBitmapImage(imagePath)
|
||||
Else
|
||||
_image = Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Console.WriteLine($"ImageName Convert To Image Error:{ex.Message}")
|
||||
End Try
|
||||
End Set
|
||||
End Property
|
||||
|
||||
''' <summary>发布测试站包的测试流程</summary>
|
||||
Public Property StationPlan() As ProjectStationPlan
|
||||
|
||||
|
||||
''' <summary>测试站包所在的测试站信息</summary>
|
||||
Public Property ParentStation() As StationInfo
|
||||
|
||||
''' <summary>
|
||||
''' 创建项目站包
|
||||
''' </summary>
|
||||
Public Sub CreatePacket()
|
||||
If ParentStation Is Nothing Then Throw New Exception($"项目站包未关联项目站!")
|
||||
If ParentStation.ParentProject Is Nothing Then Throw New Exception($"项目站包未关联项目!")
|
||||
|
||||
'更新文件名,唯一索引
|
||||
FileName = NewPacketFileName()
|
||||
|
||||
StationVersion = 1 '流程从一开始
|
||||
PassWord = String.Empty
|
||||
ValidDate = Now.AddMonths(1) '有效期一个月
|
||||
CreateTime = Now
|
||||
ModifiedTime = Now
|
||||
AppVersion = New Version(Windows.Forms.Application.ProductVersion)
|
||||
HistoryImprints = New List(Of StationPacketImprint)()
|
||||
CurrentImprint = New StationPacketImprint()
|
||||
|
||||
'创建相关文件夹
|
||||
Directory.CreateDirectory(UtsPath.StationPacketDirPath(Name))
|
||||
Directory.CreateDirectory(UtsPath.StationPacketResourceDirPath(Name))
|
||||
Directory.CreateDirectory(UtsPath.StationPacketTestPlanDirPath(Name))
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function LoadImprintNode(nodeList As XmlNodeList) As List(Of String)
|
||||
Dim imprints As New List(Of String)
|
||||
Dim xe As XmlElement
|
||||
For Each node As XmlNode In nodeList
|
||||
xe = CType(node, XmlElement)
|
||||
Select Case xe.LocalName
|
||||
Case "Imprint"
|
||||
imprints.Add(xe.InnerText)
|
||||
End Select
|
||||
Next
|
||||
Return imprints
|
||||
End Function
|
||||
|
||||
Private Function LoadImprintsNode(nodeList As XmlNodeList) As List(Of String)
|
||||
Dim imprints As New List(Of String)
|
||||
Dim xe As XmlElement
|
||||
For Each node As XmlNode In nodeList
|
||||
xe = CType(node, XmlElement)
|
||||
Select Case xe.LocalName
|
||||
Case "Imprints"
|
||||
imprints = LoadImprintNode(node.ChildNodes)
|
||||
End Select
|
||||
Next
|
||||
Return imprints
|
||||
End Function
|
||||
|
||||
Private Function LoadHistoryImprintsNode(nodeList As XmlNodeList) As List(Of StationPacketImprint)
|
||||
Dim packetImprints As New List(Of StationPacketImprint)
|
||||
Dim xe As XmlElement
|
||||
For Each node As XmlNode In nodeList
|
||||
xe = CType(node, XmlElement)
|
||||
|
||||
Select Case xe.LocalName
|
||||
Case "HistoryImprint"
|
||||
Dim packetImprint As New StationPacketImprint
|
||||
packetImprint.FileName = xe.GetAttribute($"PacketName")
|
||||
packetImprint.Creator = xe.GetAttribute($"Creator")
|
||||
packetImprint.Imprints = LoadImprintsNode(node.ChildNodes)
|
||||
packetImprints.Add(packetImprint)
|
||||
Case Else
|
||||
Console.WriteLine($"LoadHistoryImprintsNode Unknown NodeName:{xe.LocalName}")
|
||||
End Select
|
||||
Next
|
||||
Return packetImprints
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 加载项目站包信息文件
|
||||
''' </summary>
|
||||
''' <param name="packetInfoFilePath"></param>
|
||||
Private Sub LoadStationPacketInfoFile(packetInfoFilePath As String)
|
||||
Dim xd As New XmlDocument()
|
||||
xd.Load(packetInfoFilePath)
|
||||
Dim nodeList As XmlNodeList = xd.SelectSingleNode("Configs/StationInfo").ChildNodes
|
||||
For Each node As XmlNode In nodeList
|
||||
Dim xe As XmlElement = CType(node, XmlElement)
|
||||
Select Case xe.LocalName
|
||||
Case "AppVersion"
|
||||
If Version.TryParse(xe.InnerText, AppVersion) = False Then '版本转换
|
||||
Throw New Exception($"AppVersionError!")
|
||||
End If
|
||||
'If AppVersion.CompareTo(My.Application.Info.Version) > 0 Then '版本比较,应该在加载后校验。
|
||||
' Throw New Exception($"AppVersion Is Too Low!")
|
||||
'End If
|
||||
Case "CreateTime"
|
||||
If Date.TryParse(xe.InnerText, CreateTime) = False Then
|
||||
Throw New Exception($"CreateTimeError!")
|
||||
End If
|
||||
Case "ModifiedTime"
|
||||
If Date.TryParse(xe.InnerText, ModifiedTime) = False Then
|
||||
Throw New Exception($"ModifiedTimeError!")
|
||||
End If
|
||||
Case "PassWord"
|
||||
PassWord = Aes128.DecryptStr(xe.InnerText, Aes128.ServerAesKey)
|
||||
Case "ValidDate"
|
||||
If Date.TryParse(Aes128.DecryptStr(xe.InnerText, Aes128.ServerAesKey), ValidDate) = False Then
|
||||
Throw New Exception($"ValidDateError!")
|
||||
End If
|
||||
Case "StationVersion"
|
||||
If IsNumeric(xe.InnerText) = False Then
|
||||
StationVersion = 1
|
||||
Else
|
||||
StationVersion = CType(xe.InnerText, Integer)
|
||||
End If
|
||||
Case "ImageName"
|
||||
ImageFileName = xe.InnerText
|
||||
Case "HistoryImprints"
|
||||
HistoryImprints = LoadHistoryImprintsNode(xe.ChildNodes)
|
||||
Case Else
|
||||
Console.WriteLine($"LoadStationPacketFile Unknown NodeName:{xe.LocalName}")
|
||||
End Select
|
||||
Next
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 加载项目流程表格属性内容
|
||||
''' </summary>
|
||||
''' <param name="nodeList"></param>
|
||||
''' <param name="grdTestPlan"></param>
|
||||
Private Sub LoadGridProperties(nodeList As XmlNodeList, grdTestPlan As Grid)
|
||||
Dim xe As XmlElement
|
||||
For Each node As XmlNode In nodeList
|
||||
xe = CType(node, XmlElement)
|
||||
Select Case xe.LocalName
|
||||
Case "Rows"
|
||||
grdTestPlan.Rows = Integer.Parse(xe.InnerText) + 1
|
||||
Case "Cols"
|
||||
grdTestPlan.Cols = Integer.Parse(xe.InnerText) + 1
|
||||
End Select
|
||||
Next
|
||||
Return
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 加载项目流程表格单元格内容
|
||||
''' </summary>
|
||||
''' <param name="nodeList"></param>
|
||||
''' <param name="grdTestPlan"></param>
|
||||
Private Sub LoadGridCells(nodeList As XmlNodeList, grdTestPlan As Grid)
|
||||
Dim row, col As Integer
|
||||
Dim xe As XmlElement
|
||||
For Each node As XmlNode In nodeList
|
||||
xe = CType(node, XmlElement)
|
||||
Select Case xe.LocalName
|
||||
Case "Cells"
|
||||
row = CType(xe.GetAttribute($"Row"), Integer)
|
||||
col = CType(xe.GetAttribute($"Col"), Integer)
|
||||
grdTestPlan.Cell(row, col).Text = xe.InnerText
|
||||
End Select
|
||||
Next
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 加载项目流程文件
|
||||
''' </summary>
|
||||
''' <param name="stationPlanFilePath"></param>
|
||||
Private Sub LoadStationPlanFile(stationPlanFilePath As String)
|
||||
Dim xd As New XmlDocument()
|
||||
xd.Load(stationPlanFilePath)
|
||||
|
||||
Dim xe As XmlElement
|
||||
Dim nodeList As XmlNodeList = xd.SelectSingleNode($"FlexCell.NET").ChildNodes
|
||||
For Each node As XmlNode In nodeList
|
||||
xe = CType(node, XmlElement)
|
||||
Select Case xe.LocalName
|
||||
Case "GridProperties"
|
||||
LoadGridProperties(node.ChildNodes, StationPlan.StationPlanGrid)
|
||||
Case "Cells"
|
||||
LoadGridCells(node.ChildNodes, StationPlan.StationPlanGrid)
|
||||
End Select
|
||||
Next
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 加载项目站包时,校验路径
|
||||
''' </summary>
|
||||
''' <param name="packetPath"></param>
|
||||
Private Sub LoadCheckPath(packetPath As String)
|
||||
If String.IsNullOrEmpty(FileName) Then
|
||||
Throw New Exception($"未搜索到项目站 {ParentStation.Name} 的项目站包包名,请自行设计发布!")
|
||||
End If
|
||||
|
||||
If File.Exists(packetPath) = False Then
|
||||
Console.WriteLine($"UpdateStationInfo, {packetPath} File Not Exists")
|
||||
Throw New Exception($"未搜索到项目包 {packetPath},请自行设计发布!")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 加载项目站包时,解压项目文件到指定路径
|
||||
''' </summary>
|
||||
''' <param name="packetPath"></param>
|
||||
Private Sub LoadExtractFile(packetPath As String)
|
||||
Dim stationDesignDir As String = UtsPath.StationDesignDirPath()
|
||||
If Directory.Exists(stationDesignDir) = False Then Directory.CreateDirectory(stationDesignDir)
|
||||
Compress.Compress.TarExtractToDirectory(packetPath, stationDesignDir) '解压缩文件到指定路径
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 加载测试站包时,加载项目站包信息
|
||||
''' </summary>
|
||||
''' <param name="packetName"></param>
|
||||
Private Sub LoadFileUpdatePacketInfo(packetName As String)
|
||||
Dim packetInfoPath As String = $"{UtsPath.StationPacketInfoPath(packetName)}"
|
||||
LoadStationPacketInfoFile(packetInfoPath) '解析项目站信息内容
|
||||
|
||||
Dim stationPlanPath As String = $"{UtsPath.StationPacketTestPlanDirPath(packetName)}\Main.xml"
|
||||
LoadStationPlanFile(stationPlanPath) '解析项目站流程内容
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 加载测试站包内容
|
||||
''' </summary>
|
||||
Public Sub LoadPacket()
|
||||
Dim packetPath As String = UtsPath.StationPacketPath(ParentStation.ParentProject.Index, ParentStation.Index, FileName)
|
||||
|
||||
LoadCheckPath(packetPath)
|
||||
|
||||
LoadExtractFile(packetPath)
|
||||
|
||||
LoadFileUpdatePacketInfo(Name)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 保存项目站流程问文件
|
||||
''' </summary>
|
||||
''' <param name="path"></param>
|
||||
''' <param name="grdTestPlan"></param>
|
||||
Private Sub SaveStationPlanFile(path As String, grdTestPlan As Grid)
|
||||
Dim xws As New XmlWriterSettings
|
||||
With xws
|
||||
.Indent = True
|
||||
.NewLineOnAttributes = False
|
||||
.Encoding = New UTF8Encoding(False)
|
||||
End With
|
||||
|
||||
|
||||
|
||||
Using xw As XmlWriter = XmlWriter.Create(path, xws)
|
||||
xw.WriteStartDocument()
|
||||
xw.WriteStartElement($"FlexCell.NET") '创建跟节点
|
||||
|
||||
xw.WriteStartElement($"GridProperties") '创建表属性节点
|
||||
xw.WriteElementString("Rows", CType(grdTestPlan.Rows - 1, String))
|
||||
xw.WriteElementString("Cols", CType((grdTestPlan.Cols - 1), String))
|
||||
xw.WriteEndElement()
|
||||
|
||||
|
||||
xw.WriteStartElement($"Cells") '创建单元格节点
|
||||
For row As Integer = 0 To grdTestPlan.Rows - 1
|
||||
For col As Integer = 0 To grdTestPlan.Cols - 1
|
||||
xw.WriteStartElement($"Cells")
|
||||
xw.WriteAttributeString($"Row", CType(row, String))
|
||||
xw.WriteAttributeString($"Col", CType(col, String))
|
||||
xw.WriteString(grdTestPlan.Cell(row, col).Text)
|
||||
xw.WriteEndElement()
|
||||
Next
|
||||
Next
|
||||
xw.WriteEndElement()
|
||||
|
||||
xw.WriteEndElement()
|
||||
xw.WriteEndDocument()
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 保存项目站历史版本说明
|
||||
''' </summary>
|
||||
''' <param name="xw"></param>
|
||||
Private Sub SavePacketHistoryImprints(xw As XmlWriter)
|
||||
'写入当前版本信息
|
||||
xw.WriteStartElement($"HistoryImprint")
|
||||
xw.WriteAttributeString($"PacketName", CurrentImprint.FileName)
|
||||
xw.WriteAttributeString($"Creator", CurrentImprint.Creator)
|
||||
xw.WriteStartElement($"Imprints")
|
||||
For Each imprint As String In CurrentImprint.Imprints
|
||||
xw.WriteElementString("Imprint", imprint)
|
||||
Next
|
||||
xw.WriteEndElement()
|
||||
xw.WriteEndElement()
|
||||
|
||||
'写入历史版本信息
|
||||
For Each packetImprint As StationPacketImprint In HistoryImprints
|
||||
xw.WriteStartElement($"HistoryImprint")
|
||||
xw.WriteAttributeString($"PacketName", packetImprint.FileName)
|
||||
xw.WriteAttributeString($"Creator", packetImprint.Creator)
|
||||
|
||||
xw.WriteStartElement($"Imprints")
|
||||
For Each imprint As String In packetImprint.Imprints
|
||||
xw.WriteElementString("Imprint", imprint)
|
||||
Next
|
||||
xw.WriteEndElement()
|
||||
|
||||
xw.WriteEndElement()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 保存项目站信息节点内容
|
||||
''' </summary>
|
||||
''' <param name="xw"></param>
|
||||
Private Sub SavePacketInfoNode(xw As XmlWriter)
|
||||
xw.WriteElementString("AppVersion", AppVersion.ToString)
|
||||
xw.WriteElementString("CreateTime", $"{CreateTime:yyyy-MM-dd HH:mm:ss}")
|
||||
xw.WriteElementString("ModifiedTime", $"{ModifiedTime:yyyy-MM-dd HH:mm:ss}")
|
||||
xw.WriteElementString("PassWord", Aes128.EncryptStr(PassWord, Aes128.ServerAesKey))
|
||||
xw.WriteElementString("ValidDate", Aes128.EncryptStr(ValidDate.ToString("yyyy-MM-dd"), Aes128.ServerAesKey))
|
||||
xw.WriteElementString("StationVersion", StationVersion.ToString())
|
||||
xw.WriteElementString("ImageName", ImageFileName)
|
||||
|
||||
xw.WriteStartElement($"HistoryImprints")
|
||||
SavePacketHistoryImprints(xw)
|
||||
xw.WriteEndElement()
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 保存项目站包信息文件
|
||||
''' </summary>
|
||||
''' <param name="configPath"></param>
|
||||
Private Sub SavePacketInfoFile(configPath As String)
|
||||
Dim xws As New XmlWriterSettings
|
||||
With xws
|
||||
.Indent = True
|
||||
.NewLineOnAttributes = False
|
||||
.Encoding = New UTF8Encoding(False)
|
||||
End With
|
||||
Using xw As XmlWriter = XmlWriter.Create(configPath, xws)
|
||||
xw.WriteStartDocument()
|
||||
xw.WriteStartElement($"Configs") '创建跟节点
|
||||
xw.WriteStartElement($"StationInfo") '创建一级子节点
|
||||
|
||||
SavePacketInfoNode(xw)
|
||||
|
||||
xw.WriteEndElement()
|
||||
xw.WriteEndElement()
|
||||
xw.WriteEndDocument()
|
||||
'xw.Flush()
|
||||
'xw.Close()
|
||||
End Using
|
||||
|
||||
'Dim xw As XmlWriter = XmlWriter.Create(configPath, xws)
|
||||
'xw.WriteStartDocument()
|
||||
'xw.WriteStartElement($"Configs") '创建跟节点
|
||||
'xw.WriteStartElement($"StationInfo") '创建一级子节点
|
||||
|
||||
'SavePacketInfoNode(xw)
|
||||
|
||||
'xw.WriteEndElement()
|
||||
'xw.WriteEndElement()
|
||||
'xw.WriteEndDocument()
|
||||
'xw.Flush()
|
||||
'xw.Close()
|
||||
Return
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 发布项目成功时,新增一条项目站站发布记录
|
||||
''' 由于本地未下载站发布记录,则将命令添加至缓存待上传表中
|
||||
''' </summary>
|
||||
''' <param name="sqliteComm"></param>
|
||||
Private Sub InsertReleaseLogTable(sqliteComm As SQLiteCommand, packetFileName As String)
|
||||
Dim keyValue As New Dictionary(Of String, String) From {
|
||||
{ReleaseLogTable.ColNamesEnum.机型.ToString(), ParentStation.ParentProject.Index},
|
||||
{ReleaseLogTable.ColNamesEnum.栈位.ToString(), ParentStation.Index},
|
||||
{ReleaseLogTable.ColNamesEnum.最新包名.ToString(), packetFileName},
|
||||
{ReleaseLogTable.ColNamesEnum.更新者.ToString(), ParentStation.UserId},
|
||||
{ReleaseLogTable.ColNamesEnum.更新时间.ToString(), $"{ModifiedTime:yyyy-MM-dd HH:mm:ss}"}
|
||||
}
|
||||
Dim commandText As String = Executor.CommandHelper.Insert(ReleaseLogTable.TableName(ParentStation.ParentProject.Index), keyValue)
|
||||
'Executor.ExecuteNonQuery(sqliteComm, commandText)‘本地数据库没有该表,不执行数据表操作
|
||||
CacheTable.SaveCommandToCacheTable(sqliteComm, CacheTable.TableName, commandText) '记录到本地缓存表
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 发布项目成功时,更新项目站表对应项目站最新项目站包文件名
|
||||
''' </summary>
|
||||
''' <param name="sqliteComm"></param>
|
||||
''' <param name="packetFileName">项目站包文件名</param>
|
||||
Private Sub UpdateStationTable(sqliteComm As SQLiteCommand, packetFileName As String)
|
||||
Dim keyValue As New Dictionary(Of String, String) From {
|
||||
{StationTable.ColNamesEnum.测试版本包名.ToString(), packetFileName}
|
||||
}
|
||||
Dim condition As String = $"`{StationTable.ColNamesEnum.Index}` = '{ParentStation.Index}'"
|
||||
Dim commandText As String = Executor.CommandHelper.Update(StationTable.TableName(ParentStation.ParentProject.Index), keyValue, condition)
|
||||
Executor.ExecuteNonQuery(sqliteComm, commandText)
|
||||
|
||||
CacheTable.SaveCommandToCacheTable(sqliteComm, CacheTable.TableName, commandText) '记录到本地缓存表
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 发布项目时,校验路径合法性
|
||||
''' </summary>
|
||||
Private Sub ReleaseCheckPath()
|
||||
Dim releaseDirPath As String = UtsPath.StationReleaseDirPath
|
||||
If Directory.Exists(releaseDirPath) = False Then
|
||||
Throw New Exception($"未搜索到项目站包发布文件夹 {releaseDirPath}")
|
||||
End If
|
||||
|
||||
Dim designDirPath As String = UtsPath.StationDesignDirPath()
|
||||
If Directory.Exists(designDirPath) = False Then
|
||||
Throw New Exception($"未搜索到项目站包文件夹 {designDirPath}")
|
||||
End If
|
||||
|
||||
Directory.CreateDirectory(UtsPath.StationPacketResourceDirPath(Name))
|
||||
Directory.CreateDirectory(UtsPath.StationPacketTestPlanDirPath(Name))
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 发布项目时,将原项目包文件夹名重命名为预发布项目包文件夹名
|
||||
''' </summary>
|
||||
''' <param name="revPacketName">预发布项目站包名</param>
|
||||
Private Sub ReleaseRenamePacketDir(revPacketName As String)
|
||||
|
||||
Dim curPacketDirPath As String = UtsPath.StationPacketDirPath(Name)
|
||||
Dim revPacketDirPath As String = UtsPath.StationPacketDirPath(revPacketName)
|
||||
Directory.Move(curPacketDirPath, revPacketDirPath)
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 发布项目时,将缓存信息保存到本地文件中
|
||||
''' </summary>
|
||||
''' <param name="revPacketName">预发布项目站包名</param>
|
||||
Private Sub ReleaseSaveFile(revPacketName As String)
|
||||
Dim revPacketInfoPath As String = $"{UtsPath.StationPacketInfoPath(revPacketName)}"
|
||||
SavePacketInfoFile(revPacketInfoPath) '生成项目站包信息文件
|
||||
|
||||
Dim revStationPlanPath As String = $"{UtsPath.StationPacketTestPlanDirPath(revPacketName)}\Main.xml"
|
||||
SaveStationPlanFile(revStationPlanPath, StationPlan.StationPlanGrid) '生成项目站流程文件
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 发布项目时,压缩项目文件夹至发布路径
|
||||
''' </summary>
|
||||
''' <param name="revPacketName">预发布项目站包名</param>
|
||||
''' <param name="revFileName">预发布项目站包文件名</param>
|
||||
Private Sub ReleaseTarFile(revPacketName As String, revFileName As String)
|
||||
Dim tarFileList As New List(Of String)
|
||||
Dim revDirPath As String = UtsPath.StationPacketDirPath(revPacketName)
|
||||
Compress.Compress.FillFileList(tarFileList, revDirPath, revPacketName) '获取压缩文件列表
|
||||
|
||||
Dim revTarFilePath As String = $"{UtsPath.StationDesignDirPath}\{revFileName}"
|
||||
Compress.Compress.TarFiles(tarFileList, revTarFilePath, UtsPath.StationDesignDirPath) '压缩到临时文件夹
|
||||
|
||||
Dim revFilePath As String = $"{UtsPath.StationPacketPath(ParentStation.ParentProject.Index, ParentStation.Index, revFileName)}"
|
||||
If File.Exists(revFilePath) Then File.Delete(revFilePath)
|
||||
File.Move(revTarFilePath, revFilePath) '压缩文件成功后,从临时文件夹移动到发布文件夹
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 发布项目成功后,更新数据库数据
|
||||
''' </summary>
|
||||
''' <param name="revFileName"></param>
|
||||
Private Sub ReleaseUpdateDatabase(revFileName As String)
|
||||
|
||||
Dim connectString As String = CommandHelpers.ConnectionString(ConnectionParams.Path, ConnectionParams.Password)
|
||||
Using sqliteConn As New SQLiteConnection(connectString)
|
||||
sqliteConn.Open()
|
||||
Using sqliteComm As SQLiteCommand = sqliteConn.CreateCommand()
|
||||
InsertReleaseLogTable(sqliteComm, revFileName) '更新数据库,项目站发布记录表,新增发布记录
|
||||
|
||||
UpdateStationTable(sqliteComm, revFileName) '更新数据库,测试站表,最新包名
|
||||
End Using
|
||||
sqliteConn.Close()
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 发布项目成功后,更新项目包信息
|
||||
''' </summary>
|
||||
''' <param name="revFileName"></param>
|
||||
Private Sub ReleaseUpdatePacketInfo(revFileName As String)
|
||||
FileName = revFileName
|
||||
HistoryImprints.Insert(0, CurrentImprint)
|
||||
CurrentImprint = New StationPacketImprint()
|
||||
End Sub
|
||||
|
||||
Private Function NewPacketName() As String
|
||||
Return $"TP_{ParentStation.ParentProject.Index}_{ParentStation.Index}_REV_{StationVersion.ToString.PadLeft(2, "0"c)}_{ModifiedTime:yyyyMMddHHmmss}"
|
||||
End Function
|
||||
|
||||
Private Function NewPacketFileName() As String
|
||||
Return $"{NewPacketName()}.uts"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 发布项目站包
|
||||
''' </summary>
|
||||
Public Sub ReleasePacket()
|
||||
ReleaseCheckPath()
|
||||
|
||||
Dim revPacketName As String = NewPacketName()
|
||||
Dim revFileName As String = $"{revPacketName}.uts"
|
||||
|
||||
CurrentImprint.Creator = ParentStation.UserId
|
||||
CurrentImprint.FileName = revFileName
|
||||
|
||||
ReleaseRenamePacketDir(revPacketName)
|
||||
|
||||
ReleaseSaveFile(revPacketName)
|
||||
|
||||
ReleaseTarFile(revPacketName, revFileName)
|
||||
|
||||
ReleaseUpdateDatabase(revFileName)
|
||||
|
||||
ReleaseUpdatePacketInfo(revFileName)
|
||||
|
||||
GC.Collect()'回收资源
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
37
UTS_Core/UTSModule/Project/ProjectStationPlan.vb
Normal file
37
UTS_Core/UTSModule/Project/ProjectStationPlan.vb
Normal file
@@ -0,0 +1,37 @@
|
||||
Imports FlexCell
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class ProjectStationPlan
|
||||
Sub New()
|
||||
TestPlanLocked = False
|
||||
’Version = New Version(1, 0)
|
||||
StationPlanGrid = New Grid()
|
||||
Project.StationPlanGrid.InitGrid(StationPlanGrid)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub New(packet As ProjectStationPacket)
|
||||
TestPlanLocked = False
|
||||
‘ Version = New Version(1, 0)
|
||||
|
||||
ParentPacket = packet
|
||||
StationPlanGrid = New Grid()
|
||||
Project.StationPlanGrid.InitGrid(StationPlanGrid)
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>测试流程是否已锁定</summary>
|
||||
Public Property TestPlanLocked As Boolean
|
||||
|
||||
'''' <summary>测试流程版本</summary>
|
||||
'Public Property Version As Version
|
||||
|
||||
''' <summary>测试流程表格</summary>
|
||||
Public Property StationPlanGrid() As Grid
|
||||
|
||||
''' <summary>测试流程所关联的项目站包信息</summary>
|
||||
Public Property ParentPacket() As ProjectStationPacket
|
||||
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
87
UTS_Core/UTSModule/Project/SingleRowGrid.vb
Normal file
87
UTS_Core/UTSModule/Project/SingleRowGrid.vb
Normal file
@@ -0,0 +1,87 @@
|
||||
Imports System.Drawing
|
||||
Imports FlexCell
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class SingleRowGrid
|
||||
Public Enum ColNameEnum
|
||||
Sn
|
||||
ColName
|
||||
ColValue
|
||||
Max
|
||||
End Enum
|
||||
|
||||
Public Enum RowNameEnum
|
||||
ColName
|
||||
[Step]
|
||||
[Label]
|
||||
Action
|
||||
Command
|
||||
Description
|
||||
Parameter1
|
||||
Parameter2
|
||||
Parameter3
|
||||
Parameter4
|
||||
Parameter5
|
||||
Parameter6
|
||||
Retry
|
||||
RetryInterval
|
||||
Record
|
||||
RecordName
|
||||
PassGoto
|
||||
FailGoto
|
||||
ErrorCode
|
||||
ErrorMessage
|
||||
Help
|
||||
Max
|
||||
End Enum
|
||||
|
||||
''' <summary>
|
||||
''' 初始化测试站表格
|
||||
''' </summary>
|
||||
''' <param name="grd">表格控件</param>
|
||||
Public Shared Sub InitGrid(grd As FlexCell.Grid, Optional commands As String() = Nothing)
|
||||
With grd
|
||||
.AutoRedraw = False
|
||||
|
||||
.NewFile() '清空表格格式
|
||||
|
||||
.Rows = StationPlanGrid.ColNameEnum.Max + 1
|
||||
.Cols = ColNameEnum.Max
|
||||
|
||||
.DisplayRowNumber = True '首列显示数字
|
||||
.ExtendLastCol = True '最后一列自动扩充
|
||||
.MultiSelect = False '是否允许选择多行
|
||||
'.BackColorFixed = Color.FromArgb(255, 227, 228, 225)
|
||||
'.BackColorFixedSel = Color.FromArgb(255, 201, 226, 244)
|
||||
'.BackColorBkg = Color.FromArgb(255, 248, 232, 226)
|
||||
'.BackColor1 = Color.FromArgb(255, 225, 246, 236)
|
||||
'.BackColor2 = Color.FromArgb(255, 247, 247, 228)
|
||||
' .GridColor = Color.FromArgb(255, 148, 190, 231)
|
||||
.BorderStyle = FlexCell.BorderStyleEnum.None
|
||||
.DefaultFont = New Font("微软雅黑", 8)
|
||||
.Range(0, 0, 0, .Cols - 1).Font = New Font($"幼圆", 8) '首行样式
|
||||
|
||||
|
||||
For col As Integer = 0 To ColNameEnum.Max - 1
|
||||
.Cell(0, col).Text = [Enum].GetName(GetType(ColNameEnum), col) '设置列名
|
||||
Next
|
||||
|
||||
For i As Integer = 0 To RowNameEnum.Max - 1
|
||||
.Cell(i, ColNameEnum.ColName).Text = [Enum].GetName(GetType(RowNameEnum), i) '填充行内容
|
||||
Next
|
||||
|
||||
.Column(ColNameEnum.ColName).Locked = True
|
||||
|
||||
.Cell(RowNameEnum.Step, ColNameEnum.ColValue).Locked = True
|
||||
|
||||
.Cell(RowNameEnum.Command, ColNameEnum.ColValue).CellType = CellTypeEnum.ComboBox
|
||||
|
||||
.Cell(RowNameEnum.Action, ColNameEnum.ColValue).CellType = CellTypeEnum.CheckBox
|
||||
.Cell(RowNameEnum.Record, ColNameEnum.ColValue).CellType = CellTypeEnum.CheckBox
|
||||
|
||||
.AutoRedraw = True
|
||||
.Refresh()
|
||||
End With
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
42
UTS_Core/UTSModule/Project/StationPacketImprint.vb
Normal file
42
UTS_Core/UTSModule/Project/StationPacketImprint.vb
Normal file
@@ -0,0 +1,42 @@
|
||||
Imports System.Text
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class StationPacketImprint
|
||||
Sub New()
|
||||
|
||||
Imprints = New List(Of String)()
|
||||
End Sub
|
||||
|
||||
Sub New(imprintString As String)
|
||||
imprintString = imprintString.Replace(Chr(13), Chr(0))
|
||||
Imprints = imprintString.Split(Chr(10)).ToList()
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 项目站包文件名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property FileName() As String
|
||||
|
||||
''' <summary>
|
||||
''' 项目站包创建者
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Creator() As String
|
||||
|
||||
''' <summary>
|
||||
''' 项目站包版本说明
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Imprints() As List(Of String)
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Dim strReturn As New StringBuilder
|
||||
For Each imprint As String In Imprints
|
||||
strReturn.Append($"{imprint}{vbNewLine}")
|
||||
Next
|
||||
Return strReturn.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
212
UTS_Core/UTSModule/Project/StationPlanCommandHelper.vb
Normal file
212
UTS_Core/UTSModule/Project/StationPlanCommandHelper.vb
Normal file
@@ -0,0 +1,212 @@
|
||||
Imports System.Data.SQLite
|
||||
Imports UTS_Core.Database.Sqlite
|
||||
Imports UTS_Core.UTSModule.DatabaseTable
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class StationPlanCommandHelper
|
||||
Sub New()
|
||||
Params = New List(Of Station.CommandParam)()
|
||||
End Sub
|
||||
|
||||
|
||||
Public Property CommandIndex() As String
|
||||
|
||||
Public Property CommandType() As String
|
||||
|
||||
Public Property CommandName() As String
|
||||
|
||||
Public Property CommandDesc() As String
|
||||
|
||||
Public Property Retry() As String
|
||||
|
||||
Public Property RetryInterval() As String
|
||||
|
||||
Public Property Record() As String
|
||||
|
||||
Public Property RecordName() As String
|
||||
|
||||
Public Property PassGoto() As String
|
||||
|
||||
Public Property FailGoto() As String
|
||||
|
||||
Public Property ErrorCode() As String
|
||||
|
||||
Public Property ErrorMessage() As String
|
||||
|
||||
Public Property Help() As String
|
||||
|
||||
Public Property Params() As List(Of Station.CommandParam)
|
||||
|
||||
Private Shared Function SearchCommand(path As String, password As String) As DataTable
|
||||
Dim connectString As String = CommandHelpers.ConnectionString(path, password)
|
||||
Using sqliteConn As New SQLiteConnection(connectString)
|
||||
sqliteConn.Open()
|
||||
Dim tableName As String = CommandHelperTable.TableName
|
||||
Dim colNames As New List(Of String)
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ID.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.CommandIndex.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.CommandType.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.CommandName.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.CommandDesc.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.Retry.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.RetryInterval.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.Record.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.RecordName.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.PassGoto.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.FailGoto.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ErrorCode.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ErrorMessage.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.Help.ToString())
|
||||
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamDesc1.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamType1.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamLower1.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamUpper1.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamValue1.ToString())
|
||||
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamDesc2.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamType2.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamLower2.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamUpper2.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamValue2.ToString())
|
||||
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamDesc3.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamType3.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamLower3.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamUpper3.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamValue3.ToString())
|
||||
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamDesc4.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamType4.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamLower4.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamUpper4.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamValue4.ToString())
|
||||
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamDesc5.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamType5.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamLower5.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamUpper5.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamValue5.ToString())
|
||||
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamDesc6.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamType6.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamLower6.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamUpper6.ToString())
|
||||
colNames.Add(CommandHelperTable.ColNamesEnum.ParamValue6.ToString())
|
||||
|
||||
Return Executor.Search(sqliteConn, tableName, colNames)
|
||||
sqliteConn.Close()
|
||||
End Using
|
||||
End Function
|
||||
|
||||
Public Function InitCommandHelper(dtRow As DataRow) As Boolean
|
||||
CommandIndex = dtRow.Item(CommandHelperTable.ColNamesEnum.CommandIndex).ToString()
|
||||
CommandType = dtRow.Item(CommandHelperTable.ColNamesEnum.CommandType).ToString()
|
||||
CommandName = dtRow.Item(CommandHelperTable.ColNamesEnum.CommandName).ToString()
|
||||
CommandDesc = dtRow.Item(CommandHelperTable.ColNamesEnum.CommandDesc).ToString()
|
||||
|
||||
Retry = dtRow.Item(CommandHelperTable.ColNamesEnum.Retry).ToString()
|
||||
RetryInterval = dtRow.Item(CommandHelperTable.ColNamesEnum.RetryInterval).ToString()
|
||||
Record = dtRow.Item(CommandHelperTable.ColNamesEnum.Record).ToString()
|
||||
RecordName = dtRow.Item(CommandHelperTable.ColNamesEnum.RecordName).ToString()
|
||||
PassGoto = dtRow.Item(CommandHelperTable.ColNamesEnum.PassGoto).ToString()
|
||||
FailGoto = dtRow.Item(CommandHelperTable.ColNamesEnum.FailGoto).ToString()
|
||||
ErrorCode = dtRow.Item(CommandHelperTable.ColNamesEnum.ErrorCode).ToString()
|
||||
ErrorMessage = dtRow.Item(CommandHelperTable.ColNamesEnum.ErrorMessage).ToString()
|
||||
Help = dtRow.Item(CommandHelperTable.ColNamesEnum.Help).ToString()
|
||||
|
||||
Params.Clear()
|
||||
|
||||
Dim param As New Station.CommandParam
|
||||
param.Desc = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamDesc1).ToString()
|
||||
param.Type = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamType1).ToString()
|
||||
param.LowerLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamLower1).ToString()
|
||||
param.UpperLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamUpper1).ToString()
|
||||
param.Value = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamValue1).ToString()
|
||||
|
||||
if String.IsNullOrEmpty(param.Desc) Then param.Desc = "未使用"
|
||||
Params.Add(param)
|
||||
|
||||
Dim param2 As New Station.CommandParam
|
||||
param2.Desc = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamDesc2).ToString()
|
||||
param2.Type = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamType2).ToString()
|
||||
param2.LowerLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamLower2).ToString()
|
||||
param2.UpperLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamUpper2).ToString()
|
||||
param2.Value = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamValue2).ToString()
|
||||
|
||||
if String.IsNullOrEmpty(param2.Desc) Then param2.Desc = "未使用"
|
||||
Params.Add(param2)
|
||||
|
||||
Dim param3 As New Station.CommandParam
|
||||
param3.Desc = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamDesc3).ToString()
|
||||
param3.Type = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamType3).ToString()
|
||||
param3.LowerLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamLower3).ToString()
|
||||
param3.UpperLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamUpper3).ToString()
|
||||
param3.Value = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamValue3).ToString()
|
||||
|
||||
if String.IsNullOrEmpty(param3.Desc) Then param3.Desc = "未使用"
|
||||
Params.Add(param3)
|
||||
|
||||
Dim param4 As New Station.CommandParam
|
||||
param4.Desc = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamDesc4).ToString()
|
||||
param4.Type = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamType4).ToString()
|
||||
param4.LowerLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamLower5).ToString()
|
||||
param4.UpperLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamUpper5).ToString()
|
||||
param4.Value = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamValue5).ToString()
|
||||
|
||||
if String.IsNullOrEmpty(param4.Desc) Then param4.Desc = "未使用"
|
||||
Params.Add(param4)
|
||||
|
||||
Dim param5 As New Station.CommandParam
|
||||
param5.Desc = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamDesc5).ToString()
|
||||
param5.Type = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamType5).ToString()
|
||||
param5.LowerLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamLower5).ToString()
|
||||
param5.UpperLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamUpper5).ToString()
|
||||
param5.Value = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamValue5).ToString()
|
||||
|
||||
if String.IsNullOrEmpty(param5.Desc) Then param5.Desc = "未使用"
|
||||
Params.Add(param5)
|
||||
|
||||
Dim param6 As New Station.CommandParam
|
||||
param6.Desc = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamDesc6).ToString()
|
||||
param6.Type = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamType6).ToString()
|
||||
param6.LowerLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamLower6).ToString()
|
||||
param6.UpperLimit = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamUpper6).ToString()
|
||||
param6.Value = dtRow.Item(CommandHelperTable.ColNamesEnum.ParamValue6).ToString()
|
||||
|
||||
if String.IsNullOrEmpty(param6.Desc) Then param6.Desc = "未使用"
|
||||
Params.Add(param6)
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Shared Function InitCommandHelper(dtCommand As DataTable) As Dictionary(Of String, StationPlanCommandHelper)
|
||||
Dim dicCommandHelpers As New Dictionary(Of String, StationPlanCommandHelper)
|
||||
|
||||
For row As Integer = 0 To dtCommand.Rows.Count - 1
|
||||
Dim commandHelper As New StationPlanCommandHelper
|
||||
commandHelper.InitCommandHelper(dtCommand.Rows(row))
|
||||
|
||||
dicCommandHelpers.Add(commandHelper.CommandIndex, commandHelper)
|
||||
Next
|
||||
|
||||
Return dicCommandHelpers
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 初始化流程站帮助信息
|
||||
''' 从本地数据库中读取
|
||||
''' </summary>
|
||||
''' <param name="path">本地数据库路径</param>
|
||||
''' <param name="password">本地数据库密码</param>
|
||||
''' <returns>初始化是否成功</returns>
|
||||
Public Shared Function InitCommandHelper(path As String, password As String) As Dictionary(Of String, StationPlanCommandHelper)
|
||||
'查询数据表
|
||||
Dim dtCommand As DataTable = SearchCommand(path, password)
|
||||
|
||||
'赋值
|
||||
Return InitCommandHelper(dtCommand)
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
199
UTS_Core/UTSModule/Project/StationPlanGrid.vb
Normal file
199
UTS_Core/UTSModule/Project/StationPlanGrid.vb
Normal file
@@ -0,0 +1,199 @@
|
||||
Imports System.Drawing
|
||||
Imports FlexCell
|
||||
|
||||
Namespace UTSModule.Project
|
||||
Public Class StationPlanGrid
|
||||
''' <summary>
|
||||
''' 表格各列名称对应下表
|
||||
''' </summary>
|
||||
Enum ColNameEnum
|
||||
[Step]
|
||||
[Label]
|
||||
Action
|
||||
Command
|
||||
Description
|
||||
Parameter1
|
||||
Parameter2
|
||||
Parameter3
|
||||
Parameter4
|
||||
Parameter5
|
||||
Parameter6
|
||||
Retry
|
||||
RetryInterval
|
||||
Record
|
||||
RecordName
|
||||
PassGoto
|
||||
FailGoto
|
||||
ErrorCode
|
||||
ErrorMessage
|
||||
Help
|
||||
Max
|
||||
End Enum
|
||||
|
||||
''' <summary>
|
||||
''' 测试表格中的列名
|
||||
''' </summary>
|
||||
Public Shared Name() As String = {"Step",
|
||||
"Label",
|
||||
"Action",
|
||||
"Command",
|
||||
"Description ",
|
||||
"Parameter_1",
|
||||
"Parameter_2",
|
||||
"Parameter_3",
|
||||
"Parameter_4",
|
||||
"Parameter_5",
|
||||
"Parameter_6",
|
||||
"Retry",
|
||||
"RetryInterval",
|
||||
"Record",
|
||||
"RecordName",
|
||||
"Pass Goto",
|
||||
"Fail Goto",
|
||||
"Error Code",
|
||||
"Error Message",
|
||||
"Help"}
|
||||
|
||||
''' <summary>
|
||||
''' 测试表每列默认宽度
|
||||
''' </summary>
|
||||
Public Shared Width() As Integer = {30,
|
||||
50,
|
||||
50,
|
||||
120,
|
||||
80,
|
||||
100,
|
||||
80,
|
||||
80,
|
||||
80,
|
||||
80,
|
||||
80,
|
||||
80,
|
||||
80,
|
||||
50,
|
||||
50,
|
||||
60,
|
||||
60,
|
||||
80,
|
||||
100,
|
||||
50}
|
||||
|
||||
''' <summary>
|
||||
''' 站测试表每列默认类型
|
||||
''' </summary>
|
||||
Public Shared Type() As CellTypeEnum = {CellTypeEnum.DefaultType,
|
||||
CellTypeEnum.DefaultType,
|
||||
CellTypeEnum.CheckBox,
|
||||
CellTypeEnum.ComboBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.CheckBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox,
|
||||
CellTypeEnum.TextBox
|
||||
}
|
||||
|
||||
''' <summary>
|
||||
''' 站测试表每列默认字体名称
|
||||
''' </summary>
|
||||
Public Shared FontName() As String = {$"Calibri", $"微软雅黑", $"Calibri", $"Consolas", $"微软雅黑",
|
||||
$"微软雅黑", $"微软雅黑", $"微软雅黑", $"微软雅黑", $"微软雅黑", $"微软雅黑",
|
||||
$"Calibri", $"Calibri", $"Consolas", $"Consolas", $"Consolas", $"Consolas",
|
||||
$"Calibri", $"微软雅黑", $"微软雅黑"}
|
||||
|
||||
''' <summary>
|
||||
''' 站测试表每列默认字体颜色
|
||||
''' </summary>
|
||||
Public Shared ForeColor() As Color = {Color.Black, Color.Black, Color.Black,
|
||||
Color.FromArgb(255, 0, 0, 255), Color.FromArgb(255, 0, 128, 0),
|
||||
Color.FromArgb(255, 0, 128, 128), Color.FromArgb(255, 0, 128, 128),
|
||||
Color.FromArgb(255, 0, 128, 128), Color.FromArgb(255, 0, 128, 128),
|
||||
Color.FromArgb(255, 0, 128, 128), Color.FromArgb(255, 0, 128, 128),
|
||||
Color.FromArgb(255, 128, 128, 128), Color.FromArgb(255, 128, 128, 128),
|
||||
Color.FromArgb(255, 0, 0, 128), Color.FromArgb(255, 0, 0, 128),
|
||||
Color.FromArgb(255, 0, 128, 0), Color.FromArgb(255, 255, 0, 0),
|
||||
Color.FromArgb(255, 128, 128, 128), Color.FromArgb(255, 128, 128, 128),
|
||||
Color.FromArgb(255, 128, 128, 0)}
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 初始化站测试表格
|
||||
''' </summary>
|
||||
''' <param name="grdStationTest"></param>
|
||||
Public Shared Sub InitGrid(grdStationTest As Grid, Optional commands As String() = Nothing)
|
||||
If grdStationTest Is Nothing Then
|
||||
grdStationTest = New Grid()
|
||||
Else
|
||||
grdStationTest.NewFile() '清空表格格式
|
||||
End If
|
||||
|
||||
With grdStationTest
|
||||
.Rows = 100
|
||||
.Cols = ColNameEnum.Max
|
||||
|
||||
.AutoRedraw = False
|
||||
.BorderStyle = BorderStyleEnum.None
|
||||
.DisplayRowNumber = True '首列显示数字
|
||||
.ExtendLastCol = True '最后一列自动扩充
|
||||
'.BackColorFixed = Color.FromArgb(255, 227, 228, 225)
|
||||
'.BackColorFixedSel = Color.FromArgb(255, 201, 226, 244)
|
||||
'.BackColorBkg = Color.FromArgb(255, 248, 232, 226)
|
||||
'.BackColor1 = Color.FromArgb(255, 225, 246, 236)
|
||||
'.BackColor2 = Color.FromArgb(255, 247, 247, 228)
|
||||
'.GridColor = Color.FromArgb(255, 148, 190, 231)
|
||||
.DefaultFont = New Font("微软雅黑", 8)
|
||||
.Range(0, 0, 0, .Cols - 1).Font = New Font($"幼圆", 8)
|
||||
For i As Integer = 0 To Name.Length - 1
|
||||
.Cell(0, i).Text = Name(i) '设置列名
|
||||
.Column(i).Width = CShort(Width(i)) '设置列宽
|
||||
.Column(i).CellType = Type(i) '设置列型
|
||||
.Range(1, i, .Rows - 1, i).Font = New Font(FontName(i), 8)
|
||||
.Range(1, i, .Rows - 1, i).ForeColor = ForeColor(i)
|
||||
Next
|
||||
|
||||
.ComboBox(ColNameEnum.Command).Items.Clear()
|
||||
If commands IsNot Nothing Then
|
||||
.ComboBox(ColNameEnum.Command).Items.AddRange(commands)
|
||||
End If
|
||||
.ComboBox(ColNameEnum.Command).Locked = False '只允许选择下拉框内容,不允许修改
|
||||
|
||||
.Cell(1, ColNameEnum.Label).Text = "Setup"
|
||||
.Cell(3, ColNameEnum.Label).Text = "End Setup"
|
||||
|
||||
.Cell(5, ColNameEnum.Label).Text = "Main"
|
||||
.Cell(7, ColNameEnum.Label).Text = "End Main"
|
||||
|
||||
|
||||
.Cell(9, ColNameEnum.Label).Text = "Pass"
|
||||
.Cell(11, ColNameEnum.Label).Text = "End Pass"
|
||||
|
||||
.Cell(13, ColNameEnum.Label).Text = "Fail"
|
||||
.Cell(15, ColNameEnum.Label).Text = "End Fail"
|
||||
|
||||
.Cell(17, ColNameEnum.Label).Text = "Finally"
|
||||
.Cell(19, ColNameEnum.Label).Text = "End Finally"
|
||||
|
||||
|
||||
For i As Integer = 1 To grdStationTest.Rows - 1
|
||||
If String.IsNullOrEmpty(.Cell(i, ColNameEnum.Label).Text) = False Then
|
||||
.Cell(i, ColNameEnum.Label).FontBold = True
|
||||
End If
|
||||
Next
|
||||
|
||||
.AutoRedraw = True
|
||||
.Refresh()
|
||||
End With
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user