Ejemplo n.º 1
0
        public static string[] getOfferRequestToAnswer(string username, int requestID)
        {
            aUser requestsHolder = getUser(username);

            if (requestsHolder == null)
            {
                return(null);
            }

            OfferRequest request = requestsHolder.getRequestToAnswer(requestID);

            if (request == null)
            {
                return(null);
            }

            // convert it to string array
            string[] requestString = new string[7]; // the length is equal to the number of relevant fields in OfferRequest

            requestString[0] = "" + request.id;
            requestString[1] = request.requester.getUserName();
            requestString[2] = request.store.name;
            requestString[3] = request.product.info.ToString();
            requestString[4] = "" + request.product.amount;
            requestString[5] = "" + request.getPrice();
            requestString[6] = "" + request.status;

            return(requestString);
        }