private void EditCentSavePage() { int id = int.Parse(Utils.GetRequest("id", "post", 2, @"^[1-9]\d*$", "ID错误")); int UsID = int.Parse(Utils.GetRequest("UsID", "post", 2, @"^[1-9]\d*$", "用户ID错误")); string UsName = Utils.GetRequest("UsName", "post", 2, @"^[^\^]{1,50}$", "昵称不超50字"); int AdminId = int.Parse(Utils.GetRequest("AdminId", "post", 2, @"^[0-9]\d*$", "管理员ID错误")); string Title = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{1,50}$", "主题标题限1-50字"); int BID = int.Parse(Utils.GetRequest("BID", "post", 2, @"^[1-9]\d*$", "BIDID错误")); int ForumId = int.Parse(Utils.GetRequest("ForumId", "post", 2, @"^[1-9]\d*$", "论坛ID错误")); string Notes = Utils.GetRequest("Notes", "post", 2, @"^[\s\S]{1,500}$", "请输入不超500字的日志内容"); DateTime AddTime = Utils.ParseTime(Utils.GetRequest("AddTime", "post", 2, DT.RegexTime, "添加时间填写出错")); BCW.Model.Forumvotelog model = new BCW.Model.Forumvotelog(); model.ID = id; model.UsID = UsID; model.UsName = UsName; model.AdminId = AdminId; model.Title = Title; model.BID = BID; model.ForumId = ForumId; model.Notes = Notes; model.AddTime = AddTime; new BCW.BLL.Forumvotelog().Update(model); Utils.Success("编辑奖励日志", "编辑奖励日志成功..", Utils.getUrl("Gsadmin.aspx?act=editcent&id=" + id + "&backurl=" + Utils.getPage(0) + ""), "1"); }
private void CentPage() { int forumid = int.Parse(Utils.GetRequest("forumid", "all", 2, @"^[0-9]\d*$", "论坛ID错误")); if (!new BCW.BLL.Forum().Exists2(forumid)) { Utils.Success("访问论坛", "该论坛不存在或已暂停使用", Utils.getUrl("forum.aspx"), "1"); } if (new BCW.User.ForumInc().IsForumGSIDS(forumid) == true) { } else { Utils.Error("不存在的记录", ""); } Master.Title = "奖励会员"; int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } string GsAdminID = ub.GetSub("BbsGsAdminID", xmlPath); if (!("#" + GsAdminID + "#").Contains("#" + meid + "#")) { Utils.Error("权限不足", ""); } int bid = int.Parse(Utils.GetRequest("bid", "all", 2, @"^[0-9]\d*$", "ID错误")); if (!new BCW.BLL.Text().Exists2(bid, forumid)) { Utils.Error("帖子不存在或已被删除", ""); } BCW.Model.Text model = new BCW.BLL.Text().GetText(bid); string info = Utils.GetRequest("info", "post", 1, "", ""); if (info != "") { string Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{1,50}$", "奖励原因限1-50字内,不能留空"); long Gold = Int64.Parse(Utils.GetRequest("iGold", "post", 1, @"^[0-9]\d*$", "0")); long Money = Int64.Parse(Utils.GetRequest("iMoney", "post", 1, @"^[0-9]\d*$", "0")); long Score = Int64.Parse(Utils.GetRequest("iScore", "post", 1, @"^[0-9]\d*$", "0")); int Vip = int.Parse(Utils.GetRequest("iVip", "post", 1, @"^[0-3]$", "0")); string LogText = "" + Content + ""; if (Gold > 0) { LogText += "/奖" + Gold + "" + ub.Get("SiteBz") + ""; } if (Money > 0) { LogText += "/奖" + Money + "" + ub.Get("SiteBz2") + ""; } if (Score > 0) { LogText += "/奖" + Score + "积分"; } if (Vip > 0) { LogText += "/奖VIP" + Vip + "月"; } if (info == "ok") { builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("奖励对象:<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + model.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + model.UsName + "(" + model.UsID + ")</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("奖励并生成日志:" + LogText + ""); builder.Append(Out.Tab("</div>", "<br />")); string strName = "Content,iGold,iMoney,iScore,iVip,forumid,bid,act,info,backurl"; string strValu = "" + Content + "'" + Gold + "'" + Money + "'" + Score + "'" + Vip + "'" + forumid + "'" + bid + "'cent'ok2'" + Utils.getPage(0) + "'"; string strOthe = "确认奖励,Gstoplist.aspx,post,0,red"; builder.Append(Out.wapform(strName, strValu, strOthe)); } else { if (Gold > 0) { new BCW.BLL.User().UpdateiGold(model.UsID, model.UsName, Gold, Content); } if (Money > 0) { new BCW.BLL.User().UpdateiMoney(model.UsID, model.UsName, Money, Content); } if (Score > 0) { new BCW.BLL.User().UpdateiScore(model.UsID, Score); } if (Vip > 0) { string xmlPathvip = "/Controls/bbs.xml"; int VipGrow1 = Utils.ParseInt(ub.GetSub("VipGrow1", xmlPathvip)); int VipGrow2 = Utils.ParseInt(ub.GetSub("VipGrow2", xmlPathvip)); int VipGrow3 = Utils.ParseInt(ub.GetSub("VipGrow3", xmlPathvip)); int VipGrow4 = Utils.ParseInt(ub.GetSub("VipGrow4", xmlPathvip)); int Grow = 0; int Day = 0; if (Vip == 1) { Grow = VipGrow1; Day = 30; } else if (Vip == 2) { Grow = VipGrow2; Day = 90; } else if (Vip == 3) { Grow = VipGrow3; Day = 180; } BCW.Model.User model2 = new BCW.BLL.User().GetVipData(model.UsID); try { if (model2.VipDate != null && model2.VipDate > DateTime.Now) { new BCW.BLL.User().UpdateVipData(model.UsID, Grow, model2.VipDate.AddDays(Day)); } else { new BCW.BLL.User().UpdateVipData(model.UsID, Grow, DateTime.Now.AddDays(Day)); } } catch { new BCW.BLL.User().UpdateVipData(model.UsID, Grow, DateTime.Now.AddDays(Day)); } //清缓存 string CacheKey = CacheName.App_UserVip(model.UsID); DataCache.RemoveByPattern(CacheKey); } //记录日志 BCW.Model.Forumvotelog m = new BCW.Model.Forumvotelog(); m.UsID = model.UsID; m.UsName = model.UsName; m.AdminId = meid; m.BID = bid; m.ForumId = forumid; m.Title = model.Title; m.Notes = LogText; m.AddTime = DateTime.Now; new BCW.BLL.Forumvotelog().Add(m); Utils.Success("奖励会员", "恭喜,奖励成功,正在返回..", Utils.getPage("Gstoplist.aspx?forumid=" + forumid + ""), "2"); } } else { builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("主题:<a href=\"" + Utils.getUrl("topic.aspx?forumid=" + model.ForumId + "&bid=" + bid + "&backurl=" + Utils.PostPage(1) + "") + "\">" + model.Title + "</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("奖励对象:<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + model.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + model.UsName + "(" + model.UsID + ")</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("Gstoplist.aspx?act=centlist&forumid=" + model.ForumId + "&hid=" + model.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">查看奖励记录>></a>"); builder.Append(Out.Tab("</div>", "")); string strText = "奖励原因(如填写:2013001期5连中):/,奖" + ub.Get("SiteBz") + ":/,奖" + ub.Get("SiteBz2") + ":/,奖积分:/,奖VIP:/,,,,,,"; string strName = "Content,iGold,iMoney,iScore,iVip,forumid,bid,act,info,backurl"; string strType = "textarea,num,num,num,select,hidden,hidden,hidden,hidden,hidden"; string strValu = "''''0'" + forumid + "'" + bid + "'cent'ok'" + Utils.getPage(0) + ""; string strEmpt = "true,true,true,true,0|不赠送|1|1个月|2|3个月|3|6个月,false,false,false,false,false"; string strIdea = "/"; string strOthe = "确定奖励,Gstoplist.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div class=\"title\">", "<br />")); builder.Append("<a href=\"" + Utils.getPage("Gstoplist.aspx?forumid=" + forumid + "") + "\"><<返回上级</a>"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"title\">", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getUrl("uinfo.aspx?backurl=" + Utils.getPage(0) + "") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("forum.aspx?forumid=" + forumid + "") + "\">论坛</a>"); builder.Append(Out.Tab("</div>", "")); } }
/// <summary> /// 更新一条数据 /// </summary> public void Update(BCW.Model.Forumvotelog model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BCW.Model.Forumvotelog model) { return(dal.Add(model)); }