| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Runtime.InteropServices.WindowsRuntime; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Web.UI.WebControls; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical.Utils |
| | | { |
| | |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 校验读取的二维码是否正确 |
| | | /// </summary> |
| | | /// <param name="workPieceID"></param> |
| | | /// <returns></returns> |
| | | public static bool ValidateIsRightWorkPieceID(string workPieceID) |
| | | { |
| | | if (string.IsNullOrEmpty(workPieceID)) |
| | | { |
| | | return false; |
| | | } |
| | | if (workPieceID.Length == 22) |
| | | { |
| | | var n_workPieceID = workPieceID.Trim(); |
| | | if (n_workPieceID.Length == 22) |
| | | { |
| | | if (n_workPieceID.IndexOf("ERROR") > -1) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置 WorkPieceInfo 的DataCapturePointCname |
| | | /// </summary> |
| | | /// <param name="workPieceLog"></param> |
| | | /// <param name="_DataCapturePointCode"></param> |
| | | /// <param name="_DataCapturePointName"></param> |
| | | public static void SetWorkPieceInfoMiddleForCreatedUserName(ref WorkPieceInfo workPiece, string _DataCapturePointName) |
| | | { |
| | | workPiece.DataCapturePointCname = _DataCapturePointName; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置 WorkPieceInfo 的UpdateDataCapturePointCname |
| | | /// </summary> |
| | | /// <param name="workPieceLog"></param> |
| | | /// <param name="_DataCapturePointCode"></param> |
| | | /// <param name="_DataCapturePointName"></param> |
| | | public static void SetWorkPieceInfoMiddleForUpdateDataCapturePointCname(ref WorkPieceInfo workPiece, string _DataCapturePointName) |
| | | { |
| | | workPiece.UpdateDataCapturePointCname = _DataCapturePointName; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置WorkPieceLog 的创建人 |
| | | /// </summary> |
| | | /// <param name="workPieceLog"></param> |
| | | /// <param name="_DataCapturePointCode"></param> |
| | | /// <param name="_DataCapturePointName"></param> |
| | | public static void SetWorkPieceLogMiddleForCreatedUserName(ref WorkPieceLogMiddle workPieceLog, string _DataCapturePointCode, string _DataCapturePointName) |
| | | { |
| | | workPieceLog.CreatedUserName = _DataCapturePointCode; |
| | | workPieceLog.DataCapturePointCname = _DataCapturePointName; |
| | | } |
| | | /// <summary> |
| | | /// 设置WorkPieceLog 的创建人 |
| | | /// </summary> |
| | | /// <param name="workPieceLog"></param> |
| | | /// <param name="_DataCapturePointCode"></param> |
| | | /// <param name="_DataCapturePointName"></param> |
| | | public static void SetWorkPieceLogMiddleForCreatedUserName(ref WorkPieceLog workPieceLog, string _DataCapturePointCode, string _DataCapturePointName) |
| | | { |
| | | workPieceLog.CreatedUserName = _DataCapturePointCode; |
| | | workPieceLog.DataCapturePointCname = _DataCapturePointName; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置WorkPieceLog 的更新人 |
| | | /// </summary> |
| | | /// <param name="workPieceLog"></param> |
| | | /// <param name="_DataCapturePointCode"></param> |
| | | /// <param name="_DataCapturePointName"></param> |
| | | public static void SetWorkPieceLogMiddleForUpdatedUserName(ref WorkPieceLogMiddle workPieceLog, string _DataCapturePointCode, string _DataCapturePointName) |
| | | { |
| | | workPieceLog.UpdatedUserName = _DataCapturePointCode; |
| | | workPieceLog.UpdateDataCapturePointCname = _DataCapturePointName; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 是否允许修改WorkPieceState 为WIP |
| | | /// </summary> |
| | | /// <param name="info"></param> |