Ejemplo n.º 1
0
        public JsonResult SendRequest(Models.MatchedRequest matchedRequest)
        {
            bool status = false;

            try
            {
                status = rep.SendRequest(matchedRequest.OwnerId, matchedRequest.WasherId,
                                         matchedRequest.OwnerRequestId, matchedRequest.WasherRequestId, matchedRequest.RequestSentBy);
            }
            catch (Exception ex)
            {
                status = false;
            }
            return(Json(status));
        }
Ejemplo n.º 2
0
        public JsonResult ViewMatchedRequests(string userId)
        {
            List <Models.MatchedRequest> matchedRequests = new List <Models.MatchedRequest>();

            try
            {
                List <MatchedRequest> matched = rep.ViewMatchedRequests(userId);
                if (matched != null)
                {
                    foreach (var match in matched)
                    {
                        Models.MatchedRequest matchObj = _mapper.Map <Models.MatchedRequest>(match);
                        matchedRequests.Add(matchObj);
                    }
                }
            }
            catch (Exception e)
            {
                matchedRequests = null;
            }
            return(Json(matchedRequests));
        }