/// <summary>
        /// 分页查询机构列表
        /// </summary>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页数量</param>
        /// <param name="key">条件查询关键字</param>
        /// <returns></returns>
        public ListPageModel <OrganDto> GetOrganPageList(int pageNum, int pageSize, string keyword)
        {
            ListPageModel <OrganDto> item = null;

            try
            {
                var param = new List <string>();
                using (var db = new DbContext())
                {
                    var sqlBuilder = db.Sql("");
                    //查询条件不为空
                    if (keyword.IsNotNullOrEmpty())
                    {
                        param.Add("条件查询");
                        sqlBuilder.Parameters("keyword", keyword);
                    }
                    //获取机构列表信息
                    var sqlStr = db.GetSql("CA00001-分页查询机构列表", null, param.ToArray());
                    //执行SQL脚本
                    var items = sqlBuilder.SqlText(sqlStr).Paging(pageNum, pageSize).GetModelList <OrganDto>(out int total);
                    item = new ListPageModel <OrganDto>()
                    {
                        Total    = total,
                        PageList = items
                    };
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("获取机构异常错误!", ex);
            }
            return(item);
        }
        /// <summary>
        /// 分页查询角色列表
        /// </summary>
        /// <param name="pageNum"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public ListPageModel <RoleUserDto> GetRoleList(int pageNum, int pageSize)
        {
            ListPageModel <RoleUserDto> item = null;

            try
            {
                List <string> listPara = new List <string>();
                //listPara.Add("是否停用");
                using (var db = new DbContext())
                {
                    //获取用户基本信息
                    var sqlStr = db.GetSql("AA00001-分页查询角色", null, listPara.ToArray());
                    int total  = 0;
                    //执行SQL脚本
                    ISqlBuilder sqlBuilder = db.Sql(sqlStr);
                    //执行SQL脚本
                    var items = sqlBuilder.Paging(pageNum, pageSize).Parameters("state", 1)
                                .GetModelList <RoleUserDto>(out total);
                    item = new ListPageModel <RoleUserDto>()
                    {
                        Total    = total,
                        PageList = items
                    };
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("获取科室人员异常错误!", ex);
            }
            return(item);
        }
        /// <summary>
        /// Gets a paged list view for a given posts by author/tags/categories model
        /// </summary>
        protected ActionResult GetPagedListView(IMasterModel categoryPageModel, IPublishedContent pageNode, IEnumerable <PostListItemModel> listItems, int totalPosts, int?p)
        {
            if (categoryPageModel == null)
            {
                throw new ArgumentNullException(nameof(categoryPageModel));
            }
            if (pageNode == null)
            {
                throw new ArgumentNullException(nameof(pageNode));
            }
            if (listItems == null)
            {
                throw new ArgumentNullException(nameof(listItems));
            }

            PagerModel pager;

            if (!GetPagerModel(categoryPageModel, totalPosts, p, out pager))
            {
                return(new RedirectToUmbracoPageResult(categoryPageModel.RootBlogNode, UmbracoContext));
            }

            var listModel = new ListPageModel(pageNode, listItems, pager);

            return(View("~/Views/Category/ListByTag.cshtml", listModel));
        }
Beispiel #4
0
        /// <summary>
        /// 分页获取rh血型数据
        /// </summary>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页数量</param>
        /// <param name="keyword">查询条件</param>
        /// <returns></returns>
        public ListPageModel <rhBloodType> GetrhBloodTypeList(int pageNum, int pageSize, string keyword)
        {
            ListPageModel <rhBloodType> item = null;

            try
            {
                var param = new List <string>();
                using (var db = new DbContext())
                {
                    var sqlBuilder = db.Sql("");
                    //查询条件不为空
                    if (keyword.IsNotNullOrEmpty())
                    {
                        param.Add("keyword");
                        sqlBuilder.Parameters("keyword", keyword);
                    }
                    //获取用户基本信息
                    var sqlStr = db.GetSql("EA00002-分页获取rh血型", null, param.ToArray());
                    //执行SQL脚本
                    var items = sqlBuilder.SqlText(sqlStr).Paging(pageNum, pageSize).GetModelList <rhBloodType>(out int total);
                    item = new ListPageModel <rhBloodType>()
                    {
                        Total    = total,
                        PageList = items
                    };
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("获取rh血型数据错误!", ex);
            }
            return(item);
        }
Beispiel #5
0
        public static ListPageModel GetListPageModel(int id, int userID)
        {
            ListPageModel model = new ListPageModel();
            ServiceList   list  = manager.listService.GetListById(id);
            var           books = manager.listService.GetListBooks(list);

            model.List  = list.ToListModel();
            model.Books = books.Select(e => Book.GetBookShortModel(e, userID));
            return(model);
        }
Beispiel #6
0
 public ActionResult List(int id)
 {
     try
     {
         int           userID = (int)Profile["ID"];
         ListPageModel model  = Models.DataModels.List.GetListPageModel(id, userID);
         return(View(model));
     }
     catch (Exception ex)
     {
         logger.Error(ex);
         return(View("Error"));
     }
 }
Beispiel #7
0
        public ChatPage()
        {
            InitializeComponent();
            this.Title = $"Wellcome {App.Username}";

            model  = new ListPageModel();
            Client = new HubClient();
            Client.Connect(App.Username);
            Client.ConnectionErrorOcurned += Client_ConnectionErrorOcurned;
            Client.OnGetMessage           += Client_OnGetMessage;
            Client.OnGetMyMessage         += Client_OnGetMyMessage;
            Client.OnGetInfo   += Client_OnGetInfo;
            this.BindingContext = model;
        }
        public void TestListPageModel()
        {
            IFeedService mockFeedService = new MockFeedService();

            AutoMapper.Mapper.Initialize(cfg => cfg.CreateMap <FeedDto, Feed>());

            mockFeedService.SendFeed(new FeedDto {
                Content = "test"
            });

            ListPageModel pageModel = new ListPageModel(mockFeedService);

            pageModel.RefreshCommand.Execute(null);
            Assert.IsTrue(pageModel.Feeds.Count == 1);
        }
        public static IListPageModel GetListPageModel(this IModelMetadataProvider provider, Type modelType)
        {
            var            metadata       = provider.GetMetadataForType(modelType);
            EntityMetadata entityMetadata = null;

            if (metadata is EntityModelMetadata entityModelMetadata)
            {
                entityMetadata = entityModelMetadata.EntityMetadata;
            }

            IListPageModel pageModel = new ListPageModel(entityMetadata ?? new EntityMetadata());

            pageModel.ModelMetadata = metadata;
            return(pageModel);
        }
Beispiel #10
0
        /// <summary>
        /// 分页获取基础数据
        /// </summary>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页数量</param>
        /// <param name="keyword">查询条件</param>
        /// <param name="type">基础数据类型</param>
        /// <returns></returns>
        public ResponseModel GetBasicDataList(int pageNum, int pageSize, string keyword, int type)
        {
            //提示信息
            var result = new ResponseModel(ResponseCode.Error, "分页获取基础数据信息失败!");
            ListPageModel <BasicDataDto> item = null;
            //字典表名
            string tablename = "";

            try
            {
                if (isTure(type))
                {
                    result.msg = "请求参数异常";
                    return(result);
                }
                DicType dictype = (DicType)type;
                //字典表名
                tablename = dictype.ToString();
                var param = new List <string>();
                using (var db = new DbContext())
                {
                    var sqlwhere = "";
                    if (!string.IsNullOrEmpty(keyword))
                    {
                        sqlwhere = " and (编码 like '%" + keyword + "%' or 名称 like '%" + keyword + "%' or 简码 like '%" + keyword + "%')";
                    }
                    var sql = $"select *,(select count(*)  from {tablename} where 1=1 {sqlwhere}  ) as total  from   {tablename} where 1=1 {sqlwhere}  order by 编码  limit {pageSize} offset (({pageNum}-1)*{pageSize})";

                    //执行SQL脚本
                    var items = db.Sql(sql).GetModelList <BasicDataDto>();
                    item = new ListPageModel <BasicDataDto>()
                    {
                        Total    = items != null && items.Any() ? items.FirstOrDefault().total : 0,
                        PageList = items
                    };
                    result.code = (int)ResponseCode.Success;
                    result.msg  = "查询成功";
                    result.data = item;
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("获取" + tablename + "数据错误!", ex);
            }
            return(result);
        }
Beispiel #11
0
        public string Generate(List <Field> pageFields, PageModel page)
        {
            ListPageModel ListPage = new ListPageModel(pageFields);

            ListPage.FormatToListAssignmentFormat();
            ListPageTemplate listPage = new ListPageTemplate();

            listPage.Session = new Dictionary <string, object>();

            listPage.Session.Add("ClassName", page.ClassName);
            listPage.Session.Add("ComponentKey", page.ComponentKey + "_list");
            listPage.Session.Add("MenuName", page.MenuName);
            listPage.Session.Add("ColumnsNames", ListPage.ToString());

            listPage.Initialize();
            return(listPage.TransformText());
        }
        /// <summary>
        /// 分页查询机构人员列表
        /// </summary>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页数量</param>
        /// <param name="key">查询条件</param>
        /// <param name="orgId">机构id</param>
        /// <returns></returns>
        public ListPageModel <OrgPersonDto> GetOrgPersonList(int pageNum, int pageSize, string keyword, int orgId, string state)
        {
            ListPageModel <OrgPersonDto> item = null;

            try
            {
                var param = new List <string>();
                using (var db = new DbContext())
                {
                    var sqlBuilder = db.Sql("");
                    //查询条件不为空
                    if (keyword.IsNotNullOrEmpty())
                    {
                        param.Add("条件查询");
                        sqlBuilder.Parameters("keyword", keyword);
                    }
                    if (orgId != 0)
                    {
                        param.Add("机构id");
                        sqlBuilder.Parameters("orgid", orgId);
                    }
                    if (!state.IsNullOrEmpty())
                    {
                        param.Add("状态");
                        sqlBuilder.Parameters("UserState", state.ToInt32());
                    }
                    //获取用户基本信息
                    var sqlStr = db.GetSql("CA00002-分页查询机构人员", null, param.ToArray());
                    //执行SQL脚本
                    var items = sqlBuilder.SqlText(sqlStr).Paging(pageNum, pageSize).GetModelList <OrgPersonDto>(out int total);
                    //排序
                    item = new ListPageModel <OrgPersonDto>()
                    {
                        Total    = total,
                        PageList = items
                    };
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("获取机构人员异常错误!", ex);
            }
            return(item);
        }
Beispiel #13
0
        /// <summary>
        /// 分页获取国籍数据
        /// </summary>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页数量</param>
        /// <param name="keyword">查询条件</param>
        /// <returns></returns>
        public ListPageModel <BasicDataDto> GetNationalityList(int pageNum, int pageSize, string keyword)
        {
            ListPageModel <BasicDataDto> item = null;

            try
            {
                var param = new List <string>();
                using (var db = new DbContext())
                {
                    //var sqlBuilder = db.Sql("");
                    //////查询条件不为空
                    ////if (keyword.IsNotNullOrEmpty())
                    ////{
                    ////    param.Add("keyword");
                    ////    sqlBuilder.Parameters("keyword", keyword);
                    ////}
                    ////获取用户基本信息
                    //var sqlStr = db.GetSql("EA00003-分页获取国籍血型", null, param.ToArray());
                    ////执行SQL脚本
                    //var items = sqlBuilder.SqlText(sqlStr).Paging(pageNum, pageSize).GetModelList<Nationality>(out int total);
                    //item = new ListPageModel<Nationality>()
                    //{
                    //    Total = total,
                    //    PageList = items
                    //};

                    //获取角色的模块信息
                    //var sqlStr = db.GetSql("EA00004-分页查询基础数据只包含编码名称简码", null, null);
                    string tablename = "b_国籍";
                    //执行SQL脚本
                    var items = db.Sql($"select *,(select count(*)  from {tablename} ) as total  from   {tablename}  order by 编码  limit {pageSize} offset (({pageNum}-1)*{pageSize})").GetModelList <BasicDataDto>();
                    item = new ListPageModel <BasicDataDto>()
                    {
                        Total    = items != null && items.Any() ? items.FirstOrDefault().total : 0,
                        PageList = items
                    };
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("获取国籍数据错误!", ex);
            }
            return(item);
        }
        /// <summary>
        /// 分页获取系统_产品数据源
        /// </summary>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页数量</param>
        /// <param name="key">查询条件</param>
        /// <param name="productid">产品id</param>
        /// <param name="databasetype">数据库类型</param>
        /// <returns></returns>
        public ListPageModel <DataSourceDto> GetDataSourceList(int pageNum, int pageSize, string keyword, int productid, int databasetype)
        {
            ListPageModel <DataSourceDto> item = null;

            try
            {
                var param = new List <string>();
                using (var db = new DbContext())
                {
                    var sqlBuilder = db.Sql("");
                    //查询条件不为空
                    if (keyword.IsNotNullOrEmpty())
                    {
                        param.Add("keyword");
                        sqlBuilder.Parameters("keyword", keyword);
                    }
                    if (productid != 0)
                    {
                        param.Add("productid");
                        sqlBuilder.Parameters("productid", productid);
                    }
                    if (databasetype != 0)
                    {
                        param.Add("databasetype");
                        sqlBuilder.Parameters("databasetype", databasetype);
                    }
                    //获取用户基本信息
                    var sqlStr = db.GetSql("DA00002-分页查询产品数据源", null, param.ToArray());
                    //执行SQL脚本
                    var items = sqlBuilder.SqlText(sqlStr).Paging(pageNum, pageSize).GetModelList <DataSourceDto>(out int total);
                    item = new ListPageModel <DataSourceDto>()
                    {
                        Total    = total,
                        PageList = items
                    };
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("获取系统_产品数据源信息错误!", ex);
            }
            return(item);
        }
        public List <ListPageModel> GetAllContent()
        {
            var donatees = this.db.Donatee.Where(x => x.EndDate > DateTime.UtcNow).ToArray();

            var listPageData = new List <ListPageModel>();

            foreach (var donatee in donatees)
            {
                var listPageModel = new ListPageModel();
                listPageModel.DonateeId = donatee.Id;
                listPageModel.Author    = donatee.Name;
                listPageModel.Title     = donatee.Title;
                listPageModel.Story     = donatee.Story;
                listPageModel.Image     = donatee.Image;

                listPageData.Add(listPageModel);
            }

            return(listPageData);
        }
        /// <summary>
        /// 查询待分配角色人员--分页
        /// </summary>
        /// <param name="orgid">机构id</param>
        /// <param name="ksId">科室id</param>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页数量</param>
        /// <returns></returns>
        public ListPageModel <SystemUser> OrgPersonSelectList(int pageNum, int pageSize, string txCx, int state)
        {
            ListPageModel <SystemUser> item = null;
            var param = new List <string>();

            try
            {
                using (var db = new DbContext())
                {
                    var sqlBuilder = db.Sql("");
                    //用户状态不为空
                    if (state.ToString().IsNotNullOrEmpty())
                    {
                        param.Add("用户状态");
                        sqlBuilder.Parameters("SFQY", state);
                    }
                    if (txCx.IsNotNullOrEmpty())
                    {
                        param.Add("查询条件");
                        sqlBuilder.Parameters("strwhere", txCx);
                    }
                    //获取用户基本信息
                    var sqlStr = db.GetSql("AA00009-获取待分配角色人员", null, param.ToArray());
                    int total  = 0;
                    //执行SQL脚本
                    var items = sqlBuilder.SqlText(sqlStr).Paging(pageNum, pageSize).GetModelList <SystemUser>(out total);
                    item = new ListPageModel <SystemUser>()
                    {
                        Total    = total,
                        PageList = items
                    };
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("获取人员异常错误!", ex);
            }
            return(item);
        }
Beispiel #17
0
        /// <summary>
        /// 根据基础数据id分页查询基础数据
        /// </summary>
        /// <param name="catgoryid"></param>
        /// <returns></returns>
        public ListPageModel <sys_code_items> GetitemsListByCid(string catgoryid, int pageNum, int pageSize, string keyword)
        {
            ListPageModel <sys_code_items> item = null;

            try
            {
                var param = new List <string>();
                using (var db = new DbContext())
                {
                    var sqlBuilder = db.Sql("");
                    //查询条件不为空
                    if (!keyword.IsNullOrEmpty())
                    {
                        param.Add("keyword");
                        sqlBuilder.Parameters("keyword", keyword);
                    }
                    if (!catgoryid.IsNullOrEmpty())
                    {
                        param.Add("catgoryid");
                        sqlBuilder.Parameters("catgoryid", catgoryid);
                    }

                    //获取用户基本信息
                    var sqlStr = db.GetSql("EA00005-根据基础数据分类查询基础数据", null, param.ToArray());
                    //执行SQL脚本
                    var items = sqlBuilder.SqlText(sqlStr).Paging(pageNum, pageSize).GetModelList <sys_code_items>(out int total);
                    item = new ListPageModel <sys_code_items>()
                    {
                        Total    = total,
                        PageList = items
                    };
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("查询基础数据异常错误!", ex);
            }
            return(item);
        }
Beispiel #18
0
        /// <summary>
        /// 分页查询产品列表
        /// </summary>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页数量</param>
        /// <param name="key">查询条件</param>
        /// <param name="state">状态</param>
        /// <returns></returns>
        public ListPageModel <Product> GetProductList(int pageNum, int pageSize, string keyword, int state)
        {
            ListPageModel <Product> item = null;

            try
            {
                var param = new List <string>();
                using (var db = new DbContext())
                {
                    var sqlBuilder = db.Sql("");
                    //查询条件不为空
                    if (keyword.IsNotNullOrEmpty())
                    {
                        param.Add("keyword");
                        sqlBuilder.Parameters("keyword", keyword);
                    }
                    //状态筛选条件
                    if (state != -999)
                    {
                        param.Add("state");
                        sqlBuilder.Parameters("state", state);
                    }
                    //获取用户基本信息
                    var sqlStr = db.GetSql("DA00003-查询所有产品信息", null, param.ToArray());
                    //执行SQL脚本
                    var items = sqlBuilder.SqlText(sqlStr).Paging(pageNum, pageSize).GetModelList <Product>(out int total);
                    item = new ListPageModel <Product>()
                    {
                        Total    = total,
                        PageList = items
                    };
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("获取系统_产品错误!", ex);
            }
            return(item);
        }
        /// <summary>
        /// 分页查询人员列表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ListPageModel <SystemUser> GetSystemUserList(UserSelect model)
        {
            ListPageModel <SystemUser> listPage = new ListPageModel <SystemUser>();

            try
            {
                int total = 0;
                var items = new List <SystemUser>();
                var param = new List <string>();
                using (var db = new DbContext())
                {
                    var sqlBuilder = db.Sql("");
                    //查询条件
                    if (model.txcx.IsNotNullOrEmpty())
                    {
                        param.Add("查询条件");
                        sqlBuilder.Parameters("strwhere", model.txcx);
                    }
                    if (model.sfqy.IsNotNullOrEmpty())
                    {
                        param.Add("用户状态");
                        sqlBuilder.Parameters("SFQY", int.Parse(model.sfqy));
                    }
                    var sqlStr = db.GetSql("BA00003-分页查询人员列表", null, param.ToArray());
                    //执行SQL脚本
                    items = sqlBuilder.SqlText(sqlStr)
                            .Paging(model.page_num, model.page_size)
                            .GetModelList <SystemUser>(out total);
                }
                listPage.Total    = total;
                listPage.PageList = items;
                return(listPage);
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("获取人员异常错误!", ex);
            }
            return(listPage);
        }
        /// <summary>
        /// 查询角色人员--分页
        /// </summary>
        /// <param name="orgid">机构id</param>
        /// <param name="ksId">科室id</param>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页数量</param>
        /// <returns></returns>
        public ListPageModel <SystemRoleDto> RolePersonSelectList(int pageNum, int pageSize, string txCx, string jsid)
        {
            ListPageModel <SystemRoleDto> item = null;
            var param = new List <string>();

            try
            {
                using (var db = new DbContext())
                {
                    var sqlBuilder = db.Sql("");
                    //查询条件不为空
                    if (txCx.IsNotNullOrEmpty())
                    {
                        param.Add("条件查询");
                        sqlBuilder.Parameters("Tx_Cx", txCx);
                    }
                    if (!jsid.IsNullOrEmpty())
                    {
                        param.Add("角色id");
                        sqlBuilder.Parameters("JSID", jsid);
                    }
                    //获取用户基本信息
                    var sqlStr = db.GetSql("AA00008-获取角色人员列表", null, param.ToArray());
                    //执行SQL脚本
                    var items = sqlBuilder.SqlText(sqlStr).Paging(pageNum, pageSize).GetModelList <SystemRoleDto>(out int total);
                    item = new ListPageModel <SystemRoleDto>()
                    {
                        Total    = total,
                        PageList = items
                    };
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("获取科室人员异常错误!", ex);
            }
            return(item);
        }
Beispiel #21
0
 public ProjectPage()
 {
     Instance       = this;
     BindingContext = Model = new ListPageModel <Group>(null);
     this.InitializeComponent();
 }
        public Task <ListPageModel <SystemUser> > GetSystemUserList(UserSelect model)
        {
            ListPageModel <SystemUser> list = this.Logic.GetSystemUserList(model);

            return(Task.FromResult(list));
        }
Beispiel #23
0
 public ProjectsListPage()
 {
     Instance       = this;
     BindingContext = Model = new ListPageModel <Project>(ProjectsList.Instance.Items);
     this.InitializeComponent();
 }
Beispiel #24
0
 public ListContentView(ListPageModel data)
 {
     InitializeComponent();
     this.BindingContext = data;
 }
Beispiel #25
0
 public GroupPage()
 {
     Instance       = this;
     BindingContext = Model = new ListPageModel <Scene>(new System.Collections.ObjectModel.ObservableCollection <Scene>());
     this.InitializeComponent();
 }
Beispiel #26
0
        public static void SetDefaultSettings()
        {
            GetLocalizationResources().AddOrUpdatePluginLocaleResource();
            var entityModelService = EngineContext.Current.Resolve <IEntityModelService>();

            #region Public pages
            var pageContentPage = new PublicPageModel {
                Name = "ContentPage", Path = "DP_ContentPage"
            };
            entityModelService.SaveEntity(pageContentPage, EntityTypes.PublicPage.Id);

            var pageRedirectPage = new PublicPageModel {
                Name = "RedirectPage", Path = "DP_RedirectPage"
            };
            entityModelService.SaveEntity(pageRedirectPage, EntityTypes.PublicPage.Id);

            var pageArticlePage = new PublicPageModel {
                Name = "ArticlePage", Path = "DP_ArticlePage"
            };
            entityModelService.SaveEntity(pageArticlePage, EntityTypes.PublicPage.Id);

            var pageGalleryPage = new PublicPageModel {
                Name = "GalleryPage", Path = "DP_GalleryPage"
            };
            entityModelService.SaveEntity(pageGalleryPage, EntityTypes.PublicPage.Id);

            var pageImageVideo = new PublicPageModel {
                Name = "ImageVideo", Path = "DP_ImageVideo"
            };
            entityModelService.SaveEntity(pageImageVideo, EntityTypes.PublicPage.Id);

            //var pageServicePage = new PublicPageModel { Name = "ServicePage", Path = "DP_ServicePage" };
            //entityModelService.SaveEntity(pageServicePage, EntityTypes.PublicPage.Id);

            //var pageFAQPage = new PublicPageModel { Name = "FAQPage", Path = "DP_FAQPage" };
            //entityModelService.SaveEntity(pageFAQPage, EntityTypes.PublicPage.Id);

            //var pagePromotionPage = new PublicPageModel { Name = "PromotionPage", Path = "DP_PromotionPage" };
            //entityModelService.SaveEntity(pagePromotionPage, EntityTypes.PublicPage.Id);

            //var pageTestimonial = new PublicPageModel { Name = "Testimonial" };
            //entityModelService.SaveEntity(pageTestimonial, EntityTypes.PublicPage.Id);

            //var pageClient = new PublicPageModel { Name = "Client" };
            //entityModelService.SaveEntity(pageClient, EntityTypes.PublicPage.Id);

            //var pageServicesModel = new PublicPageModel { Name = "Services", Path = "DP_Services" };
            //entityModelService.SaveEntity(pageServicesModel, EntityTypes.PublicPage.Id);

            //var pageServiceModel = new PublicPageModel { Name = "Service", Path = "DP_ServicePage" };
            //entityModelService.SaveEntity(pageServiceModel, EntityTypes.PublicPage.Id);

            //var pageProjectModel = new PublicPageModel { Name = "Project", Path = "DP_Project" };
            //entityModelService.SaveEntity(pageProjectModel, EntityTypes.PublicPage.Id);
            #endregion

            #region Save List Page Templates
            var pageGridListPage = new ListPageTemplateModel {
                Name = "GridListPage", Path = "DP_GridListPage"
            };
            var entityGridListPage = entityModelService.SaveEntity(pageGridListPage, EntityTypes.ListPageTemplate.Id) as DPModel;

            var pageArticleListPage = new ListPageTemplateModel {
                Name = "ArticleListPage", Path = "DP_ArticleListPage"
            };
            var entityArticleListPage = entityModelService.SaveEntity(pageArticleListPage, EntityTypes.ListPageTemplate.Id) as DPModel;

            //var pageFAQListPage = new ListPageTemplateModel { Name = "FAQListPage", Path = "DP_FAQListPage" };
            //var entityFAQListPage = entityModelService.SaveEntity(pageFAQListPage, EntityTypes.ListPageTemplate.Id) as DPModel;

            //var pagePortfolioListPage = new ListPageTemplateModel { Name = "PortfolioListPage", Path = "DP_PortfolioListPage" };
            //var entityPortfolioListPage = entityModelService.SaveEntity(pagePortfolioListPage, EntityTypes.ListPageTemplate.Id) as DPModel;

            //var pagePromotionListPage = new ListPageTemplateModel { Name = "PromotionListPage", Path = "DP_PromotionListPage" };
            //var entityPromotionListPage = entityModelService.SaveEntity(pagePromotionListPage, EntityTypes.ListPageTemplate.Id) as DPModel;

            var pageDownloadListPage = new ListPageTemplateModel {
                Name = "DownloadListPage", Path = "DP_DownloadListPage"
            };
            var entityDownloadListPage = entityModelService.SaveEntity(pageDownloadListPage, EntityTypes.ListPageTemplate.Id) as DPModel;

            //var pageListPage = new ListPageTemplateModel { Name = "ListPage", Path = "DP_ListPage" };
            //entityModelService.SaveEntity(pageListPage, EntityTypes.ListPageTemplate.Id);
            #endregion

            #region Save cms entities/models
            var installBaseItemsService = EngineContext.Current.Resolve <InstallBaseItemsService>();
            installBaseItemsService.SaveCmsEntitiesAndModels();
            #endregion

            #region Save gallery templates
            //var galleryVideoPage = new GalleryPageTemplateModel { Name = "GalleryVideoPage", Path = "_DP_GalleryVideoPage" };
            //entityModelService.SaveEntity(galleryVideoPage, Singletons.EntityTypes.GalleryPageTemplate.Id);

            var galleryGridPage = new GalleryPageTemplateModel {
                Name = "GalleryGridPage", Path = "_DP_GalleryGridPage"
            };
            entityModelService.SaveEntity(galleryGridPage, Singletons.EntityTypes.GalleryPageTemplate.Id);

            var galleryGrid2Page = new GalleryPageTemplateModel {
                Name = "GalleryGrid2Page", Path = "_DP_GalleryGrid2Page"
            };
            entityModelService.SaveEntity(galleryGrid2Page, Singletons.EntityTypes.GalleryPageTemplate.Id);

            var gallerySliderPage = new GalleryPageTemplateModel {
                Name = "GallerySliderPage", Path = "_DP_GallerySliderPage"
            };
            entityModelService.SaveEntity(gallerySliderPage, Singletons.EntityTypes.GalleryPageTemplate.Id);
            #endregion

            #region Save list pages
            //save Portfolio
            //var portfolio = new ListPageModel { Name = "Portfolio", Published = true, PublicPageTemplate = entityPortfolioListPage != null ? (int?)entityPortfolioListPage.Id : null };
            //
            //entityModelService.SaveEntity(portfolio, entityTypeListPage.Id);

            var entityTypeListPage = EntityTypes.ListPage;
            //save downloads
            var downloadPage = new ListPageModel {
                Name = "Download", SearchEntityType = Singletons.EntityTypes.Download.Id, PublicPageTemplate = entityDownloadListPage.Id, IncludeInMyAccountMenu = true
            };
            entityModelService.SaveEntity(downloadPage, entityTypeListPage.Id);

            //save Article
            var article = new ListPageModel {
                Name = "Article", Published = true, SearchEntityType = Singletons.EntityTypes.Article.Id, PublicPageTemplate = entityArticleListPage != null ? (int?)entityArticleListPage.Id : null
            };
            entityModelService.SaveEntity(article, entityTypeListPage.Id);

            ////save FAQPage
            //var faq = new ListPageModel { Name = "FAQPage", Published = true, PublicPageTemplate = entityFAQListPage != null ? (int?)entityFAQListPage.Id : null };
            //entityModelService.SaveEntity(faq, entityTypeListPage.Id);

            ////save Promotion
            //var promotion = new ListPageModel { Name = "Promotion", Published = true, PublicPageTemplate = entityPromotionListPage != null ? (int?)entityPromotionListPage.Id : null };
            //entityModelService.SaveEntity(promotion, entityTypeListPage.Id);

            //save Gallery
            var gallery = new ListPageModel {
                Name = "Gallery", SearchEntityType = Singletons.EntityTypes.Gallery.Id, Published = true, PublicPageTemplate = entityGridListPage != null ? (int?)entityGridListPage.Id : null
            };
            entityModelService.SaveEntity(gallery, entityTypeListPage.Id);
            #endregion
        }
Beispiel #27
0
        public ListPage()
        {
            InitializeComponent();

            BindingContext = new ListPageModel();
        }