public static string GetUnitOfMeasureText(Constants.UNIT_OF_MEASURE unitOfMeasure) { string unit = null; switch (unitOfMeasure) { case Constants.UNIT_OF_MEASURE.BOX: unit = "Box"; break; case Constants.UNIT_OF_MEASURE.DOZEN: unit = "Dozen"; break; case Constants.UNIT_OF_MEASURE.EACH: unit = "Each"; break; case Constants.UNIT_OF_MEASURE.SET: unit = "Set"; break; case Constants.UNIT_OF_MEASURE.PACKET: unit = "Packet"; break; } return(unit); }
public static Constants.UNIT_OF_MEASURE objToUnitOfMeasure(object obj) { Constants.UNIT_OF_MEASURE unit = Constants.UNIT_OF_MEASURE.UNKNOWN; switch (objToShort(obj)) { case 1: unit = Constants.UNIT_OF_MEASURE.DOZEN; break; case 2: unit = Constants.UNIT_OF_MEASURE.BOX; break; case 3: unit = Constants.UNIT_OF_MEASURE.EACH; break; case 4: unit = Constants.UNIT_OF_MEASURE.SET; break; case 5: unit = Constants.UNIT_OF_MEASURE.PACKET; break; } return(unit); }