/// <summary> /// Determines if the workId is null or whitespace and if the value /// provided is a number that has been used for another work order. /// </summary> /// <param name="workId">The work order indentification number.</param> /// <param name="message"> /// If the work order is not found, this value will be an error message /// indicating that the work order was not found. If the work order was /// found, this value will be null. /// </param> /// <returns></returns> public bool ValidWorkOrder(string workId, out string message) { if (string.IsNullOrWhiteSpace(workId)) { message = Messages.WorkOrderCannotBeNullOrEmpty(); return(false); } try { var workIdFound = ShopfloorWorkOrderDb.WorkIdExists(workId); if (workIdFound) { message = null; } else { message = Messages.WorkOrderDoesNotExist(workId); } return(workIdFound); } catch (Exception ex) { Messages.GeneralExceptionMessage(ex, "DataValidator.ValidWorkOrder()"); message = ""; return(false); } }
/// <summary> /// Load the part number and revision for a particular work order. /// </summary> public void Load() { ShopfloorWorkOrderDb.GetWorkOrderInfo(this); }