private void DelBuy() { string info = Utils.GetRequest("info", "all", 1, "", ""); int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误")); if (info != "ok") { Master.Title = "删除订单"; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("确定删除此订单记录吗"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("myshop.aspx?info=ok&act=del&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">确定删除</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("myshop.aspx?act=view&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">先留着吧..</a>"); builder.Append(Out.Tab("</div>", "")); } else { if (!new BCW.BLL.Buylist().Exists(id, meid, 0)) { Utils.Error("订单已通过审核或订单不存在", ""); } //得到实体 BCW.Model.Buylist model = new BCW.BLL.Buylist().GetBuylistMe(id); //更新购买人数 new BCW.BLL.Goods().UpdatePaycount(model.GoodsId, -1); //更新出售数量 new BCW.BLL.Goods().UpdateSellCount(model.GoodsId, model.Paycount); //删除 new BCW.BLL.Buylist().Delete(id); //读取商品实体 BCW.Model.Goods modelGoods = new BCW.BLL.Goods().GetGoods(model.GoodsId); if (modelGoods != null) { if (modelGoods.PostType == 1) { new BCW.BLL.User().UpdateiGold(model.UserId, model.UserName, Convert.ToInt64(model.AcPrice), "购买商品《" + modelGoods.Title + "》"); //发信给下订单的会员 new BCW.BLL.Guest().Add(model.UserId, model.UserName, "您已成功删除订单[url=/shopdetail.aspx?id=" + model.GoodsId + "]" + modelGoods.Title + "[/url],返还您" + Convert.ToInt64(model.AcPrice) + "" + ub.Get("SiteBz") + ",欢迎再次购买![br][url=/myshop.aspx]>我的订单[/url]"); } else if (modelGoods.PostType == 2) { new BCW.BLL.User().UpdateiMoney(model.UserId, model.UserName, Convert.ToInt64(model.AcPrice), "购买商品《" + modelGoods.Title + "》"); //发信给下订单的会员 new BCW.BLL.Guest().Add(model.UserId, model.UserName, "您已成功删除订单[url=/shopdetail.aspx?id=" + model.GoodsId + "]" + modelGoods.Title + "[/url],返还您" + Convert.ToInt64(model.AcPrice) + "" + ub.Get("SiteBz2") + ",欢迎再次购买![br][url=/myshop.aspx]>我的订单[/url]"); } } Utils.Success("删除订单", "删除订单成功..", Utils.getUrl("myshop.aspx?backurl=" + Utils.getPage(0) + ""), "1"); } }
/// <summary> /// 设置列表封面 /// </summary> private void InsertCover(int ptype, string Path, string SavePath, string fileName, string fileExtension, int iFile, int iFileCount, int newId) { if (fileExtension == ".gif" || fileExtension == ".jpg" || fileExtension == ".jpeg" || fileExtension == ".png" || fileExtension == ".bmp") { if ((iFile + 1) == iFileCount) { string CoverPath = Path + "cover/"; string CoverDirPath = ""; if (FileTool.CreateDirectory(CoverPath, out CoverDirPath)) { string CoverSavePath = System.Web.HttpContext.Current.Request.MapPath(CoverDirPath) + fileName; int width = Convert.ToInt32(ub.GetSub("UpCoverWidth", xmlPath)); int height = Convert.ToInt32(ub.GetSub("UpCoverHeight", xmlPath)); bool pbool = false; try { if (fileExtension == ".gif") { new BCW.Graph.GifHelper().GetThumbnail(SavePath, CoverSavePath, width, height, pbool); } else { new BCW.Graph.ImageHelper().ResizeImage(SavePath, CoverSavePath, width, height, pbool); } //更新封面 string Cover = ""; if (ptype != 14) { Cover = new BCW.BLL.Detail().GetCover(newId); } else { Cover = new BCW.BLL.Goods().GetCover(newId); } if (Cover != "") { BCW.Files.FileTool.DeleteFile(Cover); } if (ptype != 14) { new BCW.BLL.Detail().UpdateCover(newId, CoverDirPath + fileName); } else { new BCW.BLL.Goods().UpdateCover(newId, CoverDirPath + fileName); } } catch { } } } } }
protected void Page_Load(object sender, EventArgs e) { int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误")); int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[0-9]\d*$", "0")); string Title = ""; if (ptype == 0) { Title = new BCW.BLL.Detail().GetTitle(id); } else { Title = new BCW.BLL.Goods().GetTitle(id); } if (Title == "") { Utils.Error("不存在的记录", ""); } string act = Utils.GetRequest("act", "all", 1, "", ""); switch (act) { case "add": AddComment(id, ptype); break; case "admin": AdminComment(Title, id, ptype); break; case "del": DelComment(Title, id, ptype); break; case "reok": ReOkComment(Title, id, ptype); break; case "ok": SaveComment(id, ptype); break; default: ReloadPage(Title, id, ptype); break; } }
private void DetailPage(int ptype, string NodeId) { Master.Title = "资源搜索"; string keyword = Utils.GetRequest("keyword", "all", 2, @"^[\s\S]{1,102}$", "请输入1-10字的搜索关键字"); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("搜索:'" + keyword + "'"); builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = ""; string[] pageValUrl = { "pt", "keyword", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 if (ptype == 0) { strWhere = "Types=11 and (Title like '%" + keyword + "%' OR '#'+KeyWord+'#' like '%#" + keyword + "#%')"; } else if (ptype == 1) { strWhere = "Types=13 and (Title like '%" + keyword + "%' OR '#'+KeyWord+'#' like '%#" + keyword + "#%')"; } else if (ptype == 2) { strWhere = "Types=12 and (Title like '%" + keyword + "%' OR '#'+KeyWord+'#' like '%#" + keyword + "#%')"; } else if (ptype == 3) { strWhere = "(Title like '%" + keyword + "%' OR '#'+KeyWord+'#' like '%#" + keyword + "#%')"; } if (NodeId != "0" && NodeId.Contains(";")) { NodeId = NodeId.Replace(";", ","); strWhere += " and NodeId in(" + NodeId + ")"; } // 开始读取列表 if (ptype < 3) { IList <BCW.Model.Detail> listDetail = new BCW.BLL.Detail().GetDetails(pageIndex, pageSize, strWhere, out recordCount); if (listDetail.Count > 0) { int k = 1; foreach (BCW.Model.Detail n in listDetail) { if (k % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { if (k == 1) { builder.Append(Out.Tab("<div>", "")); } else { builder.Append(Out.Tab("<div>", "<br />")); } } builder.AppendFormat("<a href=\"" + Utils.getUrl("detail.aspx?id={0}&backurl=" + Utils.PostPage(1) + "") + "\">{1}.{2}</a>", n.ID, (pageIndex - 1) * pageSize + k, n.Title); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } } else if (ptype == 3) { // 开始读取列表 IList <BCW.Model.Goods> listGoods = new BCW.BLL.Goods().GetGoodss(pageIndex, pageSize, strWhere, out recordCount); if (listGoods.Count > 0) { int k = 1; foreach (BCW.Model.Goods n in listGoods) { if (k % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { if (k == 1) { builder.Append(Out.Tab("<div>", "")); } else { builder.Append(Out.Tab("<div>", "<br />")); } } builder.AppendFormat("<a href=\"" + Utils.getUrl("shopdetail.aspx?id={0}&backurl=" + Utils.PostPage(1) + "") + "\">{2}.{3}</a>", n.ID, pageIndex, (pageIndex - 1) * pageSize + k, n.Title); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } } else if (ptype == 4) { strWhere += "Title like '%" + keyword + "%'"; string strOrder = "ID Desc"; // 开始读取列表 IList <BCW.Model.Text> listText = new BCW.BLL.Text().GetTexts(pageIndex, pageSize, strWhere, strOrder, out recordCount); if (listText.Count > 0) { int k = 1; foreach (BCW.Model.Text n in listText) { if (k % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { if (k == 1) { builder.Append(Out.Tab("<div>", "")); } else { builder.Append(Out.Tab("<div>", "<br />")); } } builder.AppendFormat("<a href=\"" + Utils.getUrl("/bbs/topic.aspx?forumid=" + n.ForumId + "&bid={0}&backurl=" + Utils.getPage(0) + "") + "\">{1}.{2}</a>", n.ID, (pageIndex - 1) * pageSize + k, n.Title); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } } builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getPage("search.aspx").Replace("&?", "?") + "\">返回上级</a>"); builder.Append(Out.Tab("</div>", "")); }
private void ReloadPage() { //用户资料 int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误")); if (!new BCW.BLL.Goods().Exists(id)) { Utils.Error("不存在的记录", ""); } BCW.Model.Goods model = new BCW.BLL.Goods().GetGoods(id); Master.Title = "购买宝贝"; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("购买宝贝"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div>", "<br />")); builder.Append("单价:"); if (model.PostType == 0) { builder.Append("¥" + Convert.ToDouble(model.VipMoney) + "元"); } else if (model.PostType == 1) { builder.Append(Convert.ToDouble(model.VipMoney) + "" + ub.Get("SiteBz")); } else { builder.Append(Convert.ToDouble(model.VipMoney) + "" + ub.Get("SiteBz2")); } builder.Append("<br />库存:" + (model.StockCount - model.SellCount) + "件"); if (model.PayType == 0 || model.PayType == 2) { if (model.PayType == 0) { builder.Append("<br />送货:货到付款"); } else { builder.Append("<br />送货:先付款后发货"); } } else { builder.Append("<br />送货方式:当面交易"); } builder.Append(Out.Tab("</div>", "")); string postMoney = string.Empty; if (!string.IsNullOrEmpty(model.PostMoney)) { string[] sTemp = model.PostMoney.Split("|".ToCharArray()); int k = 1; for (int j = 0; j < sTemp.Length; j++) { if (j % 2 == 0) { postMoney += "|" + k + "|" + sTemp[j + 1] + "" + sTemp[j].ToString() + "元"; } k++; } postMoney = "0|选择邮寄" + postMoney; } else { postMoney = "0|卖家包邮"; } string strText = "购买数量:/,您的姓名:/,您的手机号或固话:/,收货地址(详细到门牌号):/,邮寄方式:/,备注(如颜色和尺寸):/,,,"; string strName = "Paycount,RealName,Mobile,Address,pType,Notes,id,act,backurl"; string strType = "num,text,text,text,select,text,hidden,hidden,hidden"; string strValu = "1''''0''" + id + "'ok'" + Utils.getPage(0) + ""; string strEmpt = "false,false,false,false," + postMoney + ",true,,,"; string strIdea = "/"; string strOthe = "立即下单|reset,shopbuy.aspx,post,1,red|blue"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("shopdetail.aspx?id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">>>" + model.Title + "</a>"); builder.Append(Out.Tab("</div>", "")); }
private void SaveBuylist() { //用户资料 int meid = new BCW.User.Users().GetUsId(); string mename = new BCW.BLL.User().GetUsName(meid); if (meid == 0) { Utils.Login(); } int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误")); if (!new BCW.BLL.Goods().Exists(id)) { Utils.Error("不存在的记录", ""); } //是否刷屏 string appName = "BUYLIST"; int Expir = Convert.ToInt32(ub.GetSub("BuylistExpir", xmlPath)); BCW.User.Users.IsFresh(appName, Expir); int Paycount = int.Parse(Utils.GetRequest("Paycount", "post", 2, @"^[0-9]\d*$", "购买数量错误")); string RealName = Utils.GetRequest("RealName", "post", 2, @"^[\u4e00-\u9fa5]{2,8}$", "姓名填写错误"); string Mobile = Utils.GetRequest("Mobile", "post", 2, @"^(?:13|15|18)\d{9}$|^(\d{3}-|\d{4}-)?(\d{8}|\d{7})?(-\d+)?$", "联系电话不正确,必填固话或者手机号"); string Address = Utils.GetRequest("Address", "post", 2, @"^[\s\S]{8,}$", "收货地址请尽量详细到门牌号"); int pType = int.Parse(Utils.GetRequest("pType", "post", 2, @"^[0-9]\d*$", "邮寄方式选择错误")); string Notes = Utils.GetRequest("Notes", "post", 3, @"^[\s\S]{1,200}$", "备注限200字,可以留空"); BCW.Model.Goods modelGoods = new BCW.BLL.Goods().GetGoods(id); Master.Title = "购买宝贝"; builder.Append(Out.Tab("<div class=\"title\">购买宝贝</div>", "")); builder.Append(Out.Tab("<div class=\"text\">", "")); if ((modelGoods.StockCount - modelGoods.SellCount) < Paycount) { Utils.Error("对不起,目前最多可以购买" + (modelGoods.StockCount - modelGoods.SellCount) + "件", ""); } int pMoney = 0; if (!string.IsNullOrEmpty(modelGoods.PostMoney)) { string[] sTemp = modelGoods.PostMoney.Split("|".ToCharArray()); int k = 1; pMoney = -1; for (int j = 0; j < sTemp.Length; j++) { if (j % 2 == 0) { if (k == pType) { pMoney = Convert.ToInt32(sTemp[j].ToString()); break; } } k++; } if (pMoney == -1) { Utils.Error("邮寄方式选择错误", ""); } } //扣币与内线 if (modelGoods.PostType > 0) { if (modelGoods.PostType == 1) { if (new BCW.BLL.User().GetGold(meid) < Convert.ToInt64(modelGoods.VipMoney)) { Utils.Error("您的" + ub.Get("SiteBz") + "不足", ""); } else if (modelGoods.PostType == 2) { if (new BCW.BLL.User().GetMoney(meid) < Convert.ToInt64(modelGoods.VipMoney)) { Utils.Error("您的" + ub.Get("SiteBz2") + "不足", ""); } } if (modelGoods.PostType == 1) { new BCW.BLL.User().UpdateiGold(meid, mename, -Convert.ToInt64(modelGoods.VipMoney), "购买商品《" + modelGoods.Title + "》"); //发信给下订单的会员 new BCW.BLL.Guest().Add(meid, mename, "您已成功购买[url=/shopdetail.aspx?id=" + id + "]" + modelGoods.Title + "[/url],扣除您的" + Convert.ToInt64(modelGoods.VipMoney) + "" + ub.Get("SiteBz") + ",多谢惠顾![br][url=/myshop.aspx]>我的订单[/url]"); } else if (modelGoods.PostType == 2) { new BCW.BLL.User().UpdateiMoney(meid, mename, -Convert.ToInt64(modelGoods.VipMoney), "购买商品《" + modelGoods.Title + "》"); //发信给下订单的会员 new BCW.BLL.Guest().Add(meid, mename, "您已成功购买[url=/shopdetail.aspx?id=" + id + "]" + modelGoods.Title + "[/url],扣除您的" + Convert.ToInt64(modelGoods.VipMoney) + "" + ub.Get("SiteBz2") + ",多谢惠顾![br][url=/myshop.aspx]>我的订单[/url]"); } } } else { //发信给下订单的会员 new BCW.BLL.Guest().Add(meid, mename, "您已成功购买[url=/shopdetail.aspx?id=" + id + "]" + modelGoods.Title + "[/url],如果商品要求先付款再发货,请尽快付款,多谢惠顾![br][url=/myshop.aspx]>我的订单[/url]"); } //生成订单号 string Ding = DT.getDateTimeNum(); //写入订单 BCW.Model.Buylist model = new BCW.Model.Buylist(); model.TingNo = Ding; model.NodeId = new BCW.BLL.Goods().GetNodeId(id); model.GoodsId = id; model.Title = modelGoods.Title; model.Price = modelGoods.VipMoney; model.Paycount = Paycount; if (modelGoods.PayType == 1) { model.PostMoney = -1; } else { model.PostMoney = pMoney; } model.SellId = 0;//系统默认ID,说明是系统发布的商品 model.UserId = meid; model.UserName = mename; model.RealName = RealName; model.Mobile = Mobile; model.Address = Address; model.Notes = Notes; model.AcPrice = Convert.ToInt32(Paycount * modelGoods.VipMoney); model.AcStats = 0; model.AcText = ""; model.AddUsIP = Utils.GetUsIP(); model.AddTime = DateTime.Now; new BCW.BLL.Buylist().Add(model); //更新购买人数 new BCW.BLL.Goods().UpdatePaycount(id, 1); //更新出售数量 new BCW.BLL.Goods().UpdateSellCount(id, Paycount); builder.Append("购买宝贝成功"); builder.Append("<br />订单号:" + Ding + ""); builder.Append("<br />进入:<a href=\"" + Utils.getUrl("myshop.aspx?id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">我的订单</a>"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getUrl("shopdetail.aspx?id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">上级</a>"); builder.Append(Out.Tab("</div>", "")); }
private void ViewBuy() { int id = int.Parse(Utils.GetRequest("id", "get", 1, @"^[0-9]\d*$", "0")); int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } if (!new BCW.BLL.Buylist().Exists(id, meid)) { Utils.Error("不存在的记录", ""); } BCW.Model.Buylist model = new BCW.BLL.Buylist().GetBuylist(id, meid); Master.Title = "我的订单"; builder.Append(Out.Tab("<div class=\"title\">我的订单</div>", "")); //读取商品实体 BCW.Model.Goods modelGoods = new BCW.BLL.Goods().GetGoods(model.GoodsId); if (modelGoods == null) { Utils.Error("不存在的商品记录", ""); } builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("<a href=\"" + Utils.getUrl("shopdetail.aspx?id=" + model.GoodsId + "&backurl=" + Utils.PostPage(1) + "") + "\">.." + model.Title + "</a>"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div>", "<br />")); builder.Append("订单号:" + model.TingNo + ""); builder.Append("<br />单价:"); if (modelGoods.PostType == 0) { builder.Append("¥" + Convert.ToDouble(model.Price) + "元"); } else if (modelGoods.PostType == 1) { builder.Append(Convert.ToDouble(model.Price) + "" + ub.Get("SiteBz")); } else { builder.Append(Convert.ToDouble(model.Price) + "" + ub.Get("SiteBz2")); } builder.Append("<br />购买数量" + model.Paycount + ""); if (model.PostMoney == -1) { builder.Append("送货方式:当面交易"); } else { builder.Append("<br />邮费:"); if (model.PostMoney == 0) { builder.Append("包邮"); } else { builder.Append(model.PostMoney + "元"); } } builder.Append("<br />你的姓名:" + model.RealName + ""); builder.Append("<br />你的电话:" + model.Mobile + ""); builder.Append("<br />送货地址:" + model.Address + ""); builder.Append("<br />备注:" + model.Notes + ""); builder.Append("<br />总金额:"); if (modelGoods.PostType == 0) { builder.Append("¥" + Convert.ToDouble(model.AcPrice) + "元"); } else if (modelGoods.PostType == 1) { builder.Append(Convert.ToDouble(model.AcPrice) + "" + ub.Get("SiteBz")); } else { builder.Append(Convert.ToDouble(model.AcPrice) + "" + ub.Get("SiteBz2")); } builder.Append("<br />状态:" + BCW.User.AppCase.CaseBuyStats(model.AcStats) + ""); //商家信息 if (model.AcStats != 0) { if (!string.IsNullOrEmpty(model.AcEms)) { builder.Append("<br />运单号:" + model.AcEms + ""); } if (!string.IsNullOrEmpty(model.AcText)) { builder.Append("<br />管理员附言:" + model.AcText + ""); } if (!string.IsNullOrEmpty(model.LaNotes)) { builder.Append("<br />您的评价:" + model.LaNotes + ""); } } builder.Append("<br />时间:" + model.AddTime + ""); builder.Append(Out.Tab("</div>", "")); if (model.AcStats == 2) { string strText = "输入评价:/,,,"; string strName = "LaNotes,stats,id,act"; string strType = "text,select,hidden,hidden"; string strValu = "" + model.LaNotes + "'3'" + id + "'ok"; string strEmpt = "true,3|交易成功,false,false"; string strIdea = ""; string strOthe = "确定,myshop.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); } if (model.AcStats == 0) { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("myshop.aspx?act=del&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">删除此订单</a>"); builder.Append(Out.Tab("</div>", "")); } builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getUrl("shopdetail.aspx?id=" + modelGoods.ID + "&backurl=" + Utils.getPage(0) + "") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("myshop.aspx") + "\">订单记录</a>"); builder.Append(Out.Tab("</div>", "")); }
private void InsertGoods(int ptype, int nid, int id) { if (id != 0) { Master.Title = "编辑商品"; builder.Append(Out.Tab("<div class=\"title\">WAP2.0编辑商品</div>", "编辑商品")); } else { Master.Title = "添加商品"; builder.Append(Out.Tab("<div class=\"title\">WAP2.0添加商品</div>", "添加商品")); } int picNum = 0; if (!Utils.Isie()) { if (id != 0) { strText = "商品标题:/,商品配置(支持Ubb):/,商品内容(支持Ubb):/,商品性质:/,付款币种:/,市场价格(元.可保留1-2位小数):/,会员价格(元或币.可保留1-2位小数):/,出售总量(件):/,已出售(件):/,购买人数:/,联系QQ|电话|其它(支持Ubb):/,送货方式:/,邮递邮费(留空则免邮费):/,搜索关键字:(多个用#分隔)/,,,,"; strName = "Title,Config,Content,IsAd,PostType,CityMoney,VipMoney,StockCount,SellCount,PayCount,Mobile,PayType,PostMoney,KeyWord,ptype,nid,id,act"; strType = "text,big,big,select,select,text,text,num,num,num,text,select,text,textarea,hidden,hidden,hidden,hidden"; //读取实体 BCW.Model.Goods model = new BCW.BLL.Goods().GetGoods(id); if (model.Files != "") { picNum = (Utils.GetStringNum(model.Files, "#")) + 1; } strValu = "" + model.Title + "'" + model.Config + "'" + model.Content + "'" + model.IsAd + "'" + model.PostType + "'" + Convert.ToDouble(model.CityMoney) + "'" + Convert.ToDouble(model.VipMoney) + "'" + model.StockCount + "'" + model.SellCount + "'" + model.Paycount + "'" + model.Mobile + "'" + model.PayType + "'" + model.PostMoney + "'" + model.KeyWord + "'" + ptype + "'" + nid + "'" + id + "'shop"; strEmpt = "false,true,false,True|正常文章|False|跳到广告,0|人民币|1|" + ub.Get("SiteBz") + "|2|" + ub.Get("SiteBz2") + ",false,false,false,false,false,false,0|货到付款|1|当面交易|2|先付款后发货,true,,,,"; } else { strText = "商品标题:/,商品配置(支持Ubb):/,商品内容(支持Ubb):/,商品性质:/,付款币种:/,市场价格(元.可保留1-2位小数):/,会员价格(元或币.可保留1-2位小数):/,出售总量(件):/,联系QQ|电话|其它(支持Ubb):/,送货方式:/,邮递邮费(留空则免邮费):/,搜索关键字:(多个用#分隔)/,,,,"; strName = "Title,Config,Content,IsAd,PostType,CityMoney,VipMoney,StockCount,Mobile,PayType,PostMoney,KeyWord,ptype,nid,id,act"; strType = "text,big,big,select,select,text,text,num,text,select,text,textarea,hidden,hidden,hidden,hidden"; strValu = "'''True'0'''''0'''" + ptype + "'" + nid + "'" + id + "'shop"; strEmpt = "false,true,false,True|正常商品|False|跳到广告,0|人民币|1|" + ub.Get("SiteBz") + "|2|" + ub.Get("SiteBz2") + ",false,false,false,false,0|货到付款|1|当面交易|2|先付款后发货,true,,,,"; } strIdea = "/"; strOthe = ""; if (id != 0) { strOthe = "确定编辑|reset,classok.aspx,post,1,red|blue"; } else { strOthe = "确定添加|reset,classok.aspx,post,1,red|blue"; } builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); } else { builder.Append(Out.Tab("<div>", "")); builder.Append("图片:"); for (int i = 1; i < 10; i++) { builder.Append("<a href=\"" + Utils.getUrl("classact.aspx?act=view&nid=" + nid + "&id=" + id + "&ptype=" + ptype + "&num=" + i + "") + "\"><b>" + i + "</b></a> "); } builder.Append("张"); builder.Append(Out.Tab("</div>", "")); int num = int.Parse(Utils.GetRequest("num", "get", 1, @"^[0-9]\d*$", "1")); if (num > 10) { num = 10; } //编辑状态时的显示 string sUpType = string.Empty; string sText = string.Empty; string sName = string.Empty; string sType = string.Empty; string sValu = string.Empty; string sEmpt = string.Empty; if (id != 0) { BCW.Model.Goods model = new BCW.BLL.Goods().GetGoods(id); if (model.Files != "") { picNum = (Utils.GetStringNum(model.Files, "#")) + 1; } sUpType = "续传"; sText = "商品标题:/,商品配置(支持Ubb):/,商品内容(支持Ubb):/,商品性质:/,付款币种:/,市场价格(元.可保留1-2位小数):/,会员价格(元.可保留1-2位小数):/,出售总量(件):/,已出售(件):/,购买人数:/,联系QQ|电话|其它(支持Ubb):/,送货方式:/,邮递邮费(留空则免邮费):/,搜索关键字:(多个用#分隔)/,"; sName = "Title,Config,Content,IsAd,PostType,CityMoney,VipMoney,StockCount,SellCount,PayCount,Mobile,PayType,PostMoney,KeyWord,"; sType = "text,big,big,select,select,text,text,num,num,num,text,select,text,textarea,"; sValu = "" + model.Title + "'" + model.Config + "'" + model.Content + "'" + model.IsAd + "'" + model.PostType + "'" + Convert.ToDouble(model.CityMoney) + "'" + Convert.ToDouble(model.VipMoney) + "'" + model.StockCount + "'" + model.SellCount + "'" + model.Paycount + "'" + model.Mobile + "'" + model.PayType + "'" + model.PostMoney + "'" + model.KeyWord + "'"; sEmpt = "false,true,false,True|正常文章|False|跳到广告,0|人民币|1|" + ub.Get("SiteBz") + "|2|" + ub.Get("SiteBz2") + ",false,false,false,false,false,false,0|货到付款|1|当面交易|2|先付款后发货,true,"; } else { sText = "商品标题:/,商品配置(支持Ubb):/,商品内容(支持Ubb):/,商品性质:/,付款币种:/,市场价格(元.可保留1-2位小数):/,商城特价(元.可保留1-2位小数):/,出售总量(件):/,联系QQ|电话|其它(支持Ubb):/,送货方式:/,邮递邮费(留空则免邮费):/,搜索关键字:(多个用#分隔)/,"; sName = "Title,Config,Content,IsAd,PostType,CityMoney,VipMoney,StockCount,Mobile,PayType,PostMoney,KeyWord,"; sType = "text,big,big,select,select,text,text,num,text,select,text,textarea,"; sValu = "'''True'0'''''0'''"; sEmpt = "false,true,false,True|正常商品|False|跳到广告,0|人民币|1|" + ub.Get("SiteBz") + "|2|" + ub.Get("SiteBz2") + ",false,false,false,false,0|货到付款|1|当面交易|2|先付款后发货,true,"; } for (int i = 0; i < num; i++) { string y = ","; if (num == 1) { strText = strText + y + "选择" + sUpType + "附图:/"; } else { strText = strText + y + "" + sUpType + "第" + (i + 1) + "个附图:/"; } strName = strName + y + "file" + (i + 1); strType = strType + y + "file"; strValu = strValu + "'"; strEmpt = strEmpt + y; } strText = sText + Utils.Mid(strText, 1, strText.Length) + ",,,,"; strName = sName + Utils.Mid(strName, 1, strName.Length) + ",ptype,nid,id,act"; strType = sType + Utils.Mid(strType, 1, strType.Length) + ",hidden,hidden,hidden,hidden"; strValu = sValu + Utils.Mid(strValu, 1, strValu.Length) + "'" + ptype + "'" + nid + "'" + id + "'shop"; strEmpt = sEmpt + Utils.Mid(strEmpt, 1, strEmpt.Length) + ",,,,"; strIdea = "/"; strOthe = "发表文本|上传|reset,classok.aspx,post,2,red|blue|blue"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); } if (id != 0) { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("温馨提示:搜索关键字留空时,系统将根据标题自动生成.<br />邮递邮费填写例子:15|快递|20|EMS<br />"); builder.Append("<a href=\"" + Utils.getUrl("../shopdetail.aspx?id=" + id + "&backurl=" + Utils.PostPage(1) + "") + "\">预览</a>"); builder.Append(" <a href=\"" + Utils.getUrl("class.aspx?act=delfile&nid=" + nid + "&id=" + id + "&ptype=" + ptype + "") + "\">删附图(" + picNum + ")</a>"); builder.Append(Out.Tab("</div>", "")); } }
/// <summary> /// 添加/编辑商品 /// </summary> private void UpdateShop(string act, string TypeName, int ptype, int nid, int id) { string aName = string.Empty; if (id == 0) { aName = "添加" + TypeName + ""; } else { aName = "编辑" + TypeName + ""; } Master.Title = aName; string ac = Utils.GetRequest("ac", "post", 1, "", ""); string Title = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{1,50}$", "商品名称限1-50字"); string Config = Utils.GetRequest("Config", "post", 3, @"^[\s\S]{1,500}$", "商品配置最多500字"); string Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{1,}$", "商品内容不能为空"); bool IsAd = bool.Parse(Utils.GetRequest("IsAd", "post", 2, @"^False|True$", "商品性质选择错误")); int PostType = int.Parse(Utils.GetRequest("PostType", "post", 2, @"^[0-2]$", "付款方式选择错误")); decimal CityMoney = Convert.ToDecimal(Utils.GetRequest("CityMoney", "post", 2, @"^(\d)*(\.(\d){0,2})?$", "市场价格填写错误")); decimal VipMoney = Convert.ToDecimal(Utils.GetRequest("VipMoney", "post", 2, @"^(\d)*(\.(\d){0,2})?$", "市场价格填写错误")); int StockCount = int.Parse(Utils.GetRequest("StockCount", "post", 2, @"^[0-9]\d*$", "出售总量填写错误")); int SellCount = int.Parse(Utils.GetRequest("SellCount", "post", 1, @"^[0-9]\d*$", "0")); int PayCount = int.Parse(Utils.GetRequest("PayCount", "post", 1, @"^[0-9]\d*$", "0")); string Mobile = Utils.GetRequest("Mobile", "post", 2, @"^[\s\S]{1,200}$", "联系方式限200字"); int PayType = int.Parse(Utils.GetRequest("PayType", "post", 2, @"^[0-9]\d*$", "送货方式选择错误")); string PostMoney = Utils.GetRequest("PostMoney", "post", 3, @"^[^\|]{1,50}(?:\|[^\|]{1,50}){1,500}$", "邮递邮费填写错误,可以留空"); string KeyWord = Utils.GetRequest("KeyWord", "post", 1, "", ""); string sFiles = string.Empty; int newId = 0; //关键字的生成 if (string.IsNullOrEmpty(KeyWord)) { KeyWord = Out.CreateKeyWord(Title, 2); } else { if (KeyWord.Length > 500) { Utils.Error("关键字不能超500字", ""); } KeyWord = Utils.GetRequest("KeyWord", "post", 2, @"^[^\#]{1,50}(?:\#[^\#]{1,50}){0,500}$", "关键字填写格式错误"); } //----------计算邮递邮费合法性开始 if (PostMoney != "") { int GetNum = Utils.GetStringNum(PostMoney, "|"); if (GetNum % 2 == 0) { Utils.Error("邮递邮费填写错误,可以留空", ""); } } //添加验证 if (id == 0) { if (new BCW.BLL.Goods().Exists(Title)) { Utils.Error("数据库记录已存在“" + Title + "”", ""); } } //写进数据库 BCW.Model.Goods model = new BCW.Model.Goods(); model.Title = Title; model.KeyWord = KeyWord; model.IsAd = IsAd; model.Mobile = Mobile; model.CityMoney = CityMoney; model.VipMoney = VipMoney; model.SellCount = SellCount; model.StockCount = StockCount; model.Paycount = PayCount; model.PayType = PayType; model.PostType = PostType; model.PostMoney = PostMoney; model.UsId = 0; model.NodeId = nid; model.Content = Content; model.AddTime = DateTime.Now; model.Readcount = 0; model.Evcount = 0; model.Config = Config; if (id == 0) { newId = new BCW.BLL.Goods().Add(model); } else { newId = id; model.ID = id; new BCW.BLL.Goods().Update(model); } //商品附图上传开始 if (Utils.ToSChinese(ac) == "上传") { if (SaveFiles(ptype, newId, out sFiles)) { aName += "/上传商品附图"; } } //商品附图上传结束 //得到截图文件 string sPics = ""; string Pics = ""; if (sFiles != "") { sPics = Utils.Mid(sFiles, 1, sFiles.Length); } if (sPics == "#") { sPics = ""; } if (sPics != "") { Pics = new BCW.BLL.Goods().GetFiles(newId); if (Pics != "") { sPics = Pics + "#" + sPics; } new BCW.BLL.Goods().UpdateFiles(newId, sPics); } builder.Append(Out.Tab("<div class=\"title\">", "<br />")); builder.Append("" + aName + "成功"); builder.Append(Out.Tab("</div>", "")); }
protected void Page_Load(object sender, EventArgs e) { int id = int.Parse(Utils.GetRequest("id", "all", 1, @"^[0-9]\d*$", "0")); if (!new BCW.BLL.Topics().Exists(id)) { Utils.Error("不存在的记录", ""); } BCW.Model.Topics model = new BCW.BLL.Topics().GetTopics(id); Master.Title = model.Title; //顶部调用 string TopUbb = string.Empty; TopUbb = ub.GetSub("FtShopListTop", xmlPath); if (TopUbb != "") { TopUbb = BCW.User.AdminCall.AdminUBB(Out.SysUBB(TopUbb)); if (TopUbb.IndexOf("</div>") == -1) { builder.Append(Out.Tab("<div>", "")); builder.Append(TopUbb); builder.Append(Out.Tab("</div>", "")); } else { builder.Append(TopUbb); } } builder.Append(Out.Tab("<div class=\"title\">" + model.Title + "</div>", "")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = ""; string[] pageValUrl = { "id" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 strWhere = "NodeId=" + id + ""; // 开始读取列表 IList <BCW.Model.Goods> listGoods = new BCW.BLL.Goods().GetGoodss(pageIndex, pageSize, strWhere, out recordCount); if (listGoods.Count > 0) { int k = 1; foreach (BCW.Model.Goods n in listGoods) { if (k % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { if (k == 1) { builder.Append(Out.Tab("<div>", "")); } else { builder.Append(Out.Tab("<div>", "<br />")); } } builder.AppendFormat("<a href=\"" + Utils.getUrl("shopdetail.aspx?id={0}&backurl=" + Utils.PostPage(1) + "") + "\">{2}.{3}</a>", n.ID, pageIndex, (pageIndex - 1) * pageSize + k, n.Title); if (!string.IsNullOrEmpty(n.Cover) && IsCover() == true) { builder.Append("<br /><img src=\"" + n.Cover + "\" alt=\"load\"/>"); } k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } //底部调用 string FootUbb = string.Empty; FootUbb = ub.GetSub("FtShopListFoot", xmlPath); if (FootUbb != "") { FootUbb = BCW.User.AdminCall.AdminUBB(Out.SysUBB(FootUbb)); if (FootUbb.IndexOf("</div>") == -1) { builder.Append(Out.Tab("<div>", "")); builder.Append(FootUbb); builder.Append(Out.Tab("</div>", "")); } else { builder.Append(FootUbb); } } builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getPage("default.aspx") + "\">上级</a>"); if (model.NodeId != 0) { builder.Append("-<a href=\"" + Utils.getUrl("default.aspx?id=" + model.NodeId + "") + "\">" + new BCW.BLL.Topics().GetTitle(model.NodeId) + "</a>"); } builder.Append(Out.Tab("</div>", "")); }
private void ReloadPage() { int uid = int.Parse(Utils.GetRequest("uid", "all", 1, @"^[0-9]\d*$", "0")); int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[0-9]\d*$", "0")); int id = int.Parse(Utils.GetRequest("id", "all", 1, @"^[0-9]\d*$", "0")); Master.Title = "商品订单管理"; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("商品订单管理"); builder.Append(Out.Tab("</div>", "<br />")); if (id != 0) { if (!new BCW.BLL.Goods().Exists(id)) { Utils.Error("不存在的记录", ""); } string Title = new BCW.BLL.Goods().GetTitle(id); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("<a href=\"" + Utils.getUrl("../shopdetail.aspx?id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">.." + Title + "</a>"); builder.Append(Out.Tab("</div>", "<br />")); } builder.Append(Out.Tab("<div class=\"text\">", "")); if (ptype == 0) { builder.Append("待审|"); } else { builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?id=" + id + "&uid=" + uid + "&ptype=0&backurl=" + Utils.getPage(0) + "") + "\">待审</a>|"); } if (ptype == 1) { builder.Append("待发|"); } else { builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?id=" + id + "&uid=" + uid + "&ptype=1&backurl=" + Utils.getPage(0) + "") + "\">待发</a>|"); } if (ptype == 2) { builder.Append("已发|"); } else { builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?id=" + id + "&uid=" + uid + "&ptype=2&backurl=" + Utils.getPage(0) + "") + "\">已发</a>|"); } if (ptype == 3) { builder.Append("成功|"); } else { builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?id=" + id + "&uid=" + uid + "&ptype=3&backurl=" + Utils.getPage(0) + "") + "\">成功</a>|"); } if (ptype == 4) { builder.Append("失败"); } else { builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?id=" + id + "&uid=" + uid + "&ptype=4&backurl=" + Utils.getPage(0) + "") + "\">失败</a>"); } builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = ""; string[] pageValUrl = { "id", "uid", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 if (uid != 0) { strWhere += "userid=" + uid + "and "; } strWhere += " AcStats=" + ptype + ""; // 开始读取列表 IList <BCW.Model.Buylist> listBuylist = new BCW.BLL.Buylist().GetBuylists(pageIndex, pageSize, strWhere, out recordCount); if (listBuylist.Count > 0) { int k = 1; foreach (BCW.Model.Buylist n in listBuylist) { if (k % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { if (k == 1) { builder.Append(Out.Tab("<div>", "")); } else { builder.Append(Out.Tab("<div>", "<br />")); } } builder.AppendFormat("<a href=\"" + Utils.getUrl("shopbuy.aspx?act=view&id={0}&backurl=" + Utils.PostPage(true) + "") + "\">{2}.{3}</a>(" + BCW.User.AppCase.CaseBuyStats(n.AcStats) + ")<br />共{4}元.{5}", n.ID, pageIndex, (pageIndex - 1) * pageSize + k, n.Title, Convert.ToDouble(n.AcPrice), DT.FormatDate(n.AddTime, 2)); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } if (id == 0) { string strText = "输入用户ID:/"; string strName = "uid"; string strType = "num"; string strValu = "'"; string strEmpt = "true"; string strIdea = "/"; string strOthe = "搜订单,shopbuy.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); } builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); if (Utils.getPage(1) != "") { builder.Append(" <a href=\"" + Utils.getPage(1) + "\">返回上一级</a><br />"); } //商品推广功能 if (Utils.GetDomain().Contains("127.0.0.6") || Utils.GetDomain().Contains("xgbxj.net")) { builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?act=appbank") + "\">推广拥金结算</a><br />"); } builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>")); builder.Append(Out.Tab("</div>", "<br />")); }
private void ViewBuy() { int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[0-9]\d*$", "ID错误")); if (!new BCW.BLL.Buylist().Exists(id)) { Utils.Error("不存在的记录", ""); } BCW.Model.Buylist model = new BCW.BLL.Buylist().GetBuylist(id); Master.Title = "查看订单"; builder.Append(Out.Tab("<div class=\"title\">查看订单</div>", "")); //读取商品实体 BCW.Model.Goods modelGoods = new BCW.BLL.Goods().GetGoods(model.GoodsId); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("<a href=\"" + Utils.getUrl("/shopdetail.aspx?id=" + model.GoodsId + "&backurl=" + Utils.PostPage(1) + "") + "\">.." + model.Title + "</a>"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div>", "<br />")); builder.Append("购买用户:<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + model.UserId + "&backurl=" + Utils.PostPage(1) + "") + "\">" + model.UserName + "(" + model.UserId + ")</a>"); builder.Append("<br />订单号:" + model.TingNo + ""); builder.Append("<br />单价:"); if (modelGoods.PostType == 0) { builder.Append("¥" + Convert.ToDouble(model.Price) + "元"); } else if (modelGoods.PostType == 1) { builder.Append(Convert.ToDouble(model.Price) + "" + ub.Get("SiteBz")); } else { builder.Append(Convert.ToDouble(model.Price) + "" + ub.Get("SiteBz2")); } builder.Append("<br />购买数量:" + model.Paycount + ""); if (model.PostMoney == -1) { builder.Append("送货方式:当面交易"); } else { builder.Append("<br />邮费:"); if (model.PostMoney == 0) { builder.Append("包邮"); } else { builder.Append(model.PostMoney + "元"); } } builder.Append("<br />姓名:" + model.RealName + ""); builder.Append("<br />电话:" + model.Mobile + ""); builder.Append("<br />送货地址:" + model.Address + ""); builder.Append("<br />备注:" + model.Notes + ""); builder.Append("<br />实收金额:"); if (modelGoods.PostType == 0) { builder.Append("¥" + Convert.ToDouble(model.AcPrice) + "元"); } else if (modelGoods.PostType == 1) { builder.Append(Convert.ToDouble(model.AcPrice) + "" + ub.Get("SiteBz")); } else { builder.Append(Convert.ToDouble(model.AcPrice) + "" + ub.Get("SiteBz2")); } builder.Append("<br />状态:" + BCW.User.AppCase.CaseBuyStats(model.AcStats) + ""); //商家信息 if (model.AcStats != 0) { if (!string.IsNullOrEmpty(model.AcEms)) { builder.Append("<br />运单号:" + model.AcEms + ""); } if (!string.IsNullOrEmpty(model.AcText)) { builder.Append("<br />管理员附言:" + model.AcText + ""); } if (!string.IsNullOrEmpty(model.LaNotes)) { builder.Append("<br />买家评价:" + model.LaNotes + ""); } } builder.Append("<br />时间:" + model.AddTime + ""); builder.Append(Out.Tab("</div>", "")); if (model.AcStats != 3 && model.AcStats != 4) { string strText = "运单号(可空):/,附言(可空):/,状态:,,,"; string strName = "AcEms,AcText,stats,id,act,backurl"; string strType = "text,text,select,hidden,hidden,hidden"; string strValu = "" + model.AcEms + "'" + model.AcText + "'" + model.AcStats + "'" + id + "'ok'" + Utils.getPage(0) + ""; string strEmpt = "true,true,0|" + BCW.User.AppCase.CaseBuyStats(0) + "|1|" + BCW.User.AppCase.CaseBuyStats(1) + "|2|" + BCW.User.AppCase.CaseBuyStats(2) + "|3|" + BCW.User.AppCase.CaseBuyStats(3) + "|4|" + BCW.User.AppCase.CaseBuyStats(4) + ",false,false,false"; string strIdea = "/"; string strOthe = "确定,shopbuy.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); } builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?act=edit&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">修改订单</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?act=del&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">删除订单</a><br />"); if (Utils.getPage(1) != "") { builder.Append("<a href=\"" + Utils.getPage(1) + "\">返回上一级</a><br />"); } builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx") + "\">返回订单管理</a><br />"); builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>")); builder.Append(Out.Tab("</div>", "<br />")); }
protected void Page_Load(object sender, EventArgs e) { int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[0-9]\d*$", "ID错误")); int v = int.Parse(Utils.GetRequest("v", "get", 1, @"^[0-9]\d*$", "0")); int pover = int.Parse(Utils.GetRequest("pover", "get", 1, @"^[0-1]$", "0")); if (!new BCW.BLL.Goods().Exists(id)) { Utils.Error("不存在的记录", ""); } int pageIndex; int recordCount; int pageSize = 300; string[] pageValUrl = { "id", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["vp"]); if (pageIndex == 0) { pageIndex = 1; } int pn = Utils.ParseInt(Request.QueryString["pn"]); if (pn == 0) { pn = 1; } BCW.Model.Goods model = new BCW.BLL.Goods().GetGoods(id); Master.Title = model.Title; //顶部调用 string TopUbb = TopUbb = ub.GetSub("FtShopDetailTop", xmlPath); if (TopUbb != "") { TopUbb = BCW.User.AdminCall.AdminUBB(Out.SysUBB(TopUbb)); if (TopUbb.IndexOf("</div>") == -1) { builder.Append(Out.Tab("<div>", "")); builder.Append(TopUbb); builder.Append(Out.Tab("</div>", "")); } else { builder.Append(TopUbb); } } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append(model.Title); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); if (pageIndex == 1 && pover == 0) { string sFile = model.Files.Trim(); if (!string.IsNullOrEmpty(sFile)) { string[] txtPic = sFile.Split("#".ToCharArray()); if (pn > txtPic.Length) { pn = txtPic.Length; } builder.Append("<img src=\"" + Out.SysUBB(txtPic[pn - 1]) + "\" alt=\"load\"/><br />"); if (pn < txtPic.Length) { builder.Append("<a href=\"" + Utils.getUrl("shopdetail.aspx?id=" + id + "&backurl=" + Utils.getPage(0) + "&pn=" + (pn + 1) + "") + "\">下张</a> "); } if (pn > 1) { builder.Append("<a href=\"" + Utils.getUrl("shopdetail.aspx?id=" + id + "&backurl=" + Utils.getPage(0) + "&pn=" + (pn - 1) + "") + "\">上张</a>"); } if (txtPic.Length > 1) { builder.Append("(" + pn + "/" + txtPic.Length + ")<br />"); } } } builder.Append(Out.Tab("</div>", "")); if (pover == 1) { string content = BasePage.MultiContent(model.Content, pageIndex, pageSize, pover, out recordCount); builder.Append(Out.Tab("<div>", "")); builder.Append(Out.SysUBB(content)); builder.Append(Out.Tab("</div>", "")); builder.Append(BasePage.MultiContentPage(model.Content, pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "vp", pover)); builder.Append(Out.Tab("<div>", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("shopdetail.aspx?id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">>>返回查看商品</a>"); builder.Append(Out.Tab("</div>", "")); } else { builder.Append(Out.Tab("<div>", Out.RHr())); builder.Append("市场价:¥" + Convert.ToDouble(model.CityMoney) + "元"); builder.Append("<br />会员价:"); if (model.PostType == 0) { builder.Append("¥" + Convert.ToDouble(model.VipMoney) + "元"); } else if (model.PostType == 1) { builder.Append(Convert.ToDouble(model.VipMoney) + "" + ub.Get("SiteBz")); } else { builder.Append(Convert.ToDouble(model.VipMoney) + "" + ub.Get("SiteBz2")); } builder.Append("<br />库存:" + (model.StockCount - model.SellCount) + "/已售" + model.SellCount + "件"); if (model.PayType == 0 || model.PayType == 2) { if (model.PayType == 0) { builder.Append("<br />送货:货到付款"); } else { builder.Append("<br />送货:先付款后发货"); } if (!string.IsNullOrEmpty(model.PostMoney) && model.PostMoney.Contains("|")) { string[] sTemp = model.PostMoney.Split("|".ToCharArray()); string postMoney = string.Empty; for (int j = 0; j < sTemp.Length; j++) { if (j % 2 == 0) { postMoney += "/" + sTemp[j + 1].ToString() + ":" + sTemp[j] + "元"; } } builder.Append("<br />邮费:" + Utils.Mid(postMoney, 1, postMoney.Length) + ""); } else { builder.Append("<br />邮费:卖家包邮"); } } else { builder.Append("<br />送货:当面交易"); } builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); if (!string.IsNullOrEmpty(model.Config)) { builder.Append("【产品属性】<br />"); builder.Append(Out.SysUBB(model.Config)); } builder.Append("联系方式:" + BCW.User.AdminCall.AdminUBB(Out.BasUBB(model.Mobile)) + ""); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">[立即订购]</a>"); builder.Append("<a href=\"" + Utils.getUrl("/bbs/favorites.aspx?act=addin&backurl=" + Utils.PostPage(1) + "") + "\">[加入收藏]</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("shopdetail.aspx?id=" + id + "&pover=1&backurl=" + Utils.getPage(0) + "") + "\">[商品详情]</a>"); builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?act=payment&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">[付款方式]</a>"); builder.Append("<br /><a href=\"" + Utils.getUrl("shopbuy.aspx?act=recom&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">推荐本商品有奖>></a>"); builder.Append(Out.Tab("</div>", "<br />")); //互动块记录 builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("<a href=\"" + Utils.getUrl("shopbuy.aspx?act=info&id=" + id + "&ptype=1&backurl=" + Utils.getPage(0) + "") + "\">>查看评价</a>.<a href=\"" + Utils.getUrl("shopbuy.aspx?act=info&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">成交(" + model.Paycount + ")</a>"); builder.Append(Out.Tab("</div>", "")); string strText = ",,,,"; string strName = "Content,id,ptype,act,backurl"; string strType = "text,hidden,hidden,hidden,hidden"; string strValu = "'" + id + "'14'ok'" + Utils.getPage(0) + ""; string strEmpt = "true,,,,"; string strIdea = "/"; string strOthe = "评论咨询,comment.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div>", "<br />")); int meid = new BCW.User.Users().GetUsId(); DataSet ds = new BCW.BLL.Comment().GetList(id, 3, 14); if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { builder.AppendFormat("{0}.{1}:{2}({3})", (i + 1), ds.Tables[0].Rows[i]["UserName"].ToString(), ds.Tables[0].Rows[i]["Content"].ToString(), DT.FormatDate(Convert.ToDateTime(ds.Tables[0].Rows[i]["AddTime"]), 1)); if (!string.IsNullOrEmpty(ds.Tables[0].Rows[i]["ReText"].ToString())) { builder.Append(Out.Tab("<font color=\"red\">", "")); builder.Append("<br />★管理员回复:" + ds.Tables[0].Rows[i]["ReText"].ToString() + ""); builder.Append(Out.Tab("</font>", "")); } builder.Append("<br />"); } } builder.Append("<a href=\"" + Utils.getUrl("comment.aspx?ptype=14&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">查看更多评论(" + model.Recount + "条)</a>"); builder.Append(Out.Tab("</div>", "<br />")); //底部调用 string FootUbb = FootUbb = ub.GetSub("FtShopDetailFoot", xmlPath); if (FootUbb != "") { FootUbb = BCW.User.AdminCall.AdminUBB(Out.SysUBB(FootUbb)); if (FootUbb.IndexOf("</div>") == -1) { builder.Append(Out.Tab("<div>", "")); builder.Append(FootUbb); builder.Append(Out.Tab("</div>", "")); } else { builder.Append(TopUbb); } } builder.Append(Out.Tab("<div>", Out.RHr())); builder.Append("<a href=\"" + Utils.getUrl("myshop.aspx?backurl=" + Utils.PostPage(1) + "") + "\">我的订单记录</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getPage("default.aspx") + "\">上级</a>"); if (model.NodeId != 0) { string nodeTitle = new BCW.BLL.Topics().GetTitle(model.NodeId); if (nodeTitle != "") { builder.Append("-<a href=\"" + Utils.getUrl("shop.aspx?id=" + model.NodeId + "") + "\">" + nodeTitle + "</a>"); } } builder.Append(Out.Tab("</div>", "")); } //更新人气点击 new BCW.BLL.Goods().UpdateReadcount(id, 1); }