internal static String GetGuestActivity(Dictionary<String, String> parameters) { Logging.Log(1, "Entering GetGuestActivity"); List<String> requiredParameters = new List<String>() { "tnGuestNo", "ttStartDate", "ttEndDate" }; //always required parameters (but not used) { "tcSalesPoint", "tcOperator" }; //optional parameters { "tcFilter"}; //TODO: get rid of not used tcFilter parameter in the code and SP HashSet<String> availableReturnTypes = new HashSet<String>(StringComparer.OrdinalIgnoreCase) { "STR", "ADO", "XML", "XM2" }; String messageText = ""; Int32 errorValue = 0; Int32 statusCode = 0; // If all necessary parameters are present and valid, proceed... if (Functions.CheckRequiredParameters(parameters, requiredParameters, availableReturnTypes, out statusCode, out messageText)) { // Parse out the parameters String tcGuestNo = Functions.GetParameterValue(parameters, "tnGuestNo"); String tcStartDate = Functions.GetParameterValue(parameters, "ttStartDate"); String tcEndDate = Functions.GetParameterValue(parameters, "ttEndDate"); String tcFilter = Functions.GetParameterValue(parameters, "tcFilter"); Decimal guestNo; if (!Decimal.TryParse(tcGuestNo, out guestNo) || 0 == guestNo) { statusCode = 999; messageText = "tnGuestNo expression can not be zero"; return Base.LogAndReturnResult(errorValue, statusCode, messageText); }UPDATE. I changed this method to use only 1 exit point as it has only 2 exit points, so it was relatively easy to convert.