private void SavePage(int forumid, string ForumName, int uid) { new BCW.User.Role().CheckUserRole(BCW.User.Role.enumRole.Role_TopicsSet, uid, forumid); string Title = Utils.GetRequest("Title", "post", 2, @"^[^\^]{1,10}$", "专题名称限1-10字"); int Paixu = int.Parse(Utils.GetRequest("Paixu", "post", 2, @"^[0-9]\d*$", "排序填写错误")); int id = int.Parse(Utils.GetRequest("id", "post", 1, @"^[0-9]\d*$", "0")); if (id == 0) { if (new BCW.BLL.Forumts().Exists(forumid, Title)) { Utils.Error("同名专题名称已存在,请填写其它专题名称", ""); } } else { if (!new BCW.BLL.Forumts().Exists2(id, forumid)) { Utils.Error("不存在的专题记录", ""); } } BCW.Model.Forumts model = new BCW.Model.Forumts(); model.ID = id; model.ForumID = forumid; model.Title = Title; model.Paixu = Paixu; if (id == 0) { new BCW.BLL.Forumts().Add(model); Utils.Success("添加专题", "恭喜,添加专题成功", Utils.getUrl("forumts.aspx?ptype=1&forumid=" + forumid + ""), "1"); } else { new BCW.BLL.Forumts().Update(model); Utils.Success("编辑专题", "恭喜,编辑专题成功", Utils.getPage("forumts.aspx?ptype=1&forumid=" + forumid + ""), "1"); } }
/// <summary> /// 更新一条数据 /// </summary> public void Update(BCW.Model.Forumts model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BCW.Model.Forumts model) { return(dal.Add(model)); }