| | |
| | | return false; |
| | | } |
| | | } |
| | | public bool WriteOutStoreTaskInfo(string stationCode, string sourcePlaceNo, out string msg, int outbound_TaskID) |
| | | public bool WriteOutStoreTaskInfo(bool isResetData, string stationCode, string sourcePlaceNo, out string msg, int outbound_TaskID) |
| | | { |
| | | try |
| | | { |
| | |
| | | var stationObj = this.DBBlockForWrite.W_StationForWriteCommList.Where(x => x.StationCode == stationCode).FirstOrDefault(); |
| | | |
| | | var view_stationObj = this.View.W_StationForWriteCommList.Where(x => x.StationCode == stationCode).FirstOrDefault(); |
| | | MessageModel b2 = this.plcService.WriteValuePoint(stationObj.W_Outbound_TaskID, outbound_TaskID, view_stationObj.W_Outbound_TaskID); |
| | | if (!b2.result) |
| | | if (isResetData == false) |
| | | { |
| | | msg = string.Format("向Station地址{0} 写 出库任务号 " + outbound_TaskID + "失败,返回结果:" + b2.resMsg, |
| | | stationObj.W_Outbound_TaskID); |
| | | return false; |
| | | MessageModel b2 = this.plcService.WriteValuePoint(stationObj.W_Outbound_TaskID, outbound_TaskID, view_stationObj.W_Outbound_TaskID); |
| | | if (!b2.result) |
| | | { |
| | | msg = string.Format("向Station地址{0} 写 出库任务号 " + outbound_TaskID + "失败,返回结果:" + b2.resMsg, |
| | | stationObj.W_Outbound_TaskID); |
| | | return false; |
| | | } |
| | | |
| | | b2 = this.plcService.WriteValuePoint(stationObj.W_Destination_Out, Convert.ToInt32(sourcePlaceNo), view_stationObj.W_Destination_Out); |
| | | if (!b2.result) |
| | | { |
| | | msg = string.Format("向Station地址{0} 写 库位号 " + sourcePlaceNo + "失败,返回结果:" + b2.resMsg, |
| | | stationObj.W_Destination_Out); |
| | | return false; |
| | | } |
| | | |
| | | b2 = this.plcService.WriteValuePoint(stationObj.W_ReqOut, true, view_stationObj.W_ReqOut); |
| | | if (!b2.result) |
| | | { |
| | | msg = string.Format("向Station地址{0} 写 请求出库 " + true + "失败,返回结果:" + b2.resMsg, |
| | | stationObj.W_ReqOut); |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | MessageModel b2 = null; |
| | | b2 = this.plcService.WriteValuePoint(stationObj.W_ReqOut, false, view_stationObj.W_ReqOut); |
| | | if (!b2.result) |
| | | { |
| | | msg = string.Format("向Station地址{0} 写 请求出库 " + false + "失败,返回结果:" + b2.resMsg, |
| | | stationObj.W_ReqOut); |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | b2 = this.plcService.WriteValuePoint(stationObj.W_Destination_Out, Convert.ToInt32(sourcePlaceNo), view_stationObj.W_Destination_Out); |
| | | if (!b2.result) |
| | | { |
| | | msg = string.Format("向Station地址{0} 写 库位号 " + sourcePlaceNo + "失败,返回结果:" + b2.resMsg, |
| | | stationObj.W_Destination_Out); |
| | | return false; |
| | | } |
| | | |
| | | b2 = this.plcService.WriteValuePoint(stationObj.W_ReqOut, true, view_stationObj.W_ReqOut); |
| | | if (!b2.result) |
| | | { |
| | | msg = string.Format("向Station地址{0} 写 请求出库 " + true + "失败,返回结果:" + b2.resMsg, |
| | | stationObj.W_ReqOut); |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | catch (Exception ex) |
| | | { |