Exemple #1
0
        public bool UpdateSettings(NodeSettingInfo settingsInfo, int nodeId)
        {
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@NodeID", DbType.Int32, nodeId);
            cmdParams.AddInParameter("@Settings", DbType.String, SerializeSettings(settingsInfo));
            return(DBHelper.ExecuteSql("UPDATE PE_Nodes SET Settings = @Settings WHERE NodeID = @NodeID", cmdParams));
        }
        private NodeInfo GetNodesInfo()
        {
            NodeInfo        nodeById = null;
            NodeSettingInfo settings = null;
            string          str2     = BasePage.RequestStringToLower("Action", "add");

            if (str2 != null)
            {
                if (!(str2 == "modify"))
                {
                    if (str2 == "add")
                    {
                        nodeById          = new NodeInfo();
                        settings          = new NodeSettingInfo();
                        nodeById.ParentId = DataConverter.CLng(this.DropParentNode.SelectedValue);
                        nodeById.RootId   = 0;
                    }
                }
                else
                {
                    nodeById = Nodes.GetNodeById(BasePage.RequestInt32("NodeID", 0));
                    if (nodeById.IsNull)
                    {
                        settings = new NodeSettingInfo();
                    }
                    else
                    {
                        settings = nodeById.Settings;
                    }
                }
            }
            nodeById.NodeName             = this.TxtNodeName.Text;
            nodeById.NodeIdentifier       = this.TxtNodeIdentifier.Text;
            nodeById.NodeType             = NodeType.Single;
            nodeById.ListPageSavePathType = ListPagePathType.SinglePath;
            nodeById.NodePicUrl           = this.TxtNodePicUrl.Text;
            nodeById.Tips                = this.TxtTips.Text;
            nodeById.Description         = this.TxtDescription.Text;
            nodeById.MetaDescription     = this.TxtMetaDescription.Text;
            nodeById.MetaKeywords        = this.TxtMetaKeywords.Text;
            nodeById.ShowOnMenu          = Convert.ToBoolean(this.RadlShowOnMenu.SelectedValue);
            nodeById.DefaultTemplateFile = this.FileCdefaultListTmeplate.Text;
            if (this.RadOpenType0.Checked)
            {
                nodeById.OpenType = 0;
            }
            if (this.RadOpenType1.Checked)
            {
                nodeById.OpenType = 1;
            }
            nodeById.IsCreateListPage = DataConverter.CBoolean(this.RadlIsCreate.SelectedValue);
            nodeById.ListPageHtmlRule = this.TxtPageHtmlDir.Text;
            nodeById.ListPagePostfix  = this.PagePostfix.Value;
            nodeById.Settings         = settings;
            return(nodeById);
        }
        private NodeInfo GetNodesInfo()
        {
            NodeInfo        nodeById = Nodes.GetNodeById(BasePage.RequestInt32("NodeId", 0));
            NodeSettingInfo info2    = new NodeSettingInfo();

            nodeById.NodeName       = this.TxtNodeName.Text;
            nodeById.NodeIdentifier = this.TxtNodeIdentifier.Text;
            nodeById.NodeType       = NodeType.Link;
            nodeById.NodePicUrl     = this.TxtNodePicUrl.Text;
            nodeById.Tips           = this.TxtTips.Text;
            nodeById.ShowOnMenu     = DataConverter.CBoolean(this.RadlShowOnPath.SelectedValue);
            nodeById.OpenType       = DataConverter.CLng(this.RadlOpenType.SelectedValue);
            nodeById.LinkUrl        = this.TxtLinkUrl.Text;
            nodeById.Settings       = info2;
            nodeById.RootId         = 0;
            return(nodeById);
        }
Exemple #4
0
        public NodeInfo GetNodeById(int nodeId)
        {
            NodeInfo   info;
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@NodeID", DbType.Int32, nodeId);
            using (NullableDataReader reader = DBHelper.ExecuteReaderProc("PR_Contents_Nodes_GetById", cmdParams))
            {
                if (reader.Read())
                {
                    return(NodesFromrdr(reader));
                }
                info = new NodeInfo(true);
                NodeSettingInfo info2 = new NodeSettingInfo(true);
                info.Settings = info2;
            }
            return(info);
        }
Exemple #5
0
 public static bool BatchUpdate(NodeInfo nodeInfo, string nodesId, Dictionary <string, bool> checkItem)
 {
     foreach (NodeInfo info in GetNodesList(nodesId))
     {
         NodeSettingInfo settings = info.Settings;
         if (checkItem["EnableComment"])
         {
             settings.EnableComment         = nodeInfo.Settings.EnableComment;
             settings.CommentNeedCheck      = nodeInfo.Settings.CommentNeedCheck;
             settings.EnableTouristsComment = nodeInfo.Settings.EnableTouristsComment;
         }
         if (checkItem["EnableProtect"])
         {
             settings.EnableProtect = nodeInfo.Settings.EnableProtect;
         }
         if (checkItem["EnableAddWhenHasChild"])
         {
             settings.EnableAddWhenHasChild = nodeInfo.Settings.EnableAddWhenHasChild;
         }
         if (checkItem["PresentExp"])
         {
             settings.PresentExp = nodeInfo.Settings.PresentExp;
         }
         if (checkItem["DefaultItemPoint"])
         {
             settings.DefaultItemPoint = nodeInfo.Settings.DefaultItemPoint;
         }
         if (checkItem["ShowChargeType"])
         {
             settings.DefaultItemChargeType = nodeInfo.Settings.DefaultItemChargeType;
             settings.DefaultItemPitchTime  = nodeInfo.Settings.DefaultItemPitchTime;
             settings.DefaultItemReadTimes  = nodeInfo.Settings.DefaultItemReadTimes;
         }
         if (checkItem["DefaultItemDividePercent"])
         {
             settings.DefaultItemDividePercent = nodeInfo.Settings.DefaultItemDividePercent;
         }
         dal.UpdateSettings(settings, info.NodeId);
     }
     BatchUpdateField(nodeInfo, nodesId, checkItem);
     RemoveCacheAllNodeInfo();
     return(true);
 }
        private NodeInfo GetNodesInfo()
        {
            NodeInfo        info  = new NodeInfo();
            NodeSettingInfo info2 = new NodeSettingInfo();

            if (this.RadOpenType0.Checked)
            {
                info.OpenType = 0;
            }
            if (this.RadOpenType1.Checked)
            {
                info.OpenType = 1;
            }
            if (this.RadPurviewType0.Checked)
            {
                info.PurviewType = 0;
            }
            if (this.RadPurviewType1.Checked)
            {
                info.PurviewType = 1;
            }
            if (this.RadPurviewType2.Checked)
            {
                info.PurviewType = 2;
            }
            info2.EnableComment         = this.ChkEnableComment.Checked;
            info2.CommentNeedCheck      = this.ChkCommentNeedCheck.Checked;
            info2.EnableTouristsComment = this.ChkEnableTouristsComment.Checked;
            info.WorkFlowId             = DataConverter.CLng(this.DropWorkFlow.SelectedValue);
            info2.EnableProtect         = Convert.ToBoolean(this.RadlEnableProtect.SelectedValue);
            info2.EnableAddWhenHasChild = Convert.ToBoolean(this.RadlEnableAddWhenHasChild.SelectedValue);
            info.HitsOfHot = DataConverter.CLng(this.TxtHitsOfHot.Text);
            if (this.RadNeedCache1.Checked)
            {
                info2.IsSetCache = true;
                info2.CacheTime  = DataConverter.CLng(this.TxtCacheTime.Text);
            }
            if (this.RadNeedCache0.Checked)
            {
                info2.IsSetCache = false;
                info2.CacheTime  = 0;
            }
            info2.PresentExp               = DataConverter.CLng(this.TxtPresentExp.Text);
            info2.DefaultItemPoint         = DataConverter.CLng(this.TxtDefaultItemPoint.Text);
            info2.DefaultItemChargeType    = this.ShowChargeType.ChargeType;
            info2.DefaultItemPitchTime     = this.ShowChargeType.PitchTime;
            info2.DefaultItemReadTimes     = this.ShowChargeType.ReadTimes;
            info2.DefaultItemDividePercent = DataConverter.CLng(this.TxtDefaultItemDividePercent.Text);
            info.DefaultTemplateFile       = this.FileCdefaultListTmeplate.Text;
            info.ContainChildTemplateFile  = this.FileContainChildTemplate.Text;
            info.ShowOnMenu           = Convert.ToBoolean(this.RadlShowOnMenu.SelectedValue);
            info.ShowOnPath           = Convert.ToBoolean(this.RadlShowOnPath.SelectedValue);
            info.ShowOnMap            = Convert.ToBoolean(this.RadlShowOnMap.SelectedValue);
            info.ShowOnListIndex      = Convert.ToBoolean(this.RadlShowOnListIndex.SelectedValue);
            info.ShowOnListParent     = Convert.ToBoolean(this.RadlShowOnListParent.SelectedValue);
            info.ItemListOrderType    = DataConverter.CLng(this.DrpItemListOrderType.SelectedValue);
            info.ItemOpenType         = DataConverter.CLng(this.DrpItemOpenType.SelectedValue);
            info.ItemPageSize         = DataConverter.CLng(this.CombItemPageSize.Value);
            info.IsCreateContentPage  = DataConverter.CBoolean(this.RadlIsContentPageCreate.SelectedValue);
            info.IsCreateListPage     = DataConverter.CBoolean(this.RadlIsListPageCreate.SelectedValue);
            info.ListPageSavePathType = (ListPagePathType)Enum.Parse(typeof(ListPagePathType), this.RadlListPageHtmlDirType.SelectedValue);
            info.ListPagePostfix      = this.PagePostfix.Value;
            info.AutoCreateHtmlType   = (AutoCreateHtmlType)Enum.Parse(typeof(AutoCreateHtmlType), this.RadlAutoCreateHtmlType.SelectedValue);
            info.ContentPageHtmlRule  = this.TxtContentHtmlDir.Value + "/" + this.TxtContentHtmlFile.Value + "." + this.TxtContentHtmlExt.Value;
            info.RelateNode           = this.GetSelectArrFromListControl(this.LstRelationNodes).ToString();
            info.RelateSpecial        = this.GetSelectArrFromListControl(this.LstRelationSpecial).ToString();
            info.Settings             = info2;
            info.RootId = 0;
            return(info);
        }
Exemple #7
0
 private static string SerializeSettings(NodeSettingInfo nodeSettingInfo)
 {
     return(ser.SerializeField(nodeSettingInfo));
 }