Example #1
0
        public string[] Get(string[] data)
        {
            if (data.Length == 4)
            {
                return(GetCategory(data));
            }
            if (data.Length == 1)
            {
                return(new string[] { GetTopCategory(data) });
            }
            string user      = data[0];
            int    listingID = Int32.Parse(data[1]);

            if (!Check(listingID))
            {
                return(new string[] { "Error - not found" });
            }
            else if (!Check(user))
            {
                return(new string[] { "Error - unknown user" });
            }
            else
            {
                Listing  listing = _listings[listingID];
                string[] result  = listing.GetListingData();
                return(result);
            }
        }