⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 categorybatchset.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
📖 第 1 页 / 共 3 页
字号:
namespace PowerEasy.WebSite.Admin.Contents
{
    using PowerEasy.AccessManage;
    using PowerEasy.Common;
    using PowerEasy.CommonModel;
    using PowerEasy.Components;
    using PowerEasy.Contents;
    using PowerEasy.Controls;
    using PowerEasy.Enumerations;
    using PowerEasy.Model.AccessManage;
    using PowerEasy.Model.CommonModel;
    using PowerEasy.Model.Contents;
    using PowerEasy.Model.UserManage;
    using PowerEasy.ModelControls;
    using PowerEasy.Templates;
    using PowerEasy.UserManage;
    using PowerEasy.Web.UI;
    using PowerEasy.WebSite.Controls;
    using PowerEasy.WorkFlows;
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class CategoryBatchSet : AdminPage
    {
        protected Button BtnCancel;
        protected CheckBox ChkAutoCreateHtmlType;
        protected CheckBox ChkCommentNeedCheck;
        protected CheckBox ChkContentHtmlDir;
        protected CheckBox ChkContentPageCreateHtmlType;
        protected CheckBox ChkDefaultItemDividePercent;
        protected CheckBox ChkDefaultItemPoint;
        protected CheckBox ChkEnableAddWhenHasChild;
        protected CheckBox ChkEnableComment;
        protected CheckBox ChkEnableComment2;
        protected CheckBox ChkEnableProtect;
        protected CheckBox ChkEnableTouristsComment;
        protected CheckBox ChkFileCdefaultListTmeplate;
        protected CheckBox ChkFileContainChildTemplate;
        protected CheckBox ChkFileCTemplate;
        protected CheckBox ChkHitsOfHot;
        protected CheckBox ChkIsSetCache;
        protected CheckBox ChkItemListOrderType;
        protected CheckBox ChkItemOpenType;
        protected CheckBox ChkItemPageSize;
        protected CheckBox ChkListPageCreateHtmlType;
        protected CheckBox ChkListPageHtmlDirType;
        protected CheckBox ChkOpenType;
        protected CheckBox ChkPagePostfix;
        protected CheckBox ChkPermissions;
        protected CheckBox ChkPresentExp;
        protected CheckBox ChkPurviewType;
        protected CheckBox ChkRelation;
        protected CheckBox ChkShowChargeType;
        protected CheckBox ChkShowOnListIndex;
        protected CheckBox ChkShowOnListParent;
        protected CheckBox ChkShowOnMap;
        protected CheckBox ChkShowOnMenu;
        protected CheckBox ChkShowOnPath;
        protected CheckBox ChkWorkFlow;
        protected ComboBox CombItemPageSize;
        protected DropDownList DropWorkFlow;
        protected DropDownList DrpItemListOrderType;
        protected DropDownList DrpItemOpenType;
        protected Button EBtnBacthSet;
        protected ExtendedGridView EgvPermissions;
        protected ExtendedGridView EgvRoleView;
        protected TemplateSelectControl FileCdefaultListTmeplate;
        protected TemplateSelectControl FileContainChildTemplate;
        protected ListBox LstNodes;
        protected ListBox LstRelationNodes;
        protected ListBox LstRelationSpecial;
        protected ComboBox PagePostfix;
        protected RadioButtonList RadlAutoCreateHtmlType;
        protected RadioButtonList RadlEnableAddWhenHasChild;
        protected RadioButtonList RadlEnableProtect;
        protected RadioButtonList RadlIsContentPageCreate;
        protected RadioButtonList RadlIsListPageCreate;
        protected RadioButtonList RadlListPageHtmlDirType;
        protected RadioButtonList RadlShowOnListIndex;
        protected RadioButtonList RadlShowOnListParent;
        protected RadioButtonList RadlShowOnMap;
        protected RadioButtonList RadlShowOnMenu;
        protected RadioButtonList RadlShowOnPath;
        protected RadioButton RadNeedCache0;
        protected RadioButton RadNeedCache1;
        protected RadioButton RadOpenType0;
        protected RadioButton RadOpenType1;
        protected RadioButton RadPurviewType0;
        protected RadioButton RadPurviewType1;
        protected RadioButton RadPurviewType2;
        protected Repeater RepContentModelTemplate;
        protected Repeater RepShopModelTemplate;
        protected HtmlTableRow SelectRelation;
        protected ChargeTypeSetting ShowChargeType;
        protected ScriptManager SmCategory;
        protected ExtendedSiteMapPath SmpNavigator;
        protected HtmlTableCell TabTitle2;
        protected HtmlTableCell TabTitle5;
        protected HtmlTableCell TdGroupPermissions;
        protected HtmlTableCell TdRolePermissions;
        protected TextBox TxtCacheTime;
        protected ComboBox TxtContentHtmlDir;
        protected ComboBox TxtContentHtmlExt;
        protected ComboBox TxtContentHtmlFile;
        protected TextBox TxtDefaultItemDividePercent;
        protected TextBox TxtDefaultItemPoint;
        protected TextBox TxtHitsOfHot;
        protected TextBox TxtPresentExp;
        protected System.Web.UI.UpdatePanel UpPermissions;
        protected System.Web.UI.UpdatePanel UpPurviewType;
        protected RangeValidator ValgCacheTime;
        protected RangeValidator ValgDefaultItemPoint;
        protected RangeValidator ValgHitsOfHot;
        protected RangeValidator ValgPresentExp;

        private static void AppendSelectId(bool isChecked, StringBuilder roleIdList, string selectId)
        {
            if (isChecked)
            {
                StringHelper.AppendString(roleIdList, selectId);
            }
        }

        protected void BtnCancel_Click(object sender, EventArgs e)
        {
            BasePage.ResponseRedirect("CategoryManage.aspx");
        }

        protected void EBtnBacthSet_Click(object sender, EventArgs e)
        {
            if (this.Page.IsValid)
            {
                StringBuilder builder = new StringBuilder();
                foreach (ListItem item in this.LstNodes.Items)
                {
                    int num;
                    if (item.Selected && int.TryParse(item.Value, out num))
                    {
                        builder.Append(item.Value);
                        builder.Append(",");
                    }
                }
                if (builder.Length > 0)
                {
                    builder.Remove(builder.Length - 1, 1);
                }
                else
                {
                    AdminPage.WriteErrMsg("请先选择要批量设置的节点!");
                }
                if (Nodes.BatchUpdate(this.GetNodesInfo(), builder.ToString(), this.GetCheckItem()))
                {
                    if (this.ChkPermissions.Checked)
                    {
                        foreach (string str in builder.ToString().Split(new char[] { ',' }))
                        {
                            this.InputPermissions(DataConverter.CLng(str));
                            this.InputRolePermission(DataConverter.CLng(str));
                        }
                    }
                    if (this.ChkFileCTemplate.Checked)
                    {
                        IList<NodesModelTemplateRelationShipInfo> dataFromRepeater = this.GetDataFromRepeater();
                        foreach (string str2 in builder.ToString().Split(new char[] { ',' }))
                        {
                            ModelManager.UpdateNodesModelTemplateRelationShip(DataConverter.CLng(str2), dataFromRepeater);
                        }
                    }
                    IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Node);
                    base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload()</script>");
                    AdminPage.WriteSuccessMsg("批量设置成功!", "CategoryManage.aspx");
                }
                else
                {
                    AdminPage.WriteErrMsg("批量设置失败!");
                }
            }
        }

        protected void EgvPermissions_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                UserGroupsInfo dataItem = (UserGroupsInfo) e.Row.DataItem;
                CheckBox box = (CheckBox) e.Row.FindControl("ChkNodeSkim");
                CheckBox box2 = (CheckBox) e.Row.FindControl("ChkNodeShow");
                CheckBox box3 = (CheckBox) e.Row.FindControl("ChkNodeInput");
                foreach (RoleNodePermissionsInfo info2 in UserPermissions.GetAllNodePermissionsById(dataItem.GroupId, BasePage.RequestInt32("NodeId"), 1))
                {
                    bool flag = info2.NodeId != -1;
                    if (info2.OperateCode == OperateCode.NodeContentSkim)
                    {
                        box.Checked = true;
                        if (!flag)
                        {
                            box.Enabled = flag;
                        }
                    }
                    if (info2.OperateCode == OperateCode.NodeContentPreview)
                    {
                        box2.Checked = true;
                        if (!flag)
                        {
                            box2.Enabled = flag;
                        }
                    }
                    if (info2.OperateCode == OperateCode.NodeContentInput)
                    {
                        box3.Checked = true;
                        if (flag)
                        {
                            continue;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -