private void EditSavePage() { int id = int.Parse(Utils.GetRequest("id", "post", 2, @"^[1-9]\d*$", "竞拍ID错误")); string Title = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{1,20}$", "标题限1-20字"); string Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{1,1000}$", "物品描述限1-1000字"); string FileUrl = Utils.GetRequest("FileUrl", "post", 3, @"^[\s\S]{1,100}$", "截图地址长度限100字符,可留空"); string PContent = Utils.GetRequest("PContent", "post", 2, @"^[\s\S]{1,300}$", "保密内容限1-300字"); int UserID = int.Parse(Utils.GetRequest("UserID", "post", 2, @"^[0-9]\d*$", "用户ID填写错误")); string UserName = Utils.GetRequest("UserName", "post", 3, @"^[\s\S]{1,10}$", "昵称填写错误"); long Price = Int64.Parse(Utils.GetRequest("Price", "post", 4, @"^[0-9]\d*$", "起拍价填写错误")); int Types = int.Parse(Utils.GetRequest("Types", "post", 2, @"^[0-1]$", "币种类型错误")); DateTime Totime = Utils.ParseTime(Utils.GetRequest("Totime", "post", 2, DT.RegexTime, "截止时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + "")); DateTime Writetime = Utils.ParseTime(Utils.GetRequest("Writetime", "post", 2, DT.RegexTime, "发布时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + "")); long topPrice = Int64.Parse(Utils.GetRequest("topPrice", "post", 4, @"^[0-9]\d*$", "最高价填写错误")); int WinID = int.Parse(Utils.GetRequest("WinID", "post", 2, @"^[0-9]\d*$", "最高价用户ID填写错误")); string WinName = Utils.GetRequest("WinName", "post", 3, @"^[\s\S]{1,10}$", "最高价昵称填写错误"); int State = int.Parse(Utils.GetRequest("State", "post", 2, @"^[0-2]$", "竞拍状态选择错误")); if (!new BCW.BLL.Game.Race().Exists(id)) { Utils.Error("不存在的竞拍记录", ""); } BCW.Model.Game.Race model = new BCW.Model.Game.Race(); model.ID = id; model.Types = Types; model.title = Title; model.content = Content; model.fileurl = FileUrl; model.pcontent = PContent; model.userid = UserID; model.username = UserName; model.price = Price; model.totime = Totime; model.writetime = Writetime; model.topPrice = topPrice; model.winID = WinID; model.winName = WinName; model.paytype = State; new BCW.BLL.Game.Race().Update(model); Utils.Success("编辑竞拍", "编辑竞拍成功..", Utils.getUrl("race.aspx?act=edit&id=" + id + "&backurl=" + Utils.getPage(0) + ""), "1"); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(BCW.Model.Game.Race model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BCW.Model.Game.Race model) { return(dal.Add(model)); }
private void SavePage() { int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } string Title = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{1,20}$", "标题限1-20字"); string Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{1,1000}$", "物品描述限1-1000字"); string FileUrl = Utils.GetRequest("FileUrl", "post", 3, @"^[\s\S]{1,100}$", "截图地址长度限100字符,可留空"); string PContent = Utils.GetRequest("PContent", "post", 2, @"^[\s\S]{1,300}$", "保密内容限1-300字"); int Types = int.Parse(Utils.GetRequest("Types", "post", 2, @"^[0-1]$", "币种类型错误")); int Price = int.Parse(Utils.GetRequest("Price", "post", 2, @"^[0-9]\d*$", "起拍价填写错误")); DateTime Totime = Utils.ParseTime(Utils.GetRequest("Totime", "post", 2, DT.RegexTime, "截止时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + "")); if (Types == 0) { int Startlow = Utils.ParseInt(ub.GetSub("RaceStartlow", xmlPath)); int Starthigh = Utils.ParseInt(ub.GetSub("RaceStarthigh", xmlPath)); if (Price < Startlow || Price > Starthigh) { Utils.Error("起拍价限" + Startlow + "-" + Starthigh + "" + ub.Get("SiteBz") + "", ""); } } else { int Startlow = Utils.ParseInt(ub.GetSub("RaceStartlow2", xmlPath)); int Starthigh = Utils.ParseInt(ub.GetSub("RaceStarthigh2", xmlPath)); if (Price < Startlow || Price > Starthigh) { Utils.Error("起拍价限" + Startlow + "-" + Starthigh + "" + ub.Get("SiteBz2") + "", ""); } } if (Totime < DateTime.Now) { Utils.Error("截止时间必须大于当时时间", ""); } int DayNum = Utils.ParseInt(ub.GetSub("RaceDayNum", xmlPath)); int MyDayNum = new BCW.BLL.Game.Race().GetTodayCount(meid); if (MyDayNum >= DayNum) { Utils.Error("每天每ID只可以发布" + DayNum + "个竞拍", ""); } BCW.Model.Game.Race model = new BCW.Model.Game.Race(); string mename = new BCW.BLL.User().GetUsName(meid); model.title = Title; model.content = Content; model.fileurl = FileUrl; model.pcontent = PContent; model.price = Price; model.topPrice = Price; model.totime = Totime; model.userid = meid; model.username = mename; model.writetime = DateTime.Now; model.writedate = DateTime.Parse(DateTime.Now.ToLongDateString()); model.Types = Types; model.paytype = 0; int id = new BCW.BLL.Game.Race().Add(model); string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]发布竞拍[url=/bbs/game/race.aspx?act=view&id=" + id + "]" + Title + "[/url]"; new BCW.BLL.Action().Add(4, id, 0, "", wText); Utils.Success("发布竞拍", "发布成功,请等待管理员审核才会显示出来..", Utils.getUrl("race.aspx"), "1"); }