private void OkPage() { int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误")); if (!new BCW.BLL.Vbook().Exists(id)) { Utils.Error("不存在的记录", ""); } string UsName = Utils.GetRequest("UsName", "post", 2, @"^[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{1,7}$", "请输入不超过7个字的昵称,不能有特殊符号"); string Title = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{2,20}$", "请输入2-20位的标题"); string Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{0,500}$", "请输入不超过500字的内容"); string SyText = Utils.GetRequest("SyText", "post", 3, @"^[\s\S]{0,200}$", "请输入不超过200字的保密内容,可以留空"); string ReName = Utils.GetRequest("ReName", "post", 1, @"^[\s\S]{1,20}$", "管理员"); string VPwd = Utils.GetRequest("VPwd", "post", 3, @"^[A-Za-z0-9]{6,20}$", "查看密码由6-20位数字或字母组成,可以留空"); string ReText = Utils.GetRequest("ReText", "post", 3, @"^[\s\S]{0,200}$", "请输入不超过200字的回复内容,可以留空"); DateTime ReTime = Utils.ParseTime(Utils.GetRequest("ReTime", "post", 1, DT.RegexTime, DateTime.Now.ToString())); BCW.Model.Vbook model = new BCW.Model.Vbook(); model.ID = id; model.Types = 0; model.UsName = UsName; model.Title = Title; model.Content = Content; model.SyText = SyText; model.Face = 0; model.VPwd = VPwd; model.ReName = ReName; model.ReText = ReText; model.ReTime = ReTime; new BCW.BLL.Vbook().Update(model); Utils.Success("管理留言", "管理留言成功,正在返回..", Utils.getPage("vbook.aspx"), "2"); }
private void OkPage() { //会员发表权限 int meid = new BCW.User.Users().GetUsId(); if (ub.GetSub("VBookIsUser", xmlPath) == "1") { if (meid == 0) { Utils.Login(); } } string mename = string.Empty; if (meid == 0) { mename = Utils.GetRequest("UsName", "post", 2, @"^[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{1,7}$", "请输入不超过7个字的昵称,不能有特殊符号"); } else { mename = new BCW.BLL.User().GetUsName(meid); } string Title = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{1,30}$", "请输入1-30字的标题"); string Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{0,500}$", "请输入不超过500字的内容"); string SyText = Utils.GetRequest("SyText", "post", 3, @"^[\s\S]{0,200}$", "请输入不超过200字的保密内容,可以留空"); string VPwd = Utils.GetRequest("VPwd", "post", 3, @"^[A-Za-z0-9]{6,20}$", "查看密码由6-20位数字或字母组成,可以留空"); //是否刷屏 string appName = "LIGHT_VBOOK"; int Expir = Convert.ToInt32(ub.GetSub("VBookExpir", xmlPath)); BCW.User.Users.IsFresh(appName, Expir); BCW.Model.Vbook model = new BCW.Model.Vbook(); model.Types = 0; model.Title = Title; model.Content = Content; model.SyText = SyText; model.Face = 0; model.UsID = meid; model.UsName = mename; model.AddUsIP = Utils.GetUsIP(); model.AddTime = DateTime.Now; model.VPwd = VPwd; new BCW.BLL.Vbook().Add(model); Utils.Success("发表留言", "发表留言成功,正在返回..", Utils.getUrl("vbook.aspx?backurl=" + Utils.getPage(0) + ""), "2"); }
private void SavePage() { string UsName = string.Empty; int UsID = int.Parse(Utils.GetRequest("UsID", "post", 2, @"^[0-9]\d*$", "用户ID填写错误,非会员请填写0")); if (UsID > 0) { UsName = Utils.GetRequest("UsName", "post", 3, @"^[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{1,7}$", "请输入不超过7个字的昵称,不能有特殊符号"); if (UsName == "") { UsName = new BCW.BLL.User().GetUsName(UsID); if (UsName == "") { Utils.Error("用户ID不存在", ""); } } } else { UsName = Utils.GetRequest("UsName", "post", 1, @"^[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{1,7}$", "请输入不超过7个字的昵称,不能有特殊符号"); } string Title = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{2,20}$", "请输入2-20位的标题"); string Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{0,500}$", "请输入不超过500字的内容"); string SyText = Utils.GetRequest("SyText", "post", 3, @"^[\s\S]{0,200}$", "请输入不超过200字的保密内容,可以留空"); string ReName = Utils.GetRequest("ReName", "post", 1, @"^[\s\S]{1,20}$", "管理员"); string VPwd = Utils.GetRequest("VPwd", "post", 3, @"^[A-Za-z0-9]{6,20}$", "查看密码由6-20位数字或字母组成,可以留空"); string ReText = Utils.GetRequest("ReText", "post", 3, @"^[\s\S]{0,200}$", "请输入不超过200字的回复内容,可以留空"); DateTime ReTime = Utils.ParseTime(Utils.GetRequest("ReTime", "post", 1, DT.RegexTime, DateTime.Now.ToString())); BCW.Model.Vbook model = new BCW.Model.Vbook(); model.Types = 0; model.UsName = UsName; model.UsID = UsID; model.Title = Title; model.Content = Content; model.SyText = SyText; model.Face = 0; model.VPwd = VPwd; model.ReName = ReName; model.ReText = ReText; model.ReTime = ReTime; model.AddUsIP = Utils.GetUsIP(); model.AddTime = DateTime.Now; new BCW.BLL.Vbook().Add2(model); Utils.Success("添加留言", "添加留言成功,正在返回..", Utils.getPage("vbook.aspx"), "2"); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(BCW.Model.Vbook model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BCW.Model.Vbook model) { return(dal.Add(model)); }