protected void Check_B_Click(object sender, EventArgs e) { M_GuestBookCate catemod = cateBll.SelReturnModel(CateID); //避免重复加分操作 DataTable dt = barBll.SelByIDS(Request.Form["idchk"]); foreach (DataRow item in dt.Rows) { if (DataConverter.CLng(item["Status"]) != (int)ZLEnum.ConStatus.Audited && DataConverter.CLng(item["CUser"]) > 0) { //if (catemod.IsPlat == 1) //{ // string siteurl = "http://" + Request.Url.Authority + "/"; // string url = B_Guest_Bar.CreateUrl(2, Convert.ToInt32(item["ID"])); // string cateurl = B_Guest_Bar.CreateUrl(1, catemod.CateID); // msgBll.InsertMsg(string.Format(forwardTlp, item["Title"], siteurl + url, siteurl + url, catemod.CateName, siteurl+cateurl)); //} buser.ChangeVirtualMoney(DataConverter.CLng(item["CUser"]), new M_UserExpHis() { score = DataConverter.CLng(item["SendScore"]), detail = string.Format("{0} {1}在版面:{2}发表主题:{3},赠送{4}分", DateTime.Now, item["CUName"], item["Catename"], item["Title"], DataConverter.CLng(item["SendScore"])), ScoreType = (int)M_UserExpHis.SType.Point }); } } barBll.CheckByIDS(Request.Form["idchk"]); MyBind(); }
//删除,置顶,精华,沉底 protected void Bar_Btn_Click(object sender, EventArgs e) { cateMod = guestBll.GetCate(CateID); int uid = buser.GetLogin().UserID; string ids = Request.Form["idchk"]; if (cateMod.IsBarOwner(uid) && !string.IsNullOrWhiteSpace(ids)) { switch ((sender as LinkButton).CommandArgument) { case "Del": barBll.UpdateStatus(CateID, ids, (int)ZLEnum.ConStatus.Recycle); break; case "AddTop": barBll.UpdateTop(ids, true); break; case "RemoveTop": barBll.UpdateTop(ids, false); break; case "AddRecom": barBll.UpdateRecommend(ids, true); break; case "RemoveRecom": barBll.UpdateRecommend(ids, false); break; case "AddBottom": barBll.UpdateDown(ids, true); break; case "RemoveBottom": barBll.UpdateDown(ids, false); break; case "Checked": //审核加积分操作 DataTable dt = barBll.SelByIDS(ids); dt.DefaultView.RowFilter = "Status=" + (int)ZLEnum.ConStatus.UnAudit; dt = dt.DefaultView.ToTable(); foreach (DataRow item in dt.Rows) { if (DataConverter.CLng(item["Status"]) != (int)ZLEnum.ConStatus.Audited && DataConverter.CLng(item["CUser"]) > 0) { if (cateMod.IsPlat == 1) { string siteurl = "http://" + Request.Url.Authority + "/"; string url = B_Guest_Bar.CreateUrl(2, Convert.ToInt32(item["ID"])); string cateurl = B_Guest_Bar.CreateUrl(1, cateMod.CateID); //需要处理 msgBll.InsertMsg(string.Format(forwardTlp, item["MsgContent"], siteurl + url, siteurl + url, cateMod.CateName, siteurl + cateurl)); } buser.ChangeVirtualMoney(DataConvert.CLng(item["CUser"]), new M_UserExpHis() { score = DataConvert.CLng(item["SendScore"]), detail = string.Format("{0} {1}在版面:{2}发表主题:{3},赠送{4}分", DateTime.Now, item["CUName"], item["Catename"], item["Title"], DataConverter.CLng(item["SendScore"]) , DataConverter.CLng(item["ReplyScore"])), ScoreType = (int)M_UserExpHis.SType.Point }); } } //Audit barBll.CheckByIDS(ids); break; case "UnCheck": barBll.UnCheckByIDS(ids); break; } } Refresh(); }
//管理员对贴子的操作,需要验证管理员权限 public int Post_OP(int cateid, string ids) { if (cateid < 1) { return(Failed); } M_GuestBookCate cateMod = cateBll.SelReturnModel(cateid); if (!cateMod.IsBarOwner(mu.UserID)) { return(Failed); } cateMod = cateBll.SelReturnModel(cateid); if (string.IsNullOrEmpty(ids)) { return(Failed); } switch (RequestEx["action"]) { case "Del": barBll.UpdateStatus(cateid, ids, (int)ZLEnum.ConStatus.Recycle); break; case "AddTop": barBll.UpdateOrderFlag(ids, 1); break; case "AddAllTop": barBll.UpdateOrderFlag(ids, 2); break; case "RemoveTop": barBll.UpdateOrderFlag(ids, 0); break; case "AddRecom": barBll.UpdateRecommend(ids, true); break; case "RemoveRecom": barBll.UpdateRecommend(ids, false); break; case "AddBottom": barBll.UpdateOrderFlag(ids, -1); break; case "Checked": //审核 barBll.CheckByIDS(ids); break; case "UnCheck": barBll.UnCheckByIDS(ids); break; case "Hidden": barBll.UpdateStatus(cateid, ids, (int)ZLEnum.ConStatus.Recycle); break; case "CancelHidden": barBll.UpdateStatus(cateid, ids, (int)ZLEnum.ConStatus.Audited); break; default: throw new Exception(RequestEx["action"] + "不匹配"); } return(Success); }