예제 #1
0
        public ActionResult Edit(Content result)
        {

            if (ModelState.IsValid)
            {
                Content content = reposetory.GetContent(result.ContentID);
                if (content == null) return HttpNotFound();

                content.Title = result.Title;
                content.Body = result.Body;
                content.AuthorID = CurrentProfile.PersonID;
                
                if (reposetory.Save(content))
                {
                    ViewBag.FormSucces = true;
                    ModelState.Clear();
                    Notification not = reposetory.Notify(content, String.Format(Notifications.ContentEdited, CurrentProfile.Username));
                    reposetory.NotifyAddAdministration(not);
                    reposetory.NotifySave(not);
                    return View(content);
                }
                else
                {
                    ViewBag.CaughtException = true;
                }
            }

            return View(result);

        }
예제 #2
0
        public Content tagReplace(Content Value)
        {

            if (Value == null) return new Content();
            Value.Body = Value.Body.Replace("##ForeningsNavn##", Basedata.AssociationName);


             return Value;
        }