示例#1
0
        internal override string Execute(NameValueCollection commandParameters)
        {
            int categoryID;

            string error = ValidateIntParameter(commandParameters, "categoryId", out categoryID);

            if (error != string.Empty)
            {
                return(error);
            }

            List <Category> categoryList;

            BLClient client = null;

            // call WCF BLL Method
            try
            {
                client = new BLClient();

                categoryList = client.GetCategoryList(categoryID);
            }
            catch (Exception exception)
            {
                return(ErrorWrapper.SendError(exception.Message));
            }
            finally
            {
                if (client != null)
                {
                    client.Dispose();
                }
            }

            return(Flatten(categoryList));
        }