public void ShouldBeAbleToUpdateCustomizeInvolvementTabXmlViaPost()
        {
            // requires the existence of a parameter-less constructor for ajax post and model binding.
            var involvementTabModel = new InvolvementTabModel();

            involvementTabModel.ShouldNotBeNull();
        }
Esempio n. 2
0
        public JsonResult Update(InvolvementTabModel model)
        {
            var involvementTabContent = CurrentDatabase.Contents.SingleOrDefault(c => c.Name == model.Name);

            if (involvementTabContent == null)
            {
                involvementTabContent = new Content
                {
                    Title       = "Edit Text Content",
                    Name        = model.Name,
                    TypeID      = ContentTypeCode.TypeText,
                    DateCreated = DateTime.Now
                };
                CurrentDatabase.Contents.InsertOnSubmit(involvementTabContent);
            }

            involvementTabContent.Body = model.BuildXml();

            CurrentDatabase.SubmitChanges();

            return(Json(new { success = true }));
        }