Exemplo n.º 1
0
        public ActionResult Index(MainPageModel sm)
        {
            MainPageModel   data         = new MainPageModel();
            GetPropertyData propertydata = new GetPropertyData();

            try
            {
                if (ModelState.IsValid)
                {
                    data.AllProperty = propertydata.GetAllProperty(sm.SearchModel);

                    //ContactModel con = new ContactModel();
                    //status = con.InsertVisitor(ct);

                    ModelState.Clear();
                }
                else
                {
                    data.AllProperty = propertydata.GetAllProperty();
                }
            }
            catch
            {
            }
            CallList();

            return(View(data));
        }
Exemplo n.º 2
0
        private ContentInfo GetContent(GetPropertyData getPropertyData)
        {
            HashSet <Type> types      = TypeHelper.GetAllConcreteTypesAssignableFrom <SystemEntity>();
            Type           entityType = types.FirstOrDefault(t => t.Name == getPropertyData.Type);

            if (entityType == null)
            {
                return(new ContentInfo());
            }
            object entity = _session.Get(entityType, getPropertyData.Id);

            if (entity == null)
            {
                return(new ContentInfo());
            }
            PropertyInfo propertyInfo =
                entityType.GetProperties().FirstOrDefault(info => info.Name == getPropertyData.Property);

            if (propertyInfo == null)
            {
                return(new ContentInfo());
            }
            return(new ContentInfo
            {
                Content = Convert.ToString(propertyInfo.GetValue(entity, null)),
                Entity = entity
            });
        }
Exemplo n.º 3
0
        public ActionResult Index()
        {
            CallList();
            GetPropertyData propertydata = new GetPropertyData();

            MainPageModel data = new MainPageModel();

            data.AllProperty = propertydata.GetAllProperty();
            return(View(data));
        }
Exemplo n.º 4
0
        public string GetFormattedBodyContent(GetPropertyData getPropertyData, Controller controller)
        {
            ContentInfo content = GetContent(getPropertyData);

            object entity = content.Entity;

            if (entity is Webpage)
            {
                CurrentRequestData.CurrentPage = entity as Webpage;
            }
            HtmlHelper htmlHelper = MrCMSHtmlHelper.GetHtmlHelper(controller);

            return(htmlHelper.ParseShortcodes(content.Content).ToHtmlString());
        }
Exemplo n.º 5
0
 public string GetFormattedBodyContent(GetPropertyData getPropertyData)
 {
     return(_inPageAdminService.GetFormattedBodyContent(getPropertyData, this));
 }
Exemplo n.º 6
0
 public string GetUnformattedBodyContent(GetPropertyData getPropertyData)
 {
     return(GetContent(getPropertyData).Content);
 }