Exemplo n.º 1
0
        public void Create_OnClick(object sender, EventArgs e)
        {
            if (!Page.IsPostBack || !Page.IsValid)
            {
                return;
            }

            var specialIdList = new List <int>();

            foreach (ListItem item in LbSpecialIdList.Items)
            {
                if (!item.Selected)
                {
                    continue;
                }

                var specialId = TranslateUtils.ToInt(item.Value);
                specialIdList.Add(specialId);
            }

            if (specialIdList.Count == 0)
            {
                FailMessage("请选择需要生成的专题!");
                return;
            }

            foreach (var specialId in specialIdList)
            {
                CreateManager.CreateSpecial(SiteId, specialId);
            }

            PageUtils.Redirect(CmsPages.GetCreateStatusUrl(SiteId));
        }
Exemplo n.º 2
0
        public void Create_OnClick(object sender, EventArgs e)
        {
            if (!Page.IsPostBack || !Page.IsValid)
            {
                return;
            }

            var templateIdList = new List <int>();

            foreach (ListItem item in LbTemplateIdList.Items)
            {
                if (!item.Selected)
                {
                    continue;
                }

                var templateId = int.Parse(item.Value);
                templateIdList.Add(templateId);
            }

            if (templateIdList.Count == 0)
            {
                FailMessage("请选择需要生成的文件页!");
                return;
            }

            foreach (var templateId in templateIdList)
            {
                CreateManager.CreateFile(SiteId, templateId);
            }

            PageUtils.Redirect(CmsPages.GetCreateStatusUrl(SiteId));
        }