Beispiel #1
0
        protected void EBtnSignIn_Click(object sender, EventArgs e)
        {
            bool          flag       = true;
            StringBuilder selectList = this.EgvContentSignIn.SelectList;

            if (selectList.Length < 1)
            {
                DynamicPage.WriteUserErrMsg("请选择要签收的项目!");
            }
            else
            {
                for (int i = 0; i < selectList.Length; i++)
                {
                    if (!SignInLog.SignIn(selectList[i], PEContext.Current.User.UserName, true, PEContext.Current.UserHostAddress))
                    {
                        flag = false;
                        break;
                    }
                }
            }
            if (flag)
            {
                DynamicPage.WriteUserSuccessMsg("<li>签收成功!</li>", "ContentSignin.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
            else
            {
                DynamicPage.WriteUserErrMsg("<li>签收失败!</li>");
            }
        }
        private void Update()
        {
            DataTable dataTableFromRepeater = this.GetDataTableFromRepeater();

            DataRow[] rowArray = dataTableFromRepeater.Select("FieldName = 'status'");
            if ((DataConverter.CLng(rowArray[0]["FieldValue"]) == 0x63) && !this.m_UserPurviewInfo.ManageSelfPublicInfo)
            {
                DynamicPage.WriteUserErrMsg("已经被审核通过,您不能再进行修改!");
            }
            DataRow[] rowArray2 = dataTableFromRepeater.Select("FieldName = 'updatetime'");
            if (rowArray2.Length > 0)
            {
                rowArray2[0]["FieldValue"] = DateTime.Now;
            }
            if (this.m_UserPurviewInfo.SetToNotCheck && !this.m_UserPurviewInfo.PublicInfoNoNeedCheck)
            {
                rowArray[0]["FieldValue"] = "0";
            }
            int generalId = BasePage.RequestInt32("GeneralID");

            if (ContentManage.UpdateByUser(generalId, ContentManage.GetNewContentData(dataTableFromRepeater)))
            {
                this.SavePresentExp(dataTableFromRepeater, this.m_UserPurviewInfo, this.m_User);
                this.UpdateKeywordsToTable(generalId, dataTableFromRepeater);
                DynamicPage.WriteUserSuccessMsg("修改成功!", "ContentManage.aspx");
            }
            else
            {
                DynamicPage.WriteUserErrMsg("修改失败!");
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);

            this.m_UserId = usersByUserName.UserId;
            this.OdsFavorite.SelectParameters["userId"].DefaultValue = this.m_UserId.ToString();
            if (!base.IsPostBack)
            {
                FavoriteInfo favoriteInfo = new FavoriteInfo();
                favoriteInfo.FavoriteTime = DateTime.Now;
                favoriteInfo.InfoId       = BasePage.RequestInt32("Id");
                favoriteInfo.UserId       = this.m_UserId;
                string str = BasePage.RequestStringToLower("Action");
                if (str != null)
                {
                    if (!(str == "add"))
                    {
                        if (!(str == "delete"))
                        {
                            return;
                        }
                    }
                    else
                    {
                        if (favoriteInfo.InfoId <= 0)
                        {
                            DynamicPage.WriteErrMsg("你收藏的内容不存在!", "Index.aspx");
                        }
                        UserPurviewInfo userPurview  = usersByUserName.UserPurview;
                        int             maxSaveInfos = 0;
                        if (!userPurview.IsNull)
                        {
                            maxSaveInfos = userPurview.MaxSaveInfos;
                        }
                        if (maxSaveInfos <= 0)
                        {
                            DynamicPage.WriteErrMsg("你没有收藏权限,请与网站管理员联系!", "Index.aspx");
                        }
                        if (maxSaveInfos > Favorite.GetUserFavoiteCount(this.m_UserId))
                        {
                            Favorite.Add(favoriteInfo);
                            DynamicPage.WriteSuccessMsg("收藏成功", "~/Item/" + favoriteInfo.InfoId.ToString() + ".aspx");
                            return;
                        }
                        DynamicPage.WriteErrMsg("你收藏的内容已达到最大收藏数");
                        return;
                    }
                    if (favoriteInfo.InfoId <= 0)
                    {
                        DynamicPage.WriteUserErrMsg("你收藏的内容不存在!", "Favorite.aspx");
                    }
                    if (!Favorite.Delete(this.m_UserId, BasePage.RequestInt32("Id")))
                    {
                        DynamicPage.WriteUserErrMsg("取消失败");
                    }
                }
            }
        }
Beispiel #4
0
 protected void BtnBatchDelete_Click(object sender, EventArgs e)
 {
     if (Favorite.Delete(this.m_UserId, this.EgvFavorite.SelectList.ToString()))
     {
         this.EgvFavorite.DataBind();
     }
     else
     {
         DynamicPage.WriteUserErrMsg("取消失败");
     }
 }
        protected void BtnSelectNode_Click(object sender, EventArgs e)
        {
            string str = BasePage.RequestString("Action");

            if (string.IsNullOrEmpty(str))
            {
                str = "add";
            }
            if (string.IsNullOrEmpty(this.HdnNodeId.Value))
            {
                DynamicPage.WriteUserErrMsg("您没有发布信息的权限!", "NavContent.aspx");
            }
            else if (string.IsNullOrEmpty(this.HdnModelId.Value))
            {
                DynamicPage.WriteUserErrMsg("没有选择内容模型!", "NavContent.aspx");
            }
            else
            {
                NodeInfo cacheNodeById = Nodes.GetCacheNodeById(DataConverter.CLng(this.HdnNodeId.Value));
                if (cacheNodeById.IsNull)
                {
                    DynamicPage.WriteUserErrMsg("<li>节点不存在!</li>", "NavContent.aspx");
                }
                else
                {
                    bool flag = UserPermissions.AccessCheck(OperateCode.NodeContentInput, cacheNodeById.NodeId);
                    if (!flag)
                    {
                        string checkStr = UserPermissions.GetRoleNodeId(PEContext.Current.User.RoleId, OperateCode.NodeContentInput, PEContext.Current.User.UserInfo.IsInheritGroupRole ? 1 : 0);
                        string findStr  = cacheNodeById.NodeId.ToString();
                        if ((cacheNodeById.ParentId > 0) && !flag)
                        {
                            findStr = cacheNodeById.ParentPath + "," + cacheNodeById.NodeId.ToString();
                            flag    = StringHelper.FoundCharInArr(checkStr, findStr);
                        }
                    }
                    if (!flag)
                    {
                        DynamicPage.WriteUserErrMsg("您没有此节点的添加权限!", "NavContent.aspx");
                    }
                    if (ModelManager.GetCacheModelById(DataConverter.CLng(this.HdnModelId.Value)).IsEshop)
                    {
                        BasePage.ResponseRedirect(SiteConfig.SiteInfo.VirtualPath + "User/Shop/Product.aspx?nodeId=" + this.HdnNodeId.Value + "&modelId=" + this.HdnModelId.Value + "&Action=" + str);
                    }
                    else
                    {
                        BasePage.ResponseRedirect("Content.aspx?nodeId=" + this.HdnNodeId.Value + "&modelId=" + this.HdnModelId.Value + "&Action=" + str);
                    }
                }
            }
        }
Beispiel #6
0
 protected void EgvContentSignIn_RowCommand(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "SignIn")
     {
         if (SignInLog.SignIn(DataConverter.CLng(e.CommandArgument.ToString()), PEContext.Current.User.UserName, true, PEContext.Current.UserHostAddress))
         {
             DynamicPage.WriteUserSuccessMsg("<li>签收成功!</li>", "Signin.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
         }
         else
         {
             DynamicPage.WriteUserErrMsg("<li>签收失败!</li>");
         }
     }
 }
Beispiel #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         CommentInfo commentInfo = Comment.GetCommentInfo(BasePage.RequestInt32("CommentID"));
         if (commentInfo.IsNull)
         {
             DynamicPage.WriteUserErrMsg("<li>该评论不存在,请返回!</li>");
         }
         if ((commentInfo.UserName != PEContext.Current.User.UserName) || commentInfo.Status)
         {
             DynamicPage.WriteUserErrMsg("<li>你只能修改你自己发表的未审核评论!</li>");
         }
         if (commentInfo.UserId != 0)
         {
             this.LblUserInfo.Visible = true;
             StringBuilder builder  = new StringBuilder();
             UserInfo      userById = Users.GetUserById(commentInfo.UserId);
             if (userById.IsNull)
             {
                 DynamicPage.WriteUserErrMsg("<li>该评论所属的用户不存在,请返回!</li>");
             }
             builder.Append("<tr class='tdbg'>");
             builder.Append("<td class='tdbgleft' align='right' style='width: 150px; '>");
             builder.Append("<strong>用户名:&nbsp;</strong></td>");
             builder.Append("<td class='tdbg' align='left' >");
             builder.Append(userById.UserName);
             builder.Append("</td></tr>");
             builder.Append("<tr class='tdbg'>");
             builder.Append("<td class='tdbgleft' align='right' style='width: 150px; '>");
             builder.Append("<strong>邮件:&nbsp;</strong></td>");
             builder.Append("<td class='tdbg' align='left' >");
             builder.Append(userById.Email);
             builder.Append("</td></tr>");
             this.LblUserInfo.Text = builder.ToString();
             this.trUser.Visible   = false;
             this.trEmail.Visible  = false;
         }
         this.LblUserName.Text       = commentInfo.ReplyUserName;
         this.TxtEmail.Text          = commentInfo.Email;
         this.TxtCommentTitle.Text   = commentInfo.CommentTitle;
         this.TxtCommentContent.Text = commentInfo.Content;
         this.ScoreControl.Score     = commentInfo.Score;
         if (commentInfo.IsPrivate)
         {
             this.ChkReplyIsPrivate.Checked = true;
         }
     }
 }
Beispiel #8
0
 protected void BtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         CommentInfo commentInfo = Comment.GetCommentInfo(BasePage.RequestInt32("CommentID"));
         if (commentInfo.IsNull)
         {
             DynamicPage.WriteUserErrMsg("<li>该评论不存在,请返回!</li>");
         }
         if ((commentInfo.UserName != PEContext.Current.User.UserName) || commentInfo.Status)
         {
             DynamicPage.WriteUserErrMsg("<li>你只能修改你自己发表的未审核评论!</li>");
         }
         if (commentInfo.UserId != 0)
         {
             UserInfo userById = Users.GetUserById(commentInfo.UserId);
             if (userById.IsNull)
             {
                 DynamicPage.WriteUserErrMsg("<li>该评论所属的用户不存在,请返回!</li>");
             }
             commentInfo.UserName = userById.UserName;
             commentInfo.Email    = userById.Email;
         }
         else
         {
             commentInfo.Email = this.TxtEmail.Text;
         }
         commentInfo.CommentTitle = this.TxtCommentTitle.Text;
         commentInfo.Content      = this.TxtCommentContent.Text;
         commentInfo.Score        = this.ScoreControl.Score;
         if (this.ChkReplyIsPrivate.Checked)
         {
             commentInfo.IsPrivate = true;
         }
         else
         {
             commentInfo.IsPrivate = false;
         }
         if (Comment.Update(commentInfo))
         {
             DynamicPage.WriteUserSuccessMsg("<li>修改评论成功。</li>", "CommentManage.aspx?" + this.commonlink);
         }
         else
         {
             DynamicPage.WriteUserErrMsg("<li>修改评论失败,请返回。</li>");
         }
     }
 }
Beispiel #9
0
 protected void EBtnBatchDelete_Click(object sender, EventArgs e)
 {
     this.m_IsInput = this.CheckUserConentInputPurview(0);
     if (!this.m_IsInput)
     {
         DynamicPage.WriteUserErrMsg("<li>没有删除权限!</li>");
     }
     if (ContentManage.UpdateStatusByUserName(this.EgvContent.SelectList.ToString(), -3))
     {
         DynamicPage.WriteUserSuccessMsg("<li>批量删除成功!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
     }
     else
     {
         DynamicPage.WriteUserErrMsg("<li>批量删除项目失败!</li>");
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     this.m_ModelId = BasePage.RequestInt32("ModelID");
     this.m_NodeId  = BasePage.RequestInt32("NodeID");
     this.m_Action  = BasePage.RequestStringToLower("Action");
     if (((this.m_ModelId <= 0) || (this.m_NodeId <= 0)) || string.IsNullOrEmpty(this.m_Action))
     {
         DynamicPage.WriteUserErrMsg("添加信息参数错误!", "NavContent.aspx");
     }
     this.m_User            = Users.GetUsersByUserName(PEContext.Current.User.UserName);
     this.m_UserPurviewInfo = this.m_User.UserPurview;
     if (!base.IsPostBack)
     {
         if (this.m_Action == "add")
         {
             if (!EasyOne.Contents.Nodes.CheckNodePermission(this.m_NodeId))
             {
                 DynamicPage.WriteUserErrMsg("此栏目设置了有子节点时不允许向该栏目添加信息!", "ContentManage.aspx");
             }
             IList <FieldInfo> fieldList = Field.GetFieldList(this.m_ModelId, false);
             this.RepContentForm.DataSource = fieldList;
             this.RepContentForm.DataBind();
         }
         if (this.m_Action == "modify")
         {
             int generalId = BasePage.RequestInt32("GeneralID");
             this.m_ContentData = ContentManage.GetUserContentDataById(generalId);
             if (this.m_ContentData.Rows.Count <= 0)
             {
                 DynamicPage.WriteUserErrMsg("信息不存在", "ContentManage.aspx");
             }
             if (!this.m_UserPurviewInfo.ManageSelfPublicInfo && (DataConverter.CLng(this.m_ContentData.Rows[0]["Status"].ToString()) == 0x63))
             {
                 DynamicPage.WriteUserErrMsg("不能修改审核通过的信息", "ContentManage.aspx");
             }
             IList <FieldInfo> list2 = Field.GetFieldList(DataConverter.CLng(this.m_ContentData.Rows[0]["ModelID"].ToString()), false);
             this.RepContentForm.DataSource = list2;
             this.RepContentForm.DataBind();
         }
     }
 }
        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("你今天发布的内容信息总数大于网站设定的值,如要添加请与管理员联系!");
            }
        }
Beispiel #12
0
 protected void EgvContent_RowCommand(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "DeleteContent")
     {
         int             generalId           = DataConverter.CLng(e.CommandArgument.ToString());
         CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId);
         this.m_IsInput = this.CheckUserConentInputPurview(commonModelInfoById.NodeId);
         if (!this.m_IsInput)
         {
             DynamicPage.WriteUserErrMsg("<li>没有删除权限!</li>");
         }
         if (ContentManage.UpdateStatusByUserName(e.CommandArgument.ToString(), -3))
         {
             PermissionContent.Delete(generalId);
             ContentCharge.Delete(generalId);
             DynamicPage.WriteUserSuccessMsg("<li>删除成功!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
         }
         else
         {
             DynamicPage.WriteUserErrMsg("<li>删除失败!</li>");
         }
     }
 }
        protected void InitComment()
        {
            int    commentId = BasePage.RequestInt32("CommentID");
            string str       = BasePage.RequestString("Action");

            if (str != null)
            {
                if (!(str == "DelAll"))
                {
                    if (str == "Del")
                    {
                        if (Comment.DeleteByUserName(commentId))
                        {
                            DynamicPage.WriteUserSuccessMsg("<li>删除指定评论成功!</li>", "CommentManage.aspx?" + this.commonlink);
                        }
                        else
                        {
                            DynamicPage.WriteUserErrMsg("<li>删除指定评论失败!</li>");
                        }
                    }
                }
                else if (Comment.DeleteByGeneralIdAndUserName(BasePage.RequestInt32("GeneralID")))
                {
                    DynamicPage.WriteUserSuccessMsg("<li>删除该信息的全部评论成功!</li>", "CommentManage.aspx?" + this.commonlink);
                }
                else
                {
                    DynamicPage.WriteUserErrMsg("<li>删除指定信息的全部评论失败!</li>");
                }
            }
            this.CommentBindData();
            if (this.Pager.RecordCount <= 0)
            {
                this.NotAssignment.Style.Add("display", "");
                this.Pager.Visible = false;
            }
        }