示例#1
0
        public ServiceBusResponse addCompanyReview(AddCompanyReviewRequest request)
        {
            send(request);
            ServiceBusResponse resp = readUntilEOF();

            return(resp);
        }
示例#2
0
        /// <summary>
        /// Publishes an EchoEvent.
        /// </summary>
        /// <param name="request">The data to be echo'd back to the client</param>
        /// <returns>The data sent by the client</returns>
        private ServiceBusResponse addCompanyReview(AddCompanyReviewRequest request)
        {
            if (authenticated == false)
            {
                return(new ServiceBusResponse(false, "Error: You must be logged in to use the echo reverse functionality."));
            }

            AddReviewEvent reviewEvent = new AddReviewEvent
            {
                review = request.review
            };

            //This function publishes the EchoEvent class. All endpoint instances that subscribed to these events prior
            //to the event being published will have their respictive handler functions called with the EchoEvent object
            //as one of the parameters
            eventPublishingEndpoint.Publish(reviewEvent);
            return(new ServiceBusResponse(true, "Review Saved.")); //might have to change this later... TODO!!!
        }
示例#3
0
        public ActionResult Review(string companyReview, string companyStars)
        {
            if (Globals.isLoggedIn() == false)
            {
                return(RedirectToAction("Index", "Authentication"));
            }

            ServiceBusConnection connection = ConnectionManager.getConnectionObject(Globals.getUser());

            if (connection == null)
            {
                return(RedirectToAction("Index", "Authentication"));
            }
            DateTime now = DateTime.Now;
            AddCompanyReviewRequest request  = new AddCompanyReviewRequest(new Review(companyNameeeee, companyReview, companyStars, now.ToString(), Globals.getUser()));
            ServiceBusResponse      response = connection.addCompanyReview(request);

            //Can check if result is true here or just redirect to displaycompany and reload page

            return(RedirectToAction("Index"));
        }