/// <summary> /// 更新一条数据 /// </summary> public void Update(BCW.Model.Forumvote model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BCW.Model.Forumvote model) { return(dal.Add(model)); }
private void SavePage(int forumid, int bid, int id) { int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } string GsDemoID = ub.GetSub("BbsGsDemoID", xmlPath); if (GsDemoID != "") { if (!("#" + GsDemoID + "#").Contains("#" + meid + "#")) { Utils.Error("此功能内测中,您的ID不在内测ID里", ""); } } DateTime GsStopTime = Utils.ParseTime(ub.GetSub("BbsGsStopTime", xmlPath)); int GsqiNum = Utils.ParseInt(ub.GetSub("BbsGsqiNum", xmlPath)); if (GsqiNum == 0) { Utils.Error("本期尚未设置", ""); } if (GsStopTime < DateTime.Now) { Utils.Error("本期第" + GsqiNum + "期已截止发表,截止时间" + GsStopTime + "", ""); } if (id > 0) { BCW.Model.Forumvote model = new BCW.BLL.Forumvote().GetForumvote(id); if (model == null) { Utils.Error("不存在的记录", ""); } if (model.UsID != meid) { Utils.Error("不存在的记录", ""); } } else { BCW.Model.Text modelT = new BCW.BLL.Text().GetText(bid); if (modelT == null) { Utils.Error("不存在的记录", ""); } if (modelT.UsID != meid) { Utils.Error("不存在的记录", ""); } if (GsqiNum == modelT.Gqinum) { Utils.Error("本期已参赛过了", ""); } } if (new BCW.User.ForumInc().IsForumGSIDS(forumid) == true) { string Choose = ""; Choose = Utils.GetRequest("Choose", "post", 2, @"^[^\,]{1,50}(?:\,[^\,]{1,50}){0,500}$", "参赛内容选择出错"); int cNum = Utils.GetStringNum(Choose, ","); if (new BCW.User.ForumInc().IsForum113(forumid) == true) { if (cNum != 5) { Utils.Error("请选择6个生肖", ""); } } else if (new BCW.User.ForumInc().IsForum114(forumid) == true) { if (Choose.Contains("单") || Choose.Contains("双")) { if (cNum != 3) { Utils.Error("选择半波参赛时,请选择4个半波", ""); } } else { if (cNum != 1) { Utils.Error("选择波色参赛时,请选择2个波色", ""); } } } else if (new BCW.User.ForumInc().IsForum116(forumid) == true) { if (cNum != 0) { Utils.Error("请选择1个生肖", ""); } } if (new BCW.User.ForumInc().IsForum117(forumid) == true) { if (cNum != 4) { Utils.Error("请选择5个数字", ""); } } if (new BCW.User.ForumInc().IsForum119(forumid) == true) { if (cNum != 4) { Utils.Error("请选择5个尾数", ""); } } if (new BCW.User.ForumInc().IsForum115(forumid) == true || new BCW.User.ForumInc().IsForum121(forumid) == true || new BCW.User.ForumInc().IsForum122(forumid) == true) { if (cNum != 0) { Utils.Error("参数选择错误", ""); } } string mename = new BCW.BLL.User().GetUsName(meid); if (id > 0) { string Title = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{1," + ub.GetSub("BbsThreadMax", xmlPath) + "}$", "标题限1-50字"); string Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{1," + ub.GetSub("BbsContentMax", xmlPath) + "}$", "请输入不超" + ub.GetSub("BbsContentMax", xmlPath) + "字的内容"); BCW.Model.Text model2 = new BCW.Model.Text(); model2.ID = bid; model2.Title = Title; model2.Content = Content; new BCW.BLL.Text().Update(model2); new BCW.BLL.Forumvote().UpdateNotes(id, Choose); //记录日志 string strLog = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]修改了参赛内容!主题[url=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]《" + new BCW.BLL.Text().GetTitle(bid) + "》[/url]"; new BCW.BLL.Forumlog().Add(7, forumid, bid, strLog); } else { BCW.Model.Forumvote f = new BCW.Model.Forumvote(); f.Types = 0; f.ForumID = forumid; f.BID = bid; f.Notes = Choose; f.state = 0; f.qiNum = GsqiNum; f.IsWin = 0; f.AddTime = DateTime.Now; f.UsID = meid; f.UsName = mename; new BCW.BLL.Forumvote().Add(f); //更新期数进主题记录并加历史次数 new BCW.BLL.Text().UpdateGqinum(bid, GsqiNum); } Utils.Success("参赛", "操作成功,正在进入参赛帖...", Utils.getUrl("topic.aspx?forumid=" + forumid + "&bid=" + bid + ""), "2"); } }