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("修改失败!"); } }
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>"); } }
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>"); } } }
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>"); } } }
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>"); } }
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("你今天发布的内容信息总数大于网站设定的值,如要添加请与管理员联系!"); } }
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; } }