private void EditSavePage(int uid) { string PUrl = string.Empty; int ptype = int.Parse(Utils.GetRequest("ptype", "post", 1, @"^[1-5]$", "0")); string Title = Utils.GetRequest("Title", "post", 2, @"^[^\^]{1,30}$", "标题限1-30字"); if (ptype == 0) { PUrl = Utils.GetRequest("Purl", "post", 2, @"http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?", "请输入正确的地址"); } else { PUrl = Utils.GetRequest("Purl", "post", 2, @"(/[\w- ./?%&=]*)?", "帖子地址错误"); } int favid = int.Parse(Utils.GetRequest("favid", "post", 2, @"^[1-9]\d*$", "收藏ID错误")); int NodeId = int.Parse(Utils.GetRequest("NodeId", "post", 2, @"^[0-9]\d*$", "收藏夹ID错误")); if (!new BCW.BLL.Favorites().Exists(favid, uid)) { Utils.Error("不存在的收藏", ""); } if (!new BCW.BLL.Favgroup().Exists(NodeId, uid, 0)) { Utils.Error("不存在的收藏夹", ""); } BCW.Model.Favorites model = new BCW.Model.Favorites(); model.ID = favid; model.NodeId = NodeId; model.UsID = uid; model.Title = Title; model.PUrl = PUrl; model.AddTime = DateTime.Now; new BCW.BLL.Favorites().Update(model); Utils.Success("编辑收藏", "编辑收藏成功,正在返回..<br /><a href=\"" + Utils.getUrl("favorites.aspx?act=view&id=" + NodeId + "&favid=" + favid + "&backurl=" + Utils.getPage(0) + "") + "\">>查看收藏</a>", Utils.getPage("favorites.aspx"), "3"); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(BCW.Model.Favorites model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BCW.Model.Favorites model) { return(dal.Add(model)); }