コード例 #1
0
        private void Add()
        {
            DataTable newContentData = ContentManage.GetNewContentData(this.GetDataTableFromRepeater());

            if (ContentManage.Add(this.m_ModelId, newContentData))
            {
                ModelInfo modelInfoById = ModelManager.GetModelInfoById(this.m_ModelId);
                if (modelInfoById.EnableSignIn)
                {
                    this.AddSignin(newContentData);
                }
                this.AddPermissionAndCharge(newContentData, modelInfoById.EnableCharge);
                this.SavePresentExp(newContentData, true);
                if (((SignInType)Enum.Parse(typeof(SignInType), this.DrpSigninType.SelectedValue)) != SignInType.EnableSignInPrivate)
                {
                    HtmlContent.CreateHtml(newContentData);
                }
                this.AddKeywordsToTable(newContentData);
                int generalId = GetGeneralId(newContentData);
                if (modelInfoById.EnbaleVote)
                {
                    this.Vote.Add(generalId);
                }
                SiteCache.Remove("CK_Page_Category_" + this.m_NodeId.ToString());
                BasePage.ResponseRedirect(AdminPage.AppendSecurityCode("ContentShowSuccess.aspx?Action=Add&GeneralID=" + generalId.ToString() + "&NodeID=" + this.m_NodeId.ToString() + "&ModelID=" + this.m_ModelId.ToString() + "&ContentFieldName=" + this.m_ContentFieldName));
            }
        }
コード例 #2
0
        private void Add()
        {
            DataTable      newContentData = ContentManage.GetNewContentData(this.GetDataTableFromRepeater());
            UserGroupsInfo userGroupById  = UserGroups.GetUserGroupById(-2);

            if (userGroupById.IsNull || string.IsNullOrEmpty(userGroupById.GroupSetting))
            {
                DynamicPage.WriteErrMsg("匿名会员组不存在!");
            }
            else
            {
                UserPurviewInfo groupSetting = UserGroups.GetGroupSetting(userGroupById.GroupSetting);
                if (groupSetting.IsNull)
                {
                    DynamicPage.WriteErrMsg("匿名会员组没有进行权限设置!");
                }
                if (groupSetting.PublicInfoNoNeedCheck)
                {
                    DataRow[] rowArray = newContentData.Select("FieldName = 'status'");
                    if (rowArray[0]["FieldValue"].ToString() == "0")
                    {
                        rowArray[0]["FieldValue"] = "99";
                    }
                }
            }
            if (ContentManage.Add(this.m_ModelId, newContentData))
            {
                this.AddKeywordsToTable(newContentData);
                DynamicPage.WriteSuccessMsg("添加成功!", "../../Default.aspx");
            }
            else
            {
                DynamicPage.WriteErrMsg("添加失败!");
            }
        }
コード例 #3
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            int nodeId = DataConverter.CLng(this.DropCategoryId.SelectedValue);

            if (nodeId == 0)
            {
                nodeId = this.m_NodeId;
            }
            if (nodeId == 0)
            {
                DynamicPage.WriteErrMsg("<li>节点ID不存在!</li>");
            }
            NodeInfo cacheNodeById = EasyOne.Contents.Nodes.GetCacheNodeById(nodeId);

            if (cacheNodeById.IsNull)
            {
                DynamicPage.WriteErrMsg("<li>栏目节点不存在!</li>");
            }
            DataTable contentData    = this.GetContentData(nodeId);
            string    successMessage = "您的留言已经提交请等待管理员的审核!";

            if (cacheNodeById.WorkFlowId == -1)
            {
                contentData.Select("FieldName = 'status'")[0]["FieldValue"] = "99";
                successMessage = "您的留言已经发送成功!";
            }
            if (ContentManage.Add(this.m_ModelId, contentData))
            {
                DynamicPage.WriteSuccessMsg(successMessage, SiteConfig.SiteInfo.VirtualPath + "Category_" + this.m_NodeId.ToString() + "/index.aspx");
            }
            else
            {
                DynamicPage.WriteErrMsg("发表留言失败!");
            }
        }
コード例 #4
0
        private void Add()
        {
            DataTable newContentData = ContentManage.GetNewContentData(this.GetDataTableFromRepeater());

            if (this.m_UserPurviewInfo == null)
            {
                this.m_UserPurviewInfo = new UserPurviewInfo();
                this.m_UserPurviewInfo.MaxPublicInfoOneDay = -1;
                this.m_UserPurviewInfo.GetExp = 1;
            }
            if ((this.m_UserPurviewInfo.MaxPublicInfoOneDay == 0) || (this.m_UserPurviewInfo.MaxPublicInfoOneDay > ContentManage.GetTodayPublicInfoCountByUserName(PEContext.Current.User.UserName)))
            {
                if (this.m_UserPurviewInfo.PublicInfoNoNeedCheck)
                {
                    DataRow[] rowArray = newContentData.Select("FieldName = 'status'");
                    if (rowArray[0]["FieldValue"].ToString() == "0")
                    {
                        rowArray[0]["FieldValue"] = "99";
                    }
                }
                this.SavePresentExp(newContentData, this.m_UserPurviewInfo, this.m_User);
                if (ContentManage.Add(this.m_ModelId, newContentData))
                {
                    if (ModelManager.GetModelInfoById(this.m_ModelId).EnableCharge)
                    {
                        this.AddCharge(newContentData);
                    }
                    this.AddKeywordsToTable(newContentData);
                    DynamicPage.WriteUserSuccessMsg("添加成功!", "ContentManage.aspx");
                }
                else
                {
                    DynamicPage.WriteUserErrMsg("添加失败!");
                }
            }
            else
            {
                DynamicPage.WriteUserErrMsg("你今天发布的内容信息总数大于网站设定的值,如要添加请与管理员联系!");
            }
        }