public ShippingLotEntity GetShippingLotInfo(string lotNumber) { int error = 0; string errorMsg = ""; ShippingLotEntity entity = new ShippingLotEntity(); KeyValue[] shippingLotFilters = new KeyValue[] { new KeyValue("SHIPPING_LOT_NUMBER", lotNumber) }; string[] shippingLotResultKeys = new string[] { "HU_NUMBER", "MATERIAL_BIN_NUMBER", "MATERIAL_BIN_QTY_ACTUAL", "MATERIAL_BIN_QTY_TOTAL", "MATERIAL_BIN_STATE", "PART_DESC", "PART_NUMBER" , "QUANTITY_UNIT", "SHIPPING_COMPLETE_DATE", "SHIPPING_LOT_NUMBER", "SHIPPING_LOT_NUMBER2", "SHIPPING_LOT_PART_NUMBER", "SHIPPING_LOT_SNO_PART_DESCRIPTION", "SHIPPING_LOT_SNO_PART_NUMBER" , "SHIPPING_LOT_SNO_QTY_ACTUAL", "SHIPPING_LOT_SNO_QTY_TOTAL", "SHIPPING_SEND_DATE", "WORKORDER_NUMBER" }; string[] shippingLotResultValues = new string[] { }; LogHelper.Info("begin api shipGetShippingLotInfo (Station number:" + init.configHandler.StationNumber + ",lot number =" + lotNumber + ")"); error = imsapi.shipGetShippingLotInfo(sessionContext, init.configHandler.StationNumber, shippingLotFilters, shippingLotResultKeys, out shippingLotResultValues); LogHelper.Info("end api shipGetShippingLotInfo (result code = " + error + ")"); //imsapi.imsapiGetErrorText(sessionContext, error, out errorMsg); errorMsg = UtilityFunction.GetZHSErrorString(error, init, sessionContext); if (error == 0) { int loop = shippingLotResultKeys.Length; int count = shippingLotResultValues.Length; for (int i = 0; i < count; i += loop) { entity.HU_NUMBER = shippingLotResultValues[i + 0]; entity.MATERIAL_BIN_NUMBER = shippingLotResultValues[i + 1]; entity.MATERIAL_BIN_QTY_ACTUAL = shippingLotResultValues[i + 2]; entity.MATERIAL_BIN_QTY_TOTAL = shippingLotResultValues[i + 3]; entity.MATERIAL_BIN_STATE = shippingLotResultValues[i + 4]; entity.PART_DESC = shippingLotResultValues[i + 5]; entity.PART_NUMBER = shippingLotResultValues[i + 6]; entity.QUANTITY_UNIT = shippingLotResultValues[i + 7]; entity.SHIPPING_COMPLETE_DATE = shippingLotResultValues[i + 8]; entity.SHIPPING_LOT_NUMBER = shippingLotResultValues[i + 9]; entity.SHIPPING_LOT_NUMBER2 = shippingLotResultValues[i + 10]; entity.SHIPPING_LOT_PART_NUMBER = shippingLotResultValues[i + 11]; entity.SHIPPING_LOT_SNO_PART_DESCRIPTION = shippingLotResultValues[i + 12]; entity.SHIPPING_LOT_SNO_PART_NUMBER = shippingLotResultValues[i + 13]; entity.SHIPPING_LOT_SNO_QTY_ACTUAL = shippingLotResultValues[i + 14]; entity.SHIPPING_LOT_SNO_QTY_TOTAL = shippingLotResultValues[i + 15]; entity.SHIPPING_SEND_DATE = shippingLotResultValues[i + 16]; entity.WORKORDER_NUMBER = shippingLotResultValues[i + 17]; } view.errorHandler(0, init.lang.ERROR_API_CALL_ERROR + " shipGetShippingLotInfo " + error, ""); } else { view.errorHandler(2, init.lang.ERROR_API_CALL_ERROR + " shipGetShippingLotInfo " + error + "," + errorMsg, ""); } return(entity); }
public ShippingLotEntity GetLotFromSN(string serialNumber) { int error = 0; string errorMsg = ""; ShippingLotEntity entity = new ShippingLotEntity(); string[] lotResultKeys = new string[] { "MATERIAL_BIN_NUMBER", "MATERIAL_BIN_QTY_ACTUAL", "MATERIAL_BIN_QTY_TOTAL", "MATERIAL_BIN_STATE", "PART_NUMBER", "PART_DESC" , "QUANTITY_UNIT", "SHIPPING_LOT_NUMBER", "SHIPPING_LOT_NUMBER2", "SHIPPING_LOT_PART_NUMBER", "SHIPPING_LOT_SNO_PART_DESCRIPTION", "SHIPPING_LOT_SNO_PART_NUMBER" , "SHIPPING_LOT_SNO_QTY_ACTUAL", "SHIPPING_LOT_SNO_QTY_TOTAL" }; string[] lotResultValues = new string[] { }; LogHelper.Info("begin api shipGetLotFromSerialNumber (Station number:" + init.configHandler.StationNumber + ",serial number =" + serialNumber + ")"); error = imsapi.shipGetLotFromSerialNumber(sessionContext, init.configHandler.StationNumber, serialNumber, "-1", lotResultKeys, out lotResultValues); LogHelper.Info("end api shipGetLotFromSerialNumber (result code = " + error + ")"); //imsapi.imsapiGetErrorText(sessionContext, error, out errorMsg); errorMsg = UtilityFunction.GetZHSErrorString(error, init, sessionContext); if (error == 0) { int loop = lotResultKeys.Length; int count = lotResultValues.Length; for (int i = 0; i < count; i += loop) { entity.MATERIAL_BIN_NUMBER = lotResultValues[i + 0]; entity.MATERIAL_BIN_QTY_ACTUAL = lotResultValues[i + 1]; entity.MATERIAL_BIN_QTY_TOTAL = lotResultValues[i + 2]; entity.MATERIAL_BIN_STATE = lotResultValues[i + 3]; entity.PART_NUMBER = lotResultValues[i + 4]; entity.PART_DESC = lotResultValues[i + 5]; entity.QUANTITY_UNIT = lotResultValues[i + 6]; entity.SHIPPING_LOT_NUMBER = lotResultValues[i + 7]; entity.SHIPPING_LOT_NUMBER2 = lotResultValues[i + 8]; entity.SHIPPING_LOT_PART_NUMBER = lotResultValues[i + 9]; entity.SHIPPING_LOT_SNO_PART_DESCRIPTION = lotResultValues[i + 10]; entity.SHIPPING_LOT_SNO_PART_NUMBER = lotResultValues[i + 11]; entity.SHIPPING_LOT_SNO_QTY_ACTUAL = lotResultValues[i + 12]; entity.SHIPPING_LOT_SNO_QTY_TOTAL = lotResultValues[i + 13]; } view.errorHandler(0, init.lang.ERROR_API_CALL_ERROR + " shipGetLotFromSerialNumber " + error, ""); } else//-418 'Serial number was not found in the lot' { view.errorHandler(2, init.lang.ERROR_API_CALL_ERROR + " shipGetLotFromSerialNumber " + error + "," + errorMsg, ""); } return(entity); }