public LpnInformation LoadLPNInformation(string lpn) { using (var reader = dataManager.pipeReader(LoadLpnInformationQuery, lpn)) { if (!reader.Read()) { return(null); } var result = new LpnInformation { OrderNumber = reader["ORDERNUMBER"].ToString(), ItemNumber = reader["ITEMNUMBER"].ToString(), ActualLocation = reader["ACTUAL_LOC"] == DBNull.Value ? null : reader["ACTUAL_LOC"].ToString(), ActionCode = reader["LASTACTIONCODE"] == DBNull.Value ? null : (int?)int.Parse(reader["LASTACTIONCODE"].ToString()), Sku = reader["SKU"] == DBNull.Value ? null : reader["SKU"].ToString() }; if (reader.Read()) { throw new InvalidOperationException("More than 1 row returned by LoadLpnInformationQuery"); } return(result); } }
private bool ValidateLPN(LpnInformation lpnInformation) { if (lpnInformation == null) { ShowError("LPN not found"); return(false); } if (lpnInformation.ActionCode != 30) { ShowError("LPN not suitable for putaway"); return(false); } if (!string.IsNullOrEmpty(lpnInformation.ActualLocation)) { ShowError("LPN already putaway in<br />" + lpnInformation.ActualLocation); return(false); } return(true); }