コード例 #1
0
        public MiscellaneousHtmlTable UpdateSpecialMessage(IncomingSpecialMessage updateSpecialMessage)
        {
            var editSpecialMessage = dbContext.MiscellaneousHtmlTable.FirstOrDefault(x => x.Id == updateSpecialMessage.VenueId);

            if (editSpecialMessage == null)
            {
                throw new Exception("No message");
            }

            editSpecialMessage.PageName = updateSpecialMessage.PageName;
            editSpecialMessage.PageData = updateSpecialMessage.PageData;
            //DateUpdated = DateTime.UtcNow; //add DateUpdated to the MiscellaneousHtmlTable

            return(editSpecialMessage);
        }
コード例 #2
0
        public HttpResponseMessage UpdateSpecialMessage(IncomingSpecialMessage updateSpecialMessage)
        {
            return(ErrorFactory.Handle(() =>
            {
                using (var unitOfWork = new UnitOfWork())
                {
                    var updatedSpecialMessage = unitOfWork.Miscellaneous.UpdateSpecialMessage(updateSpecialMessage);

                    unitOfWork.Complete();

                    var outgoingMiscellaneousHtml = OutgoingMiscellaneousHtml.Parse(updatedSpecialMessage);

                    return JsonFactory.CreateJsonMessage(outgoingMiscellaneousHtml, HttpStatusCode.OK, this.Request);
                }
            }, this.Request));
        }