コード例 #1
0
        public HttpResponseMessage GetMiscellaneousMessageAsHtml(int id)
        {
            return(ErrorFactory.Handle(() =>
            {
                using (var unitOfWork = new UnitOfWork())
                {
                    var response = unitOfWork.Miscellaneous.GetMiscellaneousMessage(id);

                    if (response == null)
                    {
                        return JsonFactory.CreateHTMLResponseMessage(@"<html><head><title>Unable to find page</title></head><body>Unable to find this page.</body></html>", HttpStatusCode.NotFound, this.Request);
                    }

                    return JsonFactory.CreateHTMLResponseMessage(response.PageData, HttpStatusCode.OK, this.Request);
                }
            }, this.Request));
        }
コード例 #2
0
        public HttpResponseMessage GetLatestPrivacyPolicyAsHtml()
        {
            return(ErrorFactory.Handle(() =>
            {
                using (var unitOfWork = new UnitOfWork())
                {
                    var response = unitOfWork.Miscellaneous.GetLatestPrivacyPolicy();

                    if (response == null)
                    {
                        return JsonFactory.CreateHTMLResponseMessage(@"<html><head><title>Privacy Policy</title></head><body>Unable to find the current privacy policy.</body></html>", HttpStatusCode.NotFound, this.Request);
                    }

                    return JsonFactory.CreateHTMLResponseMessage(response.PageData, HttpStatusCode.OK, this.Request);
                }
            }, this.Request));
        }
コード例 #3
0
        public HttpResponseMessage GetLatestTermsAndConditionsAsHtml()
        {
            return(ErrorFactory.Handle(() =>
            {
                using (var unitOfWork = new UnitOfWork())
                {
                    var response = unitOfWork.Miscellaneous.GetLatestTermsAndConditions();

                    if (response == null)
                    {
                        return JsonFactory.CreateHTMLResponseMessage(@"<html><head><title>Terms and Conditions</title></head><body>Unable to find the latest terms and conditions.</body></html>", HttpStatusCode.NotFound, this.Request);
                    }

                    return JsonFactory.CreateHTMLResponseMessage(response.PageData, HttpStatusCode.OK, this.Request);
                }
            }, this.Request));
        }