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));
            }
        }
        private void Update()
        {
            DataTable dataTableFromRepeater = this.GetDataTableFromRepeater();
            int       generalId             = BasePage.RequestInt32("GeneralID");

            this.SavePresentExp(dataTableFromRepeater, false);
            if (ContentManage.Update(generalId, ContentManage.GetNewContentData(dataTableFromRepeater)))
            {
                ModelInfo modelInfoById = ModelManager.GetModelInfoById(this.m_ModelId);
                this.AddPermissionAndCharge(dataTableFromRepeater, modelInfoById.EnableCharge);
                if (modelInfoById.EnableSignIn)
                {
                    this.UpdateSignin(generalId, dataTableFromRepeater);
                }
                if (((SignInType)Enum.Parse(typeof(SignInType), this.DrpSigninType.SelectedValue)) != SignInType.EnableSignInPrivate)
                {
                    HtmlContent.CreateHtml(dataTableFromRepeater);
                }
                this.UpdateKeywordsToTable(generalId, dataTableFromRepeater);
                if (modelInfoById.EnbaleVote)
                {
                    this.Vote.Add(generalId);
                }
                SiteCache.Remove("CK_Page_Category_" + this.m_NodeId.ToString());
                BasePage.ResponseRedirect(AdminPage.AppendSecurityCode("ContentShowSuccess.aspx?Action=Modify&GeneralID=" + generalId.ToString() + "&NodeID=" + this.m_NodeId.ToString() + "&ModelID=" + this.m_ModelId.ToString() + "&ContentFieldName=" + this.m_ContentFieldName));
            }
            else
            {
                AdminPage.WriteErrMsg("修改失败!");
            }
        }
Example #3
0
        private void ShowPkZoneInfo(RepeaterItemEventArgs e, Label LblNetizen, Label LblNetizenContent, Label LblNetizenTime, Label LblNetizenIp, Label LblDelete)
        {
            CommentPKZoneInfo dataItem = (CommentPKZoneInfo)e.Item.DataItem;

            LblNetizen.Text        = dataItem.UserName;
            LblNetizenContent.Text = dataItem.Content;
            LblNetizenTime.Text    = dataItem.UpdateTime.ToString();
            LblNetizenIp.Text      = dataItem.IP;
            if (!string.IsNullOrEmpty(PEContext.Current.Admin.UserName))
            {
                LblDelete.Text = "操作:<a href='" + AdminPage.AppendSecurityCode("CommentPKZoneManage.aspx?Action=Delete&PKId=" + dataItem.PKId.ToString() + "&CommentID=" + BasePage.RequestInt32("CommentID").ToString() + "&Title=" + BasePage.RequestString("Title")) + "' >删除</a>";
            }
        }
        protected void EgvUserGroup_RowCommand(object sender, CommandEventArgs e)
        {
            string str;
            bool   flag = false;
            int    num  = DataConverter.CLng(e.CommandArgument);

            if (((str = e.CommandName) != null) && (str == "DeleteUserGroup"))
            {
                BasePage.ResponseRedirect(AdminPage.AppendSecurityCode("UserGroupManage.aspx?Action=Delete&GroupId=" + num.ToString()));
            }
            if (flag)
            {
                AdminPage.WriteSuccessMsg("删除角色成功!", "RoleManage.aspx");
            }
        }
Example #5
0
 protected void RptCommentContent_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
     {
         Label label = e.Item.FindControl("LblNum") as Label;
         if (this.floorNumber == 0)
         {
             label.Text = "楼主";
         }
         else
         {
             label.Text = "第<span style='color:Red'>" + this.floorNumber.ToString() + "</span>楼";
         }
         this.floorNumber++;
         Label label2 = e.Item.FindControl("LblUserFace") as Label;
         if (!string.IsNullOrEmpty(((CommentInfo)e.Item.DataItem).UserFace))
         {
             label2.Text = string.Concat(new object[] { "<img alt='' src='", ((CommentInfo)e.Item.DataItem).UserFace, "' width='", ((CommentInfo)e.Item.DataItem).FaceWidth, "' height='", ((CommentInfo)e.Item.DataItem).FaceHeight, "' />" });
         }
         else
         {
             label2.Text = "<img alt='' src='../Images/Comment/01.gif' width='80' height='90' />";
         }
         Label label3 = e.Item.FindControl("LblContent") as Label;
         label3.Text = ((CommentInfo)e.Item.DataItem).Content;
         StringBuilder builder = new StringBuilder();
         builder.Append("<table class='Reply' cellspacing='0' cellpadding='6' width='95%' border='0'>");
         builder.Append("<tr>");
         builder.Append("  <td class='ReplyAdminTd' >");
         builder.Append("    <span class='ReplyAdmin'>管理员回复</span>:<br/>");
         builder.Append(((CommentInfo)e.Item.DataItem).Reply);
         builder.Append("<br/>");
         builder.Append("<p align='right'>" + ((CommentInfo)e.Item.DataItem).ReplyDateTime.ToString() + "</span>");
         builder.Append("</td>");
         builder.Append("</tr>");
         builder.Append("</table>");
         if (!((CommentInfo)e.Item.DataItem).ReplyIsPrivate && !string.IsNullOrEmpty(((CommentInfo)e.Item.DataItem).Reply))
         {
             label3.Text = label3.Text + builder.ToString();
         }
         string str    = "ListType=" + BasePage.RequestInt32("ListType").ToString() + "&CommentID=" + ((CommentInfo)e.Item.DataItem).CommentId.ToString() + "&GeneralID=" + BasePage.RequestInt32("GeneralId").ToString() + "&title=" + base.Server.UrlEncode(BasePage.RequestString("Title"));
         Label  label4 = e.Item.FindControl("LblAuditing") as Label;
         if (((CommentInfo)e.Item.DataItem).Status)
         {
             label4.Text = "<span style='color:green'><a href='" + AdminPage.AppendSecurityCode("ContentCommentManage.aspx?Action=UnAudited&" + str) + "'>取消审核</a></span>";
         }
         else
         {
             label4.Text = "<span style='color:blue'><a href='" + AdminPage.AppendSecurityCode("ContentCommentManage.aspx?Action=Audited&" + str) + "'>通过审核</a></span>";
         }
         Label label5 = e.Item.FindControl("LblIsElite") as Label;
         if (((CommentInfo)e.Item.DataItem).IsElite)
         {
             label5.Text = "<span style='color:green'><a href='" + AdminPage.AppendSecurityCode("ContentCommentManage.aspx?Action=UnPremier&" + str) + "'>取消精华</a></span>";
         }
         else
         {
             label5.Text = "<span style='color:blue'><a href='" + AdminPage.AppendSecurityCode("ContentCommentManage.aspx?Action=Premier&" + str) + "'>设置为精华</a></span>";
         }
         if (!SiteConfig.SiteOption.EnablePointMoneyExp)
         {
             e.Item.FindControl("UserExp").Visible = false;
         }
     }
 }
Example #6
0
        private void RegisterRightMenuJs()
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("<script language=\"JavaScript\" type=\"text/javascript\">\n");
            builder.Append("<!--\n");
            builder.Append("function rightMenu(nodeId,arrModelId,arrModelName,event,extra,nodeType,arrPurview) {\n");
            builder.Append("    var toolMenu = new WebFXMenu;\n");
            builder.Append("    toolMenu.width = 100;\n");
            builder.Append("    var isMenu = false;\n");
            builder.Append("    if(nodeId == 'root')\n");
            builder.Append("    {\n");
            if (RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, -1) || PEContext.Current.Admin.IsSuperAdmin)
            {
                builder.Append("        toolMenu.add(new WebFXMenuItem('添加栏目节点','javascript:going(\"addNode\",\"\",\"' + nodeId + '\")','添加栏目节点'));\n");
                builder.Append("        toolMenu.add(new WebFXMenuItem('添加单页节点','javascript:going(\"single\",\"\",\"' + nodeId + '\")','添加单页节点'));\n");
                builder.Append("        toolMenu.add(new WebFXMenuItem('添加外部链接','javascript:going(\"link\",\"\",\"' + nodeId + '\")','添加外部链接'));\n");
                builder.Append("        isMenu = true;\n");
            }
            builder.Append("    } \n");
            builder.Append("    else \n");
            builder.Append("    {\n");
            builder.Append("        var currentNodesManage = arrPurview.indexOf(\"1\");\n");
            builder.Append("        var childNodesManage = arrPurview.indexOf(\"2\");\n");
            builder.Append("        switch(nodeType) {\n");
            builder.Append("          case \"Container\": \n");
            builder.Append("              if (currentNodesManage >= 0)\n");
            builder.Append("              {\n");
            builder.Append("                  toolMenu.add(new WebFXMenuItem('修改设置','javascript:going(\"setNode\",\"\",\"' + nodeId + '\")','修改设置'));\n");
            builder.Append("                  toolMenu.add(new WebFXMenuItem('复制节点','javascript:going(\"copyNode\",\"\",\"' + nodeId + '\")','复制节点'));\n");
            builder.Append("              }\n");
            builder.Append("              if (childNodesManage >= 0)\n");
            builder.Append("              {\n");
            builder.Append("                  toolMenu.add(new WebFXMenuItem('添加子节点','javascript:going(\"addChildNode\",\"\",\"' + nodeId + '\")','添加子节点'));\n");
            builder.Append("                  toolMenu.add(new WebFXMenuItem('添加单页节点','javascript:going(\"single\",\"\",\"' + nodeId + '\")','添加单页节点'));\n");
            builder.Append("                  toolMenu.add(new WebFXMenuItem('添加外部链接','javascript:going(\"link\",\"\",\"' + nodeId + '\")','添加外部链接'));\n");
            builder.Append("                  if(arrModelName == 'child')\n");
            builder.Append("                  {\n");
            builder.Append("                      toolMenu.add(new WebFXMenuItem('复位子节点','javascript:going(\"resetChildNode\",\"\",\"' + nodeId + '\")','复位子节点 '));\n");
            builder.Append("                  } \n");
            builder.Append("                  isMenu = true;\n");
            builder.Append("              }\n");
            builder.Append("              if (currentNodesManage >= 0)\n");
            builder.Append("              {\n");
            builder.Append("                  toolMenu.add(new WebFXMenuItem('移动节点','javascript:going(\"move\",\"\",\"' + nodeId + '\")','移动节点'));\n");
            builder.Append("                  toolMenu.add(new WebFXMenuItem('清空节点','javascript:going(\"clear\",\"\",\"' + nodeId + '\")','清空节点'));\n");
            builder.Append("                  if(nodeId!=-2){toolMenu.add(new WebFXMenuItem('删除节点','javascript:going(\"delete\",\"\",\"' + nodeId + '\")','删除节点'));}\n");
            builder.Append("                  isMenu = true;\n");
            builder.Append("              }\n");
            builder.Append("              break;\n");
            builder.Append("          case \"Link\": \n");
            builder.Append("          case \"Single\": \n");
            builder.Append("              if (currentNodesManage >= 0)\n");
            builder.Append("              {\n");
            builder.Append("                  isMenu = true;\n");
            builder.Append("                  toolMenu.add(new WebFXMenuItem('修改设置','javascript:going(\"setNode\",\"\",\"' + nodeId + '\")','修改设置'));\n");
            builder.Append("                  if(nodeId!=-2)");
            builder.Append("                  {    toolMenu.add(new WebFXMenuItem('复制节点','javascript:going(\"copyNode\",\"\",\"' + nodeId + '\")','复制节点'));\n");
            builder.Append("                      toolMenu.add(new WebFXMenuItem('删除节点','javascript:going(\"delete\",\"\",\"' + nodeId + '\")','删除节点'));}\n");
            builder.Append("              }\n");
            builder.Append("              break;\n");
            builder.Append("       }\n");
            builder.Append("    }\n");
            builder.Append("    if (isMenu == true) {\n");
            builder.Append("      document.getElementById(\"menudata\").innerHTML = toolMenu;\n");
            builder.Append("      var yScrolltop;\n");
            builder.Append("      var xScrollleft;\n");
            builder.Append("      if (self.pageYOffset || self.pageXOffset) {\n");
            builder.Append("          yScrolltop = self.pageYOffset;\n");
            builder.Append("          xScrollleft = self.pageXOffset;\n");
            builder.Append("      } else if (document.documentElement && document.documentElement.scrollTop || document.documentElement.scrollLeft ){// Explorer 6 Strict \n");
            builder.Append("          yScrolltop = document.documentElement.scrollTop;\n");
            builder.Append("          xScrollleft = document.documentElement.scrollLeft;\n");
            builder.Append("      } else if (document.body) {// all other Explorers\n");
            builder.Append("          yScrolltop = document.body.scrollTop;\n");
            builder.Append("          xScrollleft = document.body.scrollLeft;\n");
            builder.Append("      }\n");
            builder.Append("      toolMenu.left = event.clientX + xScrollleft;\n");
            builder.Append("      toolMenu.top = event.clientY + document.body.scrollTop + yScrolltop;\n");
            builder.Append("      toolMenu.show();\n");
            builder.Append("    }\n");
            builder.Append("}\n");
            builder.Append("function going(type,modelId,nodeId)\n");
            builder.Append("{\n");
            builder.Append("    if(type==\"addcontent\")\n");
            builder.Append("    {\n");
            builder.Append("        var url = \"Content.aspx?Action=add&NodeId=\" + nodeId + \"&ModelID=\" + modelId;\n");
            builder.Append("          JumpToMainRight(url);\n");
            builder.Append("    }\n");
            builder.Append("    if(type==\"setNode\")\n");
            builder.Append("    {\n");
            builder.Append("        var url = \"Category.aspx?Action=Modify&NodeID=\" + nodeId;\n");
            builder.Append("          JumpToMainRight(url);\n");
            builder.Append("    }\n");
            builder.Append("    if(type==\"copyNode\")\n");
            builder.Append("    {\n");
            builder.Append("        var url = \"Category.aspx?Action=Copy&NodeID=\" + nodeId;\n");
            builder.Append("          JumpToMainRight(url);\n");
            builder.Append("    }\n");
            builder.Append("    if(type==\"addChildNode\")\n");
            builder.Append("    {\n");
            builder.Append("        var url = \"Category.aspx?Action=Add&NodeID=\" + nodeId + \"&ParentID=\" + nodeId;\n");
            builder.Append("          JumpToMainRight(url);\n");
            builder.Append("    }\n");
            builder.Append("    if(type==\"addNode\")\n");
            builder.Append("    {\n");
            builder.Append("        var url = \"Category.aspx\";\n");
            builder.Append("          JumpToMainRight(url);\n");
            builder.Append("    }\n");
            builder.Append("    if(type==\"move\")\n");
            builder.Append("    {\n");
            builder.Append("        var url = \"CategoryMove.aspx?NodeID=\" + nodeId;\n");
            builder.Append("          JumpToMainRight(url);\n");
            builder.Append("    }\n");
            builder.Append("    if(type==\"clear\")\n");
            builder.Append("    {\n");
            builder.Append("        var isConfirm = confirm('清空节点将把节点(包括子节点)的所有文章放入回收站中!确定要清空此节点吗?');\n");
            builder.Append("        if(isConfirm)\n");
            builder.Append("        {\n");
            builder.Append("          var url = \"CategoryManage.aspx?Action=clear&NodeId=\" + nodeId;\n");
            builder.Append("            JumpToMainRight(url);\n");
            builder.Append("        }\n");
            builder.Append("    }\n");
            builder.Append("    if(type==\"resetChildNode\")\n");
            builder.Append("    {\n");
            builder.Append("        var isConfirm = confirm('“复位子节点”将把此节点的所有子节点都复位成二级子节点!请慎重操作!确定要复位子节点吗');\n");
            builder.Append("        if(isConfirm)\n");
            builder.Append("        {\n");
            builder.Append("          var url = \"CategoryManage.aspx?Action=ResetChildNodes&NodeID=\" + nodeId;\n");
            builder.Append("            JumpToMainRight(url);\n");
            builder.Append("        }\n");
            builder.Append("    }\n");
            builder.Append("    if(type==\"delete\")\n");
            builder.Append("    {\n");
            builder.Append("        var isConfirm = confirm('删除节点将删除该节点所有相关数据,确定要删除此节点吗?');\n");
            builder.Append("        if(isConfirm)\n");
            builder.Append("        {\n");
            builder.Append("            var url = \"" + AdminPage.AppendSecurityCode("CategoryManage.aspx?Action=Delete") + "&NodeID=\" + nodeId;\n");
            builder.Append("            JumpToMainRight(url);\n");
            builder.Append("        }\n");
            builder.Append("    }\n");
            builder.Append("    if(type==\"link\")\n");
            builder.Append("    {\n");
            builder.Append("        var url = \"OutLink.aspx?NodeId=\" + nodeId\n");
            builder.Append("          JumpToMainRight(url);\n");
            builder.Append("    }\n");
            builder.Append("    if(type==\"single\")\n");
            builder.Append("    {\n");
            builder.Append("        var url = \"Single.aspx?NodeId=\" + nodeId\n");
            builder.Append("         JumpToMainRight(url);\n");
            builder.Append("    }\n");
            builder.Append("}\n");
            builder.Append("//-->\n");
            builder.Append("</script>\n");
            this.Page.ClientScript.RegisterClientScriptBlock(base.GetType(), "EasyOne.Controls.XLoadTree.Resources.rightMenujs", builder.ToString());
        }
 protected void RptCommentContent_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
     {
         Label       label    = e.Item.FindControl("LblNum") as Label;
         Label       label2   = e.Item.FindControl("LblUserFace") as Label;
         Label       label3   = e.Item.FindControl("LblCommentContent") as Label;
         CommentInfo dataItem = (CommentInfo)e.Item.DataItem;
         Label       label4   = e.Item.FindControl("LblSustain") as Label;
         Label       label5   = e.Item.FindControl("LblOppose") as Label;
         Label       label6   = e.Item.FindControl("LblNeutralismNetizen") as Label;
         Label       label7   = e.Item.FindControl("LblPKZone") as Label;
         Label       label8   = e.Item.FindControl("LblPKAgree") as Label;
         Label       label9   = e.Item.FindControl("LblPKOppose") as Label;
         Label       label10  = e.Item.FindControl("LblExcerpt") as Label;
         Label       label11  = e.Item.FindControl("LblRestore") as Label;
         Label       label12  = e.Item.FindControl("LblDelete") as Label;
         string      str      = "CommentID=" + dataItem.CommentId.ToString() + "&GeneralId=" + this.m_GeneralId.ToString() + "&Title=" + base.Server.UrlEncode(BasePage.RequestString("Title"));
         this.m_floorNumber++;
         label4.Text = CommentPKZone.GetPKCount(dataItem.CommentId, 1).ToString();
         label5.Text = CommentPKZone.GetPKCount(dataItem.CommentId, -1).ToString();
         label6.Text = CommentPKZone.GetPKCount(dataItem.CommentId, 0).ToString();
         label.Text  = "第<span style='color:Red'>" + this.m_floorNumber.ToString() + "</span>楼";
         if (!string.IsNullOrEmpty(dataItem.UserFace))
         {
             label2.Text = "<img alt='' src='" + DataSecurity.UrlEncode(dataItem.UserFace) + "' width='80px;' />";
         }
         else
         {
             label2.Text = "<img alt='' src='" + this.Path + "/Images/Comment/01.gif' width='80' height='90' />";
         }
         Label label13 = e.Item.FindControl("LblContent") as Label;
         label13.Text = dataItem.Content;
         StringBuilder builder = new StringBuilder();
         builder.Append("信息:" + dataItem.PassedItems + "<br/>");
         if (SiteConfig.SiteOption.EnablePointMoneyExp)
         {
             builder.Append("积分:" + dataItem.UserExp + "<br/>");
         }
         builder.Append("时间:" + dataItem.UserRegTime.ToString("yyyy-MM-dd"));
         label3.Text = builder.ToString();
         StringBuilder builder2 = new StringBuilder();
         builder2.Append("<table class='Reply' cellspacing='0' cellpadding='6' width='95%' border='0'>");
         builder2.Append("<tr>");
         builder2.Append("  <td class='ReplyAdminTd' >");
         builder2.Append("    <span class='ReplyAdmin'>管理员回复</span>:<br/>");
         builder2.Append(dataItem.Reply);
         builder2.Append("<br/>");
         builder2.Append("<p align='right'>" + dataItem.ReplyDateTime.ToString() + "</span>");
         builder2.Append("</td>");
         builder2.Append("</tr>");
         builder2.Append("</table>");
         if (!dataItem.ReplyIsPrivate && !string.IsNullOrEmpty(dataItem.Reply))
         {
             label13.Text = label13.Text + builder2.ToString();
         }
         label7.Text  = " <a href='CommentPKZoneManage.aspx?" + str.ToString() + "'> PK Zone</a>";
         label8.Text  = " <a href='CommentPKZoneManage.aspx?" + str.ToString() + "' onkeydown=\"return Agree(event);\" onmouseover=\"PopupArea(event, 'Agree" + dataItem.CommentId.ToString() + "')\"   onmouseout = \"jsAreaMouseOut(event)\"> 支持</a>";
         label9.Text  = " <a href='CommentPKZoneManage.aspx?" + str.ToString() + "' onkeydown=\"return Oppose(event);\" onmouseover=\"PopupArea(event, 'Oppose" + dataItem.CommentId.ToString() + "')\"  onmouseout = \"jsAreaMouseOut(event)\"> 反对</a>";
         label10.Text = " <a href='CommentExcerpt.aspx?" + str.ToString() + "'> 信息引用</a>";
         label11.Text = " <a href='CommentRestore.aspx?" + str.ToString() + "'> 回复</a>";
         if (!string.IsNullOrEmpty(PEContext.Current.Admin.UserName))
         {
             label12.Text = "<a href='" + AdminPage.AppendSecurityCode("ContentView.aspx?Action=Delete&" + str) + "' onclick=\"return confirm('确定要删除此评论吗?');\">删除</a>";
             Label label14 = e.Item.FindControl("LblAuditing") as Label;
             if (dataItem.Status)
             {
                 label14.Text = "<span style='color:green'><a href='" + AdminPage.AppendSecurityCode("ContentView.aspx?Action=UnAudited&" + str) + "'>取消审核</a></span>";
             }
             else
             {
                 label14.Text = "<span style='color:blue'><a href='" + AdminPage.AppendSecurityCode("ContentView.aspx?Action=Audited&" + str) + "'>通过审核</a></span>";
             }
             Label label15 = e.Item.FindControl("LblIsElite") as Label;
             if (dataItem.IsElite)
             {
                 label15.Text = "<span style='color:green'><a href='" + AdminPage.AppendSecurityCode("ContentView.aspx?Action=UnPremier&" + str) + "'>取消精华</a></span>";
             }
             else
             {
                 label15.Text = "<span style='color:blue'><a href='" + AdminPage.AppendSecurityCode("ContentView.aspx?Action=Premier&" + str) + "'>设置为精华</a></span>";
             }
         }
     }
 }