//----------Tools private int MaxOrderID(int uid) { string where = "UserID=" + uid; return(DataConvert.CLng(DBCenter.ExecuteScala(TbName, "MAX(OrderID)", where)) + 1); }
public void ProcessRequest(HttpContext context) { M_UserInfo mu = buser.GetLogin(); retMod.retcode = M_APIResult.Failed; if (mu.IsNull) { retMod.retmsg = "用户未登录"; RepToClient(retMod); } int siteID = DataConvert.CLng(Req("SiteID")); //retMod.callback = CallBack;//暂不开放JsonP try { switch (Action) { case "mb_list": #region { string fields = "wxico,wxsize,wxbk,flag,wxlink,content,dbtype"; DataTable dt = GetListDT(); foreach (DataRow dr in dt.Rows) { M_CommonData conMod = conBll.SelReturnModel(Convert.ToInt32(dr["id"])); //if (!conMod.Inputer.Equals(mu.UserName)) { continue; } List <SqlParameter> sp1 = GetSPByDR(dr, "title"); List <SqlParameter> sp2 = GetSPByDR(dr, fields); DBCenter.UpdateSQL("ZL_CommonModel", GetSet(sp1), "GeneralID=" + conMod.GeneralID, sp1); DBCenter.UpdateSQL("ZL_C_Article", GetSet(sp2), "ID=" + conMod.ItemID, sp2); } retMod.retcode = M_APIResult.Success; } #endregion break; case "mb_nav": { DataTable dt = GetListDT(); foreach (DataRow dr in dt.Rows) { M_CommonData conMod = conBll.SelReturnModel(Convert.ToInt32(dr["id"])); //if (!conMod.Inputer.Equals(mu.UserName)) { continue; } List <SqlParameter> sp1 = new List <SqlParameter>() { new SqlParameter("title", dr["title"].ToString()) }; List <SqlParameter> sp2 = new List <SqlParameter>() { new SqlParameter("wxico", dr["wxico"].ToString()) }; DBCenter.UpdateSQL("ZL_CommonModel", "Title=@title", "GeneralID=" + conMod.GeneralID, sp1); DBCenter.UpdateSQL("ZL_C_Article", "wxico=@wxico", "ID=" + conMod.ItemID, sp2); } retMod.retcode = M_APIResult.Success; } break; case "mg_footbar": { DataTable dt = GetListDT(); foreach (DataRow dr in dt.Rows) { M_CommonData conMod = conBll.SelReturnModel(Convert.ToInt32(dr["id"])); //if (!conMod.Inputer.Equals(mu.UserName)) { continue; } List <SqlParameter> sp1 = new List <SqlParameter>() { new SqlParameter("title", dr["title"].ToString()) }; List <SqlParameter> sp2 = new List <SqlParameter>() { new SqlParameter("wxico", dr["wxico"].ToString()) }; DBCenter.UpdateSQL("ZL_CommonModel", "Title=@title", "GeneralID=" + conMod.GeneralID, sp1); DBCenter.UpdateSQL("ZL_C_Article", "wxico=@wxico", "ID=" + conMod.ItemID, sp2); } retMod.retcode = M_APIResult.Success; } break; case "mb_image": //更新单个内容的指定字段,是否需要扩展为,根据字段更新目标表,以减少代码 { string flag = Req("flag"); //传了该值,则代表单条数据更新 DataTable dt = GetListDT(); foreach (DataRow dr in dt.Rows) { List <SqlParameter> sp2 = new List <SqlParameter>() { new SqlParameter("wxico", dr["wxico"].ToString()), new SqlParameter("flag", dr["flag"].ToString()) }; DBCenter.UpdateSQL("ZL_C_Article", "wxico=@wxico", "Flag=@flag", sp2); } retMod.retcode = M_APIResult.Success; } break; case "mb_byid": //主用于内容更新 { string fields = "wxico,wxsize,wxbk,flag,wxlink,content,dbtype"; //dbtype DataTable dt = GetListDT(); foreach (DataRow dr in dt.Rows) { M_CommonData conMod = conBll.SelReturnModel(Convert.ToInt32(dr["id"])); List <SqlParameter> sp1 = GetSPByDR(dr, "title"); List <SqlParameter> sp2 = GetSPByDR(dr, fields); DBCenter.UpdateSQL("ZL_CommonModel", GetSet(sp1), "GeneralID=" + conMod.GeneralID, sp1); DBCenter.UpdateSQL("ZL_C_Article", GetSet(sp2), "ID=" + conMod.ItemID, sp2); } retMod.retcode = M_APIResult.Success; } break; case "mb_new": { B_CodeModel codeBll = new B_CodeModel("ZL_C_Article"); string nodeName = Req("type").Equals("nav") ? "微站图片" : "微站内容"; DataTable nodedt = DBCenter.Sel("ZL_Node", "NodeBySite=" + siteID + " AND NodeName='" + nodeName + "'"); if (nodedt.Rows.Count < 1) { retMod.retmsg = nodeName + "节点不存在"; } else { DataRow dr = GetListDT().Rows[0]; M_CommonData conMod = new M_CommonData(); DataRow artdr = codeBll.NewModel(); conMod.Title = dr["title"].ToString(); conMod.Inputer = mu.UserName; conMod.Status = (int)ZLEnum.ConStatus.Audited; conMod.TableName = "ZL_C_Article"; conMod.ModelID = 2; //文章ID conMod.NodeID = Convert.ToInt32(nodedt.Rows[0]["NodeID"]); //放入微内容处 //----------------------------- artdr["content"] = "ajax添加"; artdr["wxico"] = dr["wxico"]; artdr["wxsize"] = dr["wxsize"]; artdr["wxbk"] = dr["wxbk"]; artdr["flag"] = dr["flag"]; artdr["dbtype"] = dr["dbtype"]; conMod.ItemID = codeBll.Insert(artdr); conMod.GeneralID = conBll.insert(conMod); retMod.retcode = M_APIResult.Success; retMod.result = conMod.GeneralID.ToString(); } } break; case "mb_del": { int id = Convert.ToInt32(Req("id")); M_CommonData conMod = conBll.SelReturnModel(id); if (conMod == null) { retMod.retmsg = "内容[" + id + "]不存在"; } else if (!conMod.Inputer.Equals(mu.UserName)) { retMod.retmsg = "你无权删除[" + id + "]内容"; } else { conBll.SetDel(conMod.GeneralID); retMod.retcode = M_APIResult.Success; } } break; case "mb_pro_update": //新建,或更新 { DataRow dr = GetListDT().Rows[0]; M_Product proMod = new M_Product(); if (DataConvert.CLng(dr["id"]) > 0) { int id = Convert.ToInt32(dr["id"]); proMod = proBll.GetproductByid(id); if (proMod == null) { retMod.retmsg = "商品[" + id + "]不存在"; RepToClient(retMod); } else if (proMod.UserID != mu.UserID) { retMod.retmsg = "无权修改[" + id + "]商品"; RepToClient(retMod); } } proMod.Proname = dr["proname"].ToString(); proMod.ActPrice = dr["price"].ToString(); proMod.LinPrice = DataConvert.CDouble(dr["price"]); proMod.UserID = mu.UserID; proMod.AddUser = mu.UserName; proMod.Nodeid = B_Design_MBSite.UserShopNodeID; proMod.ParentID = siteID; proMod.Proinfo = dr["proinfo"].ToString(); proMod.Procontent = dr["content"].ToString(); proMod.Clearimg = dr["pics"].ToString(); proMod.Thumbnails = proMod.Clearimg; if (proMod.ID > 0) { proBll.updateinfo(proMod); } else { proMod.ID = proBll.Insert(proMod); } retMod.retmsg = proMod.ID.ToString(); retMod.retcode = M_APIResult.Success; } break; case "mb_pro_del": { int id = Convert.ToInt32(Req("id")); M_Product proMod = proBll.GetproductByid(id); if (proMod == null) { retMod.retmsg = "商品[" + id + "]不存在"; } else if (proMod.UserID != mu.UserID) { retMod.retmsg = "你无权删除[" + id + "]商品"; } else { proBll.RealDelByIDS(id.ToString()); retMod.retcode = M_APIResult.Success; } } break; default: retMod.retmsg = "[" + Action + "]接口不存在"; break; } } catch (Exception ex) { retMod.retmsg = ex.Message; retMod.retcode = M_APIResult.Failed; } RepToClient(retMod); }
/// <summary> /// 系统事件,如订阅等处理 /// </summary> public void WxEventHandler(M_WxTextMsg reqMod) { M_WX_User userMod = null; switch (reqMod.Event.ToLower()) { case "subscribe": userMod = api.GetWxUserModel(reqMod.FromUserName); userMod.CDate = DateTime.Now; userMod.AppId = api.AppId.ID; wxuserBll.Insert(userMod); M_WxImgMsg msgmod = JsonConvert.DeserializeObject <M_WxImgMsg>(api.AppId.WelStr); msgmod.ToUserName = reqMod.FromUserName; msgmod.FromUserName = reqMod.ToUserName; int pid = DataConvert.CLng(reqMod.EventKey.Replace("qrscene_", "")); Appinfo uappMod1 = new Appinfo(); B_UserAPP uappBll1 = new B_UserAPP(); M_UserInfo mu1 = new M_UserInfo(); M_WX_User wuserMod = new M_WX_User(); M_Uinfo mubase = new M_Uinfo(); uappMod1 = uappBll1.SelModelByOpenID(reqMod.FromUserName, "wechat"); wuserMod = api.GetWxUserModel(reqMod.FromUserName); if (uappMod1 != null) { mu1 = buser.GetUserByUserID(uappMod1.UserID); if (mu1 != null && mu1.UserID > 0) { mu1.TrueName = wuserMod.Name; mu1.GroupID = 1; buser.UpdateByID(mu1); } else { mu1.UserName = "******" + DateTime.Now.ToString("yyyyMMddHHmmss") + function.GetRandomString(2).ToLower(); mu1.UserPwd = StringHelper.MD5(function.GetRandomString(6)); mu1.Email = function.GetRandomString(10) + "@wx.com"; mu1.Question = function.GetRandomString(5); mu1.Answer = function.GetRandomString(5); mu1.TrueName = wuserMod.Name; mu1.GroupID = 1; mu1.UserID = buser.Add(mu1); uappMod1.UserID = mu1.UserID; uappMod1.SourcePlat = "wechat"; uappMod1.OpenID = reqMod.FromUserName; uappBll1.UpdateByID(uappMod1); mubase.UserId = mu1.UserID; buser.AddBase(mubase); } } else { uappMod1 = new Appinfo(); mu1.UserName = "******" + DateTime.Now.ToString("yyyyMMddHHmmss") + function.GetRandomString(2).ToLower(); mu1.UserPwd = StringHelper.MD5(function.GetRandomString(6)); mu1.Email = function.GetRandomString(10) + "@wx.com"; mu1.Question = function.GetRandomString(5); mu1.Answer = function.GetRandomString(5); mu1.TrueName = wuserMod.Name; mu1.GroupID = 1; mu1.UserID = buser.Add(mu1); uappMod1.UserID = mu1.UserID; uappMod1.SourcePlat = "wechat"; uappMod1.OpenID = reqMod.FromUserName; uappBll1.Insert(uappMod1); mubase.UserId = mu1.UserID; buser.AddBase(mubase); } if (string.IsNullOrEmpty(msgmod.Articles[0].PicUrl)) //如未设置图片则以纯文本格式发送,纯文本支持内置超链接 { M_WxTextMsg textMod = ImageToText(msgmod); RepToClient(textMod.ToXML()); } else { RepToClient(msgmod.ToXML()); } //关注时发送多条信息 if (pid > 0) { System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(SendMsg), reqMod); } //关注时发送多条信息 //System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(SendMsg), reqMod); break; case "unsubscribe": wxuserBll.DelByOpenid(api.AppId.ID, reqMod.FromUserName); break; case "location": //用户进入公众号(包含定位信息) M_WxImgMsg msgmod1 = new M_WxImgMsg(); msgmod1.ToUserName = reqMod.FromUserName; msgmod1.FromUserName = reqMod.ToUserName; M_WX_ReplyMsg rpMod = new M_WX_ReplyMsg(); rpMod = rpBll.SelByFileAndDef(appBll.GetAppByWxNo(reqMod.ToUserName).ID, "头图"); if (rpMod != null) { M_WXImgItem item = JsonConvert.DeserializeObject <M_WXImgItem>(rpMod.Content); msgmod1.Articles.Add(new M_WXImgItem() { Title = item.Title, Url = item.Url, Description = item.Description, PicUrl = item.PicUrl }); } // rpMod = rpBll.SelByFileAndDef(appBll.GetAppByWxNo(reqMod.ToUserName).ID, "推送1"); // { // M_WXImgItem item = JsonConvert.DeserializeObject<M_WXImgItem>(rpMod.Content); // msgmod1.Articles.Add(new M_WXImgItem() { Title = item.Title, Url = item.Url, Description = item.Description, PicUrl = item.PicUrl }); // } // rpMod = rpBll.SelByFileAndDef(appBll.GetAppByWxNo(reqMod.ToUserName).ID, "推送2"); // { // M_WXImgItem item = JsonConvert.DeserializeObject<M_WXImgItem>(rpMod.Content); // msgmod1.Articles.Add(new M_WXImgItem() { Title = item.Title, Url = item.Url, Description = item.Description, PicUrl = item.PicUrl }); // } // rpMod = rpBll.SelByFileAndDef(appBll.GetAppByWxNo(reqMod.ToUserName).ID, "推送3"); // { // M_WXImgItem item = JsonConvert.DeserializeObject<M_WXImgItem>(rpMod.Content); // msgmod1.Articles.Add(new M_WXImgItem() { Title = item.Title, Url = item.Url, Description = item.Description, PicUrl = item.PicUrl }); // } // rpMod = rpBll.SelByFileAndDef(appBll.GetAppByWxNo(reqMod.ToUserName).ID, "推送4"); // { // M_WXImgItem item = JsonConvert.DeserializeObject<M_WXImgItem>(rpMod.Content); // msgmod1.Articles.Add(new M_WXImgItem() { Title = item.Title, Url = item.Url, Description = item.Description, PicUrl = item.PicUrl }); // } RepToClient(msgmod1.ToXML()); break; case "scan": Appinfo uappMod = new Appinfo(); B_UserAPP uappBll = new B_UserAPP(); M_UserInfo mu = new M_UserInfo(); M_WxTextMsg textMod2 = new M_WxTextMsg(); textMod2.FromUserName = reqMod.ToUserName; textMod2.ToUserName = reqMod.FromUserName; textMod2.MsgType = "text"; textMod2.Content = ""; uappMod = uappBll.SelModelByOpenID(reqMod.FromUserName, "wechat"); if (uappMod != null) { mu = buser.GetUserByUserID(uappMod.UserID); M_UserInfo pmu = buser.GetUserByUserID(DataConvert.CLng(reqMod.EventKey)); if (mu != null && mu.UserID > 0) { if (DataConvert.CLng(mu.ParentUserID) > 0) { textMod2.Content = "您已绑定了推荐人不能重复绑定!"; RepToClient(textMod2.ToXML()); } else { if (mu.UserID == DataConvert.CLng(reqMod.EventKey)) { textMod2.Content = "您扫描的是您自己的二维码!"; } else { mu.ParentUserID = DataConvert.CLng(reqMod.EventKey).ToString(); if (pmu != null && pmu.UserID > 0) { string err = ""; if (CheckParentUser(pmu.UserID, mu.UserID, ref err)) { mu.ParentUserID = pmu.UserID.ToString(); if (buser.UpdateByID(mu)) { textMod2.Content = "您成功绑定了推荐人:" + pmu.TrueName + "!"; } else { textMod2.Content = "绑定推荐人失败!"; } } else { textMod2.Content = "绑定推荐失败,错误信息:" + err; } } else { textMod2.Content = "绑定推荐失败,推荐人不存在!"; } } RepToClient(textMod2.ToXML()); } } } break; default: break; } }
//提交订单 protected void AddOrder_Btn_Click(object sender, EventArgs e) { if (Address_Div.Visible && DataConvert.CLng(Request.Form["address_rad"]) < 1) { function.WriteErrMsg("尚未选定收货地址"); } //1,生成订单,2,关联购物车中商品为已绑定订单 M_UserInfo mu = buser.GetLogin(false); M_UserRecei receMod = receBll.GetSelect(Convert.ToInt32(Request.Form["address_rad"]), mu.UserID); DataTable cartDT = cartBll.SelByCookID(CartCookID, ProClass, ids);//需要购买的商品 if (cartDT.Rows.Count < 1) { function.WriteErrMsg("你尚未选择商品,<a href='/User/Order/OrderList.aspx'>查看我的订单</a>"); } //------生成订单前检测区 foreach (DataRow dr in cartDT.Rows) { if (!HasStock(dr["Allowed"], DataConvert.CLng(dr["stock"]), Convert.ToInt32(dr["Pronum"]))) { function.WriteErrMsg("购买失败," + dr["proname"] + "的库存数量不足"); } } //------检测End //按店铺生成订单,统一存ZL_Orderinfo DataTable storeDT = cartDT.DefaultView.ToTable(true, "StoreID"); M_Payment payMod = new M_Payment(); payMod.PayNo = payBll.CreatePayNo(); List <M_OrderList> orderList = new List <M_OrderList>();//用于生成临时订单,统计计算(Disuse) foreach (DataRow dr in storeDT.Rows) { #region 暂不使用字段 //Odata.province = this.DropDownList1.SelectedValue; //Odata.city = this.DropDownList2.SelectedValue;//将地址省份与市ID存入,XML数据源 //Odata.Guojia = "";//国家 //Odata.Chengshi = DropDownList2.SelectedItem.Text;//城市 //Odata.Diqu = DropDownList3.SelectedItem.Text;//地区 //Odata.Delivery = DataConverter.CLng(Request.Form["Delivery"]); //Odata.Deliverytime = DataConverter.CLng(this.Deliverytime.Text); //Odata.Mobile = receMod.MobileNum; #endregion M_OrderList Odata = new M_OrderList(); Odata.Ordertype = OrderHelper.GetOrderType(ProClass); Odata.OrderNo = B_OrderList.CreateOrderNo((M_OrderList.OrderEnum)Odata.Ordertype); Odata.StoreID = Convert.ToInt32(dr["StoreID"]); cartDT.DefaultView.RowFilter = "StoreID=" + Odata.StoreID; DataTable storeCartDT = cartDT.DefaultView.ToTable(); switch (ProClass)//旅游机票等,以联系人信息为地址 { case 7: case 8: M_Cart_Travel model = JsonConvert.DeserializeObject <M_Cart_Travel>(storeCartDT.Rows[0]["Additional"].ToString()); M_Cart_Contract user = model.Contract[0]; Odata.Receiver = user.Name; Odata.Reuser = user.Name; Odata.Phone = user.Mobile; Odata.MobileNum = user.Mobile; Odata.Email = user.Email; break; default: //普通订单 Odata.Receiver = receMod.ReceivName; Odata.Reuser = receMod.ReceivName; Odata.Phone = receMod.phone; Odata.MobileNum = receMod.MobileNum; Odata.Email = receMod.Email; Odata.Shengfen = receMod.Provinces; Odata.Jiedao = receMod.Street; Odata.ZipCode = receMod.Zipcode; break; } Odata.Invoiceneeds = DataConverter.CLng(Request.Form["invoice_rad"]);//是否需开发票 Odata.Invoice = Odata.Invoiceneeds == 0 ? "" : InvoTitle_T.Text + "||" + Invoice_T.Text; Odata.Rename = mu.UserName; Odata.Outstock = 0; //缺货处理 Odata.Ordermessage = ORemind_T.Text; //订货留言 Odata.Merchandiser = ""; //跟单员 Odata.Internalrecords = ""; //内部记录 Odata.IsCount = false; //-----金额计算 Odata.Balance_price = GetTotalMoney(storeCartDT); Odata.Freight = GetFarePrice(storeCartDT, Odata.StoreID); //运费计算 Odata.Ordersamount = Odata.Balance_price + Odata.Freight; //订单金额 Odata.AllMoney_Json = orderCom.GetTotalJson(storeCartDT); //附加需要的虚拟币 Odata.Specifiedprice = Odata.Ordersamount; //订单金额; Odata.Receivablesamount = 0; //收款金额 Odata.Developedvotes = 0; Odata.OrderStatus = (int)M_OrderList.StatusEnum.Normal; //订单状态 Odata.Paymentstatus = (int)M_OrderList.PayEnum.NoPay; //付款状态 Odata.StateLogistics = 0; //物流状态 Odata.Signed = 0; //签收 Odata.Settle = 0; //结清 Odata.Aside = 0; //作废 Odata.Suspended = 0; //暂停 Odata.AddTime = DateTime.Now; Odata.AddUser = mu.UserName;; Odata.Userid = mu.UserID; Odata.Integral = DataConverter.CLng(Request.QueryString["jifen"]); Odata.Freight_remark = " "; Odata.Balance_remark = ""; Odata.Promoter = 0; Odata.id = orderBll.Adds(Odata); cartProBll.CopyToCartPro(mu, storeCartDT, Odata.id); orderList.Add(Odata); orderCom.SendMessage(Odata, null, "ordered"); userappMod = userappBll.SelModelByUid(buser.GetLogin().UserID, "wechat"); if (userappMod != null) { //function.WriteErrMsg(Odata.AddTime.ToString("yyyy年MM月dd日 HH:mm:ss")); WxAPI wxapi = WxAPI.Code_Get(1); string json = "{ \"touser\":\"" + userappMod.OpenID + "\",\"template_id\":\"6kw4rUCX3IpE7k8_kn3ocmaaQBZF4blWq25ualnz1qw\",\"url\":\"http://www.wodian8.com/User/Order/OrderList1.aspx\",\"data\":{\"first\": {\"value\":\"订单提交成功!\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + Odata.AddTime.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"keyword2\": {\"value\":\"" + Odata.Ordersamount.ToString("0.00") + "元\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + GetProname(Odata.id) + "\",\"color\":\"#173177\"},\"keyword4\": {\"value\":\"" + Odata.Shengfen + Odata.Jiedao + "\",\"color\":\"#173177\"},\"remark\":{\"value\":\"您好,订单提交成功,请尽快付款!\",\"color\":\"#173177\"}}}"; wxapi.SendTlpMsg(json); //wxapi.SendMsg(userappMod.OpenID, "你已下订单,订单号为:" + Odata.OrderNo); } } cartBll.DelByids(ids); //-----------------订单生成后处理 //进行减库存等操作 foreach (DataRow dr in cartDT.Rows) { M_Product model = proBll.GetproductByid(Convert.ToInt32(dr["Proid"])); model.Stock = model.Stock - DataConvert.CLng(dr["Pronum"]); SqlHelper.ExecuteSql("Update ZL_Commodities Set Stock=" + model.Stock + " Where ID=" + model.ID); } //生成支付单,处理优惠券,并进入付款步骤 foreach (M_OrderList model in orderList) { payMod.PaymentNum += model.OrderNo + ","; payMod.MoneyPay += model.Ordersamount; } //优惠券 if (!string.IsNullOrEmpty(Arrive_T.Text)) { double arriveAmount = arriveBll.UserArrive(Arrive_T.Text, Arrive_Pwd.Text); payMod.MoneyPay = payMod.MoneyPay - arriveAmount; payMod.ArriveMoney = arriveAmount; payMod.ArriveDetail = Arrive_T.Text + "|" + Arrive_Pwd.Text; } //积分处理 if (point_body.Visible && DataConvert.CLng(Point_T.Text) > 0) { int point = DataConvert.CLng(Point_T.Text); int maxPoint = (int)((SiteConfig.ShopConfig.PointRatiot * 0.01) * (double)payMod.MoneyPay / SiteConfig.ShopConfig.PointRate); //if (point <= 0) { function.WriteErrMsg("积分数值不正确"); } if (point > mu.UserExp) { function.WriteErrMsg("您的积分不足!"); } if (point > maxPoint) { function.WriteErrMsg("积分不能大于可兑换金额!"); } //生成支付单时扣除用户积分 buser.ChangeVirtualMoney(mu.UserID, new M_UserExpHis() { ScoreType = (int)M_UserExpHis.SType.Point, score = -point, detail = "积分抵扣,支付单号:" + payMod.PayNo }); payMod.MoneyPay = payMod.MoneyPay - (point * SiteConfig.ShopConfig.PointRate); payMod.UsePoint = point; } if (payMod.MoneyPay <= 0) { payMod.MoneyPay = 0.01; } payMod.PaymentNum = payMod.PaymentNum.TrimEnd(','); payMod.Remark = cartDT.Rows.Count > 1 ? "[" + cartDT.Rows[0]["ProName"] as string + "]等" : cartDT.Rows[0]["ProName"] as string; payMod.UserID = mu.UserID; payMod.Status = 1; payMod.PaymentID = payBll.Add(payMod); string redirect_uri = HttpUtility.UrlEncode("http://www.wodian8.com/Payonline/wxpayonline.aspx?PayNo=" + payMod.PayNo); string url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8c5c2dc7b10a36f3&redirect_uri=" + redirect_uri + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"; //Response.Redirect(url); Response.Redirect("/PayOnline/Orderpay.aspx?PayNo=" + payMod.PayNo); }
public string GetShopUrl() { return(orderCom.GetShopUrl(DataConvert.CLng(Eval("StoreID")), Convert.ToInt32(Eval("ProID")))); }
//会员特选商品逻辑 private void IsUserProduct(M_Product proMod, string olduids, string newuids) { #region 特选商品 //有更改则执行特选商品 string uids = StrHelper.IDS_GetChange(olduids, newuids);//uprouids_old_hid.Value, uprouids_hid.Value if (!string.IsNullOrEmpty(uids)) { //1,目标表中可能无数据 //2,只对变更部分操作 //目的:会员可知道自己有哪些商品,商品处也可知道可有哪些特选 string[] add = uids.Split('|')[0].Split(','); string[] remove = uids.Split('|')[1].Split(','); foreach (string id in add) { int uid = DataConvert.CLng(id); if (uid < 1) { continue; } M_User_BindPro bindMod = bindBll.SelModelByUid(uid); if (bindMod == null) { bindMod = new M_User_BindPro() { UserID = uid }; } bindMod.ProIDS = StrHelper.AddToIDS(bindMod.ProIDS, proMod.ID.ToString()); if (bindMod.ID > 0) { bindBll.UpdateByID(bindMod); } else { bindBll.Insert(bindMod); } } foreach (string id in remove) { int uid = DataConvert.CLng(id); if (uid < 1) { continue; } M_User_BindPro bindMod = bindBll.SelModelByUid(uid); if (bindMod == null) { bindMod = new M_User_BindPro() { UserID = uid }; } bindMod.ProIDS = StrHelper.RemoveToIDS(bindMod.ProIDS, proMod.ID.ToString()); if (bindMod.ID > 0) { bindBll.UpdateByID(bindMod); } else { bindBll.Insert(bindMod); } } } #endregion }
public ActionResult AddProduct() { VM_Product vm = new VM_Product(); if (!B_ARoleAuth.AuthCheckEx(ZLEnum.Auth.shop, "product")) { return(null); } if (Mid < 1) { if (ModelID < 1) { function.WriteErrMsg("没有指定要添加内容的模型ID!"); return(null); } if (NodeID < 1) { function.WriteErrMsg("没有指定要添加内容的栏目节点ID!"); return(null); } vm.proMod = new M_Product() { Stock = 10, Rateset = 1, Dengji = 3 }; vm.NodeID = NodeID; vm.ModelID = ModelID; vm.proMod.ProCode = B_Product.GetProCode(); vm.ProGuid = Guid.NewGuid().ToString(); } else { int VerID = DataConvert.CLng(Request.QueryString["Ver"]); if (VerID > 0) { M_Content_VerBak verMod = verBll.SelReturnModel(VerID); vm.proMod = JsonConvert.DeserializeObject <M_Product>(verMod.ContentBak); if (vm.proMod.ID != Mid) { function.WriteErrMsg("加载的版本与商品不匹配"); return(null); } vm.ValueDT = JsonConvert.DeserializeObject <DataTable>(verMod.TableBak); } else { vm.proMod = proBll.GetproductByid(Mid); vm.ValueDT = proBll.GetContent(vm.proMod.TableName, vm.proMod.ItemID); } vm.ProGuid = vm.proMod.ID.ToString(); if (vm.proMod.Class == 2) { Response.Redirect(CustomerPageAction.customPath + "Shop/Arrive/SuitProAdd.aspx?ID=" + vm.proMod.ID); } vm.NodeID = vm.proMod.Nodeid; vm.ModelID = vm.proMod.ModelID; if (!string.IsNullOrEmpty(vm.proMod.BindIDS))//捆绑商品 { DataTable dt = proBll.SelByIDS(vm.proMod.BindIDS, "id,Thumbnails,Proname,LinPrice"); vm.bindList = JsonConvert.SerializeObject(dt); } //多区域价格 vm.regionMod = regionBll.SelModelByGuid(vm.ProGuid); if (vm.regionMod == null) { vm.regionMod = new M_Shop_RegionPrice(); } #region 特选商品 { string where = string.Format("(ProIDS LIKE '%,{0},%' OR ProIDS LIKE '{0},%' OR ProIDS LIKE '%,{0}')", vm.proMod.ID.ToString()); DataTable dt = DBCenter.SelWithField("ZL_User_BindPro", "UserID", where); string uids = StrHelper.GetIDSFromDT(dt, "UserID"); ViewBag.prouids = uids; } #endregion } //------------------------------------------------------------------------------------------------ vm.nodeMod = nodeBll.SelReturnModel(vm.NodeID); if (vm.nodeMod.IsNull) { function.WriteErrMsg("节点[" + vm.NodeID + "]不存在"); return(null); } return(View(vm)); }
/// <summary> /// 添加节点数据进表,再依表生成xml /// 注意:必须将NodeID设为可插入值的状态,并且修改PK /// </summary> public void CopyNodes(DataTable dt) { B_Node bll = new B_Node();//需先关闭主键,与M_Node中主键标识 foreach (DataRow dr in dt.Rows) { //DataTable NodeName, NodeDir; //NodeName = bll.GetNodeForNodeName(TxtNodeName.Text, DataConverter.CLng(HdnDepth.Value), DataConverter.CLng(Request.QueryString["ParentID"])); //NodeDir = bll.GetNodeForDirname(TxtNodeDir.Text, DataConverter.CLng(HdnDepth.Value), DataConverter.CLng(Request.QueryString["ParentID"])); //HttpResponse.RemoveOutputCacheItem(customPath2 + "Content/NodeTree.aspx"); //if (NodeName.Rows.Count > 0 || NodeDir.Rows.Count > 0) { function.Script(this, "alert('发现同栏目下栏目名或标识名重复,请点击确定重新添加节点');"); return; } /*-------------------------------------------------------------------------------------------------*/ M_Node node = new M_Node(); node.NodeID = Convert.ToInt32(dr["NodeID"]); node.NodeName = dr["NodeName"].ToString(); node.NodeType = 1; node.NodePic = ""; node.NodeDir = PinYin.GetFirstPinYin(node.NodeName); node.ParentID = DataConvert.CLng(dr["ParentID"]); node.Depth = node.ParentID == 0 ? 2 : 1;//后期更新下深度 node.NodeUrl = ""; node.OrderID = 1; node.Tips = ""; node.Description = ""; node.Meta_Keywords = ""; node.Meta_Description = ""; node.OpenNew = false; node.ItemOpenType = false; node.PurviewType = false; node.CommentType = "1"; node.HitsOfHot = 0; node.Viewinglimit = ""; node.ConsumePoint = 0; node.ConsumeType = 0; node.ConsumeTime = 0; node.ConsumeCount = 0; node.Shares = 0; node.OpenTypeTrue = "0"; node.ItemOpenTypeTrue = "0"; node.Custom = ""; node.NodeListUrl = ""; node.SiteConfige = ""; ///////////////////////////////////////////////////// node.NodeListType = 1; node.ListPageHtmlEx = 3; node.ContentFileEx = 3; node.ListPageEx = 3; node.LastinfoPageEx = 3; node.HotinfoPageEx = 3; node.ProposePageEx = 3; node.SafeGuard = 0; node.ContentPageHtmlRule = 2; node.HtmlPosition = 1; node.Contribute = 0; node.SiteContentAudit = 99; node.Purview = "<View>allUser</View><ViewGroup>-1,1,2</ViewGroup><ViewSunGroup>-1,1,2</ViewSunGroup><input>-1,1,2</input><forum>1,2</forum>"; node.PK = ""; DBCenter.Insert(node); } }
public int Order_API() { int oid = Convert.ToInt32(RequestEx["oid"]); string action = RequestEx["action"]; int result = Failed; //----- M_OrderList orderMod = orderBll.SelReturnModel(oid); if (mu.UserID != orderMod.Userid) { return(result); } switch (action) { case "del": { orderBll.DelByIDS_U(oid.ToString(), mu.UserID); orderBll.CancelOrder(orderMod); result = Success; } break; case "receive": { if (orderMod.Paymentstatus < (int)M_OrderList.PayEnum.HasPayed) { break; } orderBll.UpdateByField("StateLogistics", "2", oid); if (DataConvert.CLng(orderMod.ExpressNum) > 0) { B_Order_Exp expBll = new B_Order_Exp(); M_Order_Exp expMod = expBll.SelReturnModel(DataConvert.CLng(orderMod.ExpressNum)); if (expMod != null) { expMod.SignDate = DateTime.Now.ToString(); expBll.UpdateByID(expMod); } } result = Success; } break; case "reconver": //还原 { orderBll.UpdateByField("Aside", "0", oid); result = Success; } break; case "realdel": //彻底删除 { orderBll.UpdateByField("Aside", "2", oid); result = Success; } break; default: break; } return(result); }
public void UserBase_Edit() { DataTable dt = ubfbll.Select_All(); Call commonCall = new Call(); DataTable table; try { table = commonCall.GetDTFromMVC(dt, Request); } catch (Exception e) { function.WriteErrMsg(e.Message); return; } mu.UserFace = HttpUtility.HtmlEncode(Request.Form["UserFace_T"]); mu.HoneyName = HttpUtility.HtmlEncode(Request.Form["txtHonName"]); mu.CompanyName = HttpUtility.HtmlEncode(Request.Form["CompanyName"]); mu.TrueName = HttpUtility.HtmlEncode(Request.Form["tbTrueName"]); M_Uinfo binfo = buser.GetUserBaseByuserid(mu.UserID); binfo.Address = Request.Form["tbAddress"]; binfo.BirthDay = Request.Form["tbBirthday"]; binfo.FaceHeight = DataConverter.CLng(Request["tbFaceHeight"]); binfo.FaceWidth = DataConverter.CLng(Request["tbFaceWidth"]); binfo.UserFace = mu.UserFace; binfo.Fax = Request.Form["tbFax"]; binfo.HomePage = Request.Form["tbHomepage"]; //binfo.ICQ = Server.HtmlEncode(tbICQ.Text.Trim()); binfo.HomePhone = Request.Form["tbHomePhone"]; binfo.IDCard = Request.Form["tbIDCard"]; //binfo.Mobile = Server.HtmlEncode(tbMobile.Text.Trim()); binfo.OfficePhone = Request.Form["tbOfficePhone"]; binfo.Privating = DataConvert.CLng(Request.Form["tbPrivacy"]); //binfo.PHS = Server.HtmlEncode(tbPHS.Text.Trim()); binfo.QQ = Request.Form["tbQQ"]; binfo.Sign = Request.Form["tbSign"]; binfo.UC = Request.Form["tbUC"]; binfo.UserSex = DataConverter.CBool(Request.Form["tbUserSex"]); //binfo.Yahoo = Server.HtmlEncode(tbYahoo.Text.Trim()); binfo.ZipCode = HttpUtility.HtmlEncode(Request.Form["tbZipCode"]); binfo.HoneyName = mu.HoneyName; binfo.TrueName = mu.TrueName; string[] adrestr = Request.Form["address"].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); binfo.Province = adrestr[0]; binfo.City = adrestr[1]; binfo.County = adrestr[2]; binfo.Position = HttpUtility.HtmlEncode(Request.Form["Position"]); buser.UpDateUser(mu); if (binfo.IsNull) { binfo.UserId = mu.UserID; buser.AddBase(binfo); } else { buser.UpdateBase(binfo);//更新用户信息 } if (table.Rows.Count > 0) { buser.UpdateUserFile(binfo.UserId, table); } function.WriteSuccessMsg("修改成功", "UserBase"); return; }
/// <summary> /// 根据公司ID,获取该公司的网络管理员角色ID /// </summary> public static int SelSuperByCid(int cid) { return(DataConvert.CLng(DBCenter.ExecuteScala("ZL_Plat_UserRole", "ID", "CompID=" + cid + " And IsSuper=1"))); }
public IActionResult Order_API() { if (!B_ARoleAuth.AuthCheckEx(ZLEnum.Auth.shop, "order")) { return(Content(Failed.ToString())); } string action = GetParam("a"); string ids = GetParam("ids"); int Mid = DataConvert.CLng(GetParam("ids")); switch (action) { case "info_normal": { M_Order_OPLog logMod = logBll.NewLog(Mid, "恢复正常"); string str = "Aside=0,Suspended=0,Settle=0,BackID=0,OrderStatus=" + (int)M_OrderList.StatusEnum.Normal; orderBll.UpOrderinfo(str, Mid); logBll.Insert(logMod); } break; case "info_complete": //完结订单 { M_Order_OPLog logMod = logBll.NewLog(Mid, "完结订单"); //前使用必须修改,只更改状态,不执行FinalStep M_OrderList orderMod = oll.SelReturnModel(Mid); if (string.IsNullOrEmpty(orderMod.PaymentNo)) //未支付则生成支付单 { OrderHelper.FinalStep(orderMod); } else { M_Payment payMod = payBll.SelModelByOrder(orderMod); OrderHelper.FinalStep(payMod, orderMod, new M_Order_PayLog()); } logBll.Insert(logMod); } break; case "info_invoce": //已开发票 { M_Order_OPLog logMod = logBll.NewLog(Mid, "已开发票"); oll.UpOrderinfo("Developedvotes=1", Mid); logBll.Insert(logMod); } break; case "info_suspend": //冻结,挂起订单 { M_Order_OPLog logMod = logBll.NewLog(Mid, "冻结处理"); oll.UpOrderinfo("Suspended=1", Mid); logBll.Insert(logMod); } break; case "info_suspend_no": { M_Order_OPLog logMod = logBll.NewLog(Mid, "取消冻结"); oll.UpOrderinfo("Suspended=0", Mid); logBll.Insert(logMod); } break; case "info_aside": { M_Order_OPLog logMod = logBll.NewLog(Mid, "订单作废"); oll.UpOrderinfo("Aside=1", Mid); logBll.Insert(logMod); } break; case "info_refund": //退单还款 { M_Order_OPLog logMod = logBll.NewLog(Mid, "退单还款"); M_OrderList orderinfo = oll.GetOrderListByid(Mid); if (orderinfo.Paymentstatus == (int)M_OrderList.PayEnum.NoPay) { return(WriteErr("操作失败,订单还未支付")); } if (orderinfo.Paymentstatus == (int)M_OrderList.PayEnum.Refunded) { return(WriteErr("操作失败,该订单已退款")); } buser.ChangeVirtualMoney(orderinfo.Userid, new M_UserExpHis() { score = orderinfo.Receivablesamount, ScoreType = 1, detail = "订单[" + orderinfo.id + "]退单返款,返款金额:" + orderinfo.Receivablesamount }); oll.UpOrderinfo("Paymentstatus=" + (int)M_OrderList.PayEnum.Refunded, Mid); logBll.Insert(logMod); } break; case "info_payed": { M_Order_OPLog logMod = logBll.NewLog(Mid, "已经支付"); oll.UpOrderinfo("Paymentstatus=" + (int)M_OrderList.PayEnum.HasPayed, Mid); logBll.Insert(logMod); } break; case "info_pay_cancel": { M_Order_OPLog logMod = logBll.NewLog(Mid, "取消支付"); oll.UpOrderinfo("Paymentstatus=" + (int)M_OrderList.PayEnum.NoPay + ",PaymentNo=''", Mid); logBll.Insert(logMod); } break; case "info_remind": //更新备注信息 { M_OrderList orderinfo = oll.SelReturnModel(Mid); orderinfo.Internalrecords = GetParam("Internalrecords"); orderinfo.Ordermessage = GetParam("Ordermessage"); oll.UpdateByID(orderinfo); } break; case "exp_cancel": //取消发送 { M_Order_OPLog logMod = logBll.NewLog(Mid, "取消发送"); oll.UpOrderinfo("StateLogistics=" + (int)M_OrderList.ExpEnum.NoSend + ",ExpressNum=''", Mid); logBll.Insert(logMod); } break; case "exp_sign": { M_Order_OPLog logMod = logBll.NewLog(Mid, "客户已签收"); oll.UpOrderinfo("Signed=1,StateLogistics=" + (int)M_OrderList.ExpEnum.HasReceived, Mid); logBll.Insert(logMod); } break; //------------------------ case "sure": //确认订单 { orderBll.ChangeSure(ids, 1); //M_Order_OPLog logMod = logBll.NewLog(Mid, "确认订单"); //oll.UpOrderinfo("IsSure=1", Mid); logBll.Insert(logMod); } break; case "sure_no": { orderBll.ChangeSure(ids, 0); //M_Order_OPLog logMod = logBll.NewLog(Mid, "取消确认"); //oll.UpOrderinfo("IsSure=0", Mid); logBll.Insert(logMod); //return WriteOK("取消确认成功", "Orderlistinfo?id=" + Mid); } break; case "recycle": //回收站 { orderBll.ChangeStatus(ids, "recycle"); } break; case "recover": { orderBll.ChangeStatus(ids, "recover"); } break; case "del": { orderBll.DelByIDS(ids); } break; case "clear": { orderBll.ClearRecycle(); } break; } return(Content(Success.ToString())); }
protected void RPT_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dr = e.Item.DataItem as DataRowView; Label ptLabel = e.Item.FindControl("Present_HTML") as Label; try { string addition = DataConvert.CStr(dr["Additional"]); //M_Cart_Addition addMod = JsonConvert.DeserializeObject<M_Cart_Addition>(addition); JObject jobj = JsonConvert.DeserializeObject <JObject>(addition); string itemTlp = "<div style='color:#999;'>{0}:{1}</div>"; foreach (var item in jobj) { if (string.IsNullOrEmpty(item.Value.ToString())) { continue; } if (DataConvert.CLng(item.Value) < 1) { continue; } if (item.Key == "flash" || item.Key == "outdoor" || item.Key == "backing") { string value = DataConvert.CStr(DBCenter.ExecuteScala("ZL_Commodities", "Proname", "ID=" + DataConvert.CLng(item.Value))); ptLabel.Text += string.Format(itemTlp, item.Key, item.Value); } else { ptLabel.Text += string.Format(itemTlp, item.Key, item.Value); } } } catch (Exception) { } } }
public void Post_Add() { //Mid,CateID M_UserInfo mu = tuBll.GetLogin(); //buser.GetLogin(); if (mu.Status != 0) { function.WriteErrMsg("您的账户已被锁定,无法进行发帖、回复等操作!"); return; } int pid = DataConvert.CLng(Request.QueryString["pid"]); string title = Request.Form["MsgTitle_T"]; string msg = Request.Form["MsgContent_T"]; string base64Msg = StrHelper.CompressString(msg); string rurl = Request["rurl"];//操作完成后返回哪个链接 bool auth_barowner = false; if (pid > 0)//回复主贴 { M_Guest_Bar pmod = barBll.SelReturnModel(pid); CateID = pmod.CateID; } if (Mid > 0)//编辑贴子 { barMod = barBll.SelReturnModel(Mid); CateID = barMod.CateID; } M_GuestBookCate cateMod = cateBll.SelReturnModel(CateID); if (cateMod == null) { function.WriteErrMsg("栏目不存在"); return; } rurl = string.IsNullOrEmpty(rurl) ? "/PClass?id=" + cateMod.CateID : rurl; auth_barowner = cateMod.IsBarOwner(mu.UserID); if (Mid > 0)//编辑 { if (barMod.CUser != mu.UserID && !auth_barowner) { function.WriteErrMsg("你无权修改该内容"); return; } barMod.Title = title; barMod.SubTitle = GetSubTitle(ref msg); barMod.MsgContent = base64Msg; barBll.UpdateByID(barMod); } else { if (pid < 1 && string.IsNullOrEmpty(title)) { function.WriteErrMsg("贴子标题不能为空!"); return; } if (!ZoomlaSecurityCenter.VCodeCheck(Request["VCode_hid"], Request["VCode"])) { function.WriteErrMsg("验证码不正确"); return; } if (!auth_barowner)//非管理员需要检测权限和接受限制 { //是否可在该版块发贴子 if (!authBll.AuthCheck(cateMod, mu, "send")) { function.WriteErrMsg("你无权在[" + cateMod.CateName + "]版块发布贴子"); return; } //是否有时间限制 M_Guest_Bar lastMod = barBll.SelLastModByUid(mu); BarOption baroption = GuestConfig.GuestOption.BarOption.Find(v => v.CateID == CateID); int usertime = baroption == null ? 120 : baroption.UserTime; int sendtime = baroption == null ? 5 : baroption.SendTime; if (mu.UserID > 0 && (DateTime.Now - mu.RegTime).TotalMinutes < usertime)//匿名用户不受此限 { int minute = usertime - (int)(DateTime.Now - mu.RegTime).TotalMinutes; function.WriteErrMsg("新注册用户" + usertime + "分钟内不能发贴,你还需要" + minute + "分钟", "javascript:history.go(-1);"); return; } else if (lastMod != null && (DateTime.Now - lastMod.CDate).TotalMinutes < sendtime) { int minute = sendtime - (int)(DateTime.Now - lastMod.CDate).TotalMinutes; function.WriteErrMsg("你发贴太快了," + minute + "分钟后才能再次发贴", "javascript:history.go(-1);"); return; } } barMod = FillMsg(title, msg, pid, 0, cateMod); barBll.Insert(barMod); if (cateMod.Status == 1 && mu.UserID > 0 && cateMod.SendScore > 0)//是否需审核 { buser.AddMoney(mu.UserID, cateMod.SendScore, M_UserExpHis.SType.Point, string.Format("{0} {1}在版面:{2}发表主题:{3},赠送{4}分", DateTime.Now, mu.UserName, cateMod.CateName, barMod.Title, cateMod.SendScore)); } } Response.Redirect(rurl); return; }
protected void Page_Load(object sender, EventArgs e) { if (function.isAjax()) { string Action = Request.Form["Action"]; string result = ""; if (Action == "Print") { string content = Request.Form["Content"]; string img = Request.Form["Image"]; Session["PrintCon"] = content; Session["PrintImg"] = img; result = "1"; } else { string value = Request.Form["value"]; mmis = bmis.SelReturnModel(Convert.ToInt32(value)); result = oaCom.GetHolder(mmis, buser.GetLogin().GroupID.ToString()); } Response.Clear(); Response.Write(result); Response.Flush(); Response.End(); } if (!IsPostBack) { // if (!purBll.Auth("OADocumentWrite", buser.GetLogin().UserRole)) { function.WriteErrMsg("你当前没有起草公文的权限,请联系管理员!!!"); } TypeDataBind(); DPDataBind(); #region 签章初始化 DataTable signDT = signBll.SelByUserID(buser.GetLogin().UserID); if (signDT != null && signDT.Rows.Count > 0) { SignRadioBind(signDT); } else { signTrRemind.Visible = true; } #endregion if (Request.QueryString["Edit"] == "1" && !string.IsNullOrEmpty(Request.QueryString["AppID"])) { saveBtn.Text = "修改"; AddNewBtn.Visible = true; int id = DataConvert.CLng(Request.QueryString["AppID"]); M_MisProLevel freeMod = freeBll.SelByDocID(id); moa = boa.SelReturnModel(id); minfo = buser.SeachByID(moa.UserID); Title_T.Text = moa.Title; key = moa.Keywords; Keywords.Text = moa.Keywords; Secret.SelectedValue = moa.Secret.ToString(); Urgency.SelectedValue = moa.Urgency.ToString(); Importance.SelectedValue = moa.Importance.ToString(); DocType_DP.SelectedValue = moa.Type.ToString(); proDP.SelectedValue = moa.ProID.ToString(); Content.Text = moa.Content; CreateTime.Text = moa.CreateTime.ToString("yyyy/MM/dd HH:mm:ss"); Label1.Text = minfo.HoneyName; Label2.Text = groupBll.GetByID(minfo.GroupID).GroupName; if (freeMod != null) { RUserID_Hid.Value = freeMod.ReferUser; RUserName_Lab.Text = buser.GetUserNameByIDS(freeMod.ReferUser); CUserID_Hid.Value = freeMod.CCUser; CUserName_Lab.Text = buser.GetUserNameByIDS(freeMod.CCUser); } //附件相关,移除,不做检测 //proMod = proBll.SelReturnModel(moa.ProID); //if (proMod.AllowAttach == 1) //{ upFileTR.Visible = true; //} if (!string.IsNullOrEmpty(moa.PublicAttach)) { hasFileData.Value = moa.PublicAttach; string[] af = moa.PublicAttach.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); string h = ""; for (int i = 0; i < af.Length; i++) { h += "<span class='disupFile'>"; h += GroupPic.GetShowExtension(GroupPic.GetExtName(af[i])); h += "<a target='_blank' href=" + af[i] + ">" + af[i].Split('/')[(af[i].Split('/').Length - 1)] + "</a><a href='javascript:;' title='删除' onclick='delHasFile(\"" + af[i] + "\",this);' ><img src='/App_Themes/AdminDefaultTheme/images/del.png'/></a></span>"; } hasFileTD.InnerHtml = h; } //签章,用于修改 if (!string.IsNullOrEmpty(moa.SignID) && signRadio.Items.Count > 0) { signRadio.SelectedValue = moa.SignID.Split(':')[0]; Page.ClientScript.RegisterStartupScript(this.GetType(), "signInit", "InitPos('" + moa.SignID + "');", true); } DraftBtn.Visible = false; //-----检测是否已开始流程 if (boa.IsApproving(id))//已开始,不允许修改 { saveBtn.Visible = false; DraftBtn.Visible = false; clearBtn.Attributes.Add("disabled", "disabled"); clearBtn.Text = "流程已开始,禁止修改"; } } else { AddNewBtn.Visible = false; Label1.Text = buser.GetLogin().HoneyName; Label2.Text = groupBll.GetByID(buser.GetLogin().GroupID).GroupName; CreateTime.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); } } }
public IActionResult Post_Add() { //Mid,CateID M_UserInfo mu = tuBll.GetLogin(); //buser.GetLogin(); if (mu.Status != 0) { return(WriteErr("您的账户已被锁定,无法进行发帖、回复等操作!")); } int pid = DataConvert.CLng(RequestEx["pid"]); string title = Request.Form["MsgTitle_T"]; string msg = Request.Form["MsgContent_T"]; //如果内容来源于手机编辑器,则合并图片与转化表情 if (DataConvert.CStr(Request.Form["editor"]).Equals("mbeditor")) { msg = msg.Replace("\r\n", "<br />"); string imgs = Request.Form["txt_bar"], emotions = Request.Form["ImgFace_Hid"]; if (!string.IsNullOrEmpty(emotions)) { string imgTlp = "<img src='/Plugins/Ueditor/dialogs/emotion/{0}' class='imgface_img' />"; DataTable dt = JsonHelper.JsonToDT(emotions); foreach (DataRow dr in dt.Rows) { msg = msg.Replace(dr["title"].ToString(), string.Format(imgTlp, dr["realurl"].ToString())); } } if (!string.IsNullOrEmpty(imgs) && !imgs.Equals("[]")) { string imgHtml = ""; string imgTlp = "<img src='{0}'>"; //[{"url":"/UploadFiles/User/user/admin1/20180627EvVVMk.jpg","desc":""}] DataTable dt = JsonHelper.JsonToDT(imgs); foreach (DataRow dr in dt.Rows) { imgHtml += string.Format(imgTlp, DataConvert.CStr(dr["url"])); } msg += "<div>" + imgHtml + "</div>"; } } string base64Msg = StrHelper.CompressString(msg); string rurl = RequestEx["rurl"];//操作完成后返回哪个链接 bool auth_barowner = false; if (pid > 0)//回复主贴 { M_Guest_Bar pmod = barBll.SelReturnModel(pid); CateID = pmod.CateID; } if (Mid > 0)//编辑贴子 { barMod = barBll.SelReturnModel(Mid); CateID = barMod.CateID; } M_GuestBookCate cateMod = cateBll.SelReturnModel(CateID); if (cateMod == null) { return(WriteErr("栏目不存在")); } rurl = string.IsNullOrEmpty(rurl) ? "/PClass?id=" + cateMod.CateID : rurl; auth_barowner = cateMod.IsBarOwner(mu.UserID); if (Mid > 0)//编辑 { if (barMod.CUser != mu.UserID && !auth_barowner) { return(WriteErr("你无权修改该内容")); } barMod.Title = title; barMod.SubTitle = GetSubTitle(ref msg); barMod.MsgContent = base64Msg; barBll.UpdateByID(barMod); } else { if (pid < 1 && string.IsNullOrEmpty(title)) { return(WriteErr("贴子标题不能为空!")); } if (!ZoomlaSecurityCenter.VCodeCheck(RequestEx["VCode_hid"], RequestEx["VCode"])) { return(WriteErr("验证码不正确")); } if (!auth_barowner)//非管理员需要检测权限和接受限制 { //是否可在该版块发贴子 if (!authBll.AuthCheck(cateMod, mu, "send")) { return(WriteErr("你无权在[" + cateMod.CateName + "]版块发布贴子")); } //是否有时间限制 M_Guest_Bar lastMod = barBll.SelLastModByUid(mu); BarOption baroption = GuestConfig.GuestOption.BarOption.Find(v => v.CateID == CateID); int usertime = baroption == null ? 120 : baroption.UserTime; int sendtime = baroption == null ? 5 : baroption.SendTime; if (mu.UserID > 0 && (DateTime.Now - mu.RegTime).TotalMinutes < usertime)//匿名用户不受此限 { int minute = usertime - (int)(DateTime.Now - mu.RegTime).TotalMinutes; return(WriteErr("新注册用户" + usertime + "分钟内不能发贴,你还需要" + minute + "分钟", "javascript:history.go(-1);")); } else if (lastMod != null && (DateTime.Now - lastMod.CDate).TotalMinutes < sendtime) { int minute = sendtime - (int)(DateTime.Now - lastMod.CDate).TotalMinutes; return(WriteErr("你发贴太快了," + minute + "分钟后才能再次发贴", "javascript:history.go(-1);")); } } barMod = FillMsg(title, msg, pid, 0, cateMod); barMod.ID = barBll.Insert(barMod); if (pid < 1) { rurl = "/PItem?ID=" + barMod.ID; } if (cateMod.Status == 1 && mu.UserID > 0 && cateMod.SendScore > 0)//是否需审核 { buser.AddMoney(mu.UserID, cateMod.SendScore, M_UserExpHis.SType.Point, string.Format("{0} {1}在版面:{2}发表主题:{3},赠送{4}分", DateTime.Now, mu.UserName, cateMod.CateName, barMod.Title, cateMod.SendScore)); } } return(Redirect(rurl)); }
//------------------新购物流程 public string GetShopUrl(object storeid, object proid) { return(GetShopUrl(DataConvert.CLng(storeid), Convert.ToInt32(proid))); }
//与写入新的进度信息,如果是最后一步或是拒绝,则更新OA模型 private void UpdateModel(int status) { //会签需要加判断,备注需要另外处理 oaMod = oaBll.SelReturnModel(appID); M_MisProcedure proceMod = proceBll.SelReturnModel(oaMod.ProID); //throw new Exception(progBll.IsHQComplete(appID, userID, CurrentStep).ToString()); progMod.AppID = oaMod.ID; progMod.ProID = oaMod.ProID; progMod.ProLevel = CurrentStep.stepNum; progMod.ProLevelName = CurrentStep.stepName; progMod.ApproveID = userID; progMod.Result = status; progMod.Remind = remindT.Text; progMod.CreateTime = DateTime.Now; progMod.HQUserID = userID.ToString(); //if (signRadio.Items.Count > 0 && signRadio.SelectedIndex > 0)//0是不使用签章 //{ // progMod.Sign = signRadio.SelectedValue + ":" + curPosD.Value; // progMod.SignID = signRadio.SelectedValue; //} //用于email与sms通知功能 string content = ""; //是否为最后一步 bool isLastStep = freeBll.IsLastStep(oaMod, CurrentStep); //增加通知功能, if (isLastStep && status == 98) { if (oaMod.ProType == (int)M_MisProcedure.ProTypes.AdminFree) { //公文流程且是最后一步, status = proceMod.AllowAttach == 1 ? (int)ZLEnum.ConStatus.Filed : (int)ZLEnum.ConStatus.Audited; } if (CurrentStep.HQoption > 0)//会签判断 { if (progBll.IsHQComplete(appID, userID, CurrentStep)) { oaMod.Status = status;//流程完成,全部同意 oaMod.CurStepNum = CurrentStep.stepNum; content = oaMod.Title + "会签完成,已进入下一步骤"; } } else { oaMod.Status = status;//流程完成,全部同意 oaMod.CurStepNum = CurrentStep.stepNum; content = oaMod.Title + "已完成" + CurrentStep.stepName + ",进入下一步骤"; } } else if (status == 2) //回退 { #region 回退 oaMod.Status = 2; int rbStep = DataConvert.CLng(rollBackDP.SelectedValue); if (rbStep > 0) { rbStep = rbStep - 1; //自由流程回退删除步骤 freeBll.DelByStep(oaMod.ID, Convert.ToInt32(rollBackDP.SelectedValue)); } else //回退至上一步(-1) { rbStep = CurrentStep.stepNum - 2; //自由流程回退删除步骤 freeBll.DelByStep(oaMod.ID, CurrentStep.stepNum - 1); } oaMod.CurStepNum = rbStep; progMod.Remind2 = "回退至" + rbStep; progMod.HQUserID = ""; content = oaMod.Title + "已被经办人回退至" + rbStep; //回退的时候,清除目标会签与签章信息 progBll.ClearHQ(oaMod.ID, rbStep); progBll.ClearSign(oaMod.ID, rbStep); #endregion } else if (status == -1) { oaMod.Status = status; //拒绝 oaMod.CurStepNum = CurrentStep.stepNum; content = oaMod.Title + "已被经办人" + buser.GetLogin().HoneyName + "拒绝."; } else//同意,但未至最后一步 { if (CurrentStep.HQoption > 0)//需要会签 { if (progBll.IsHQComplete(appID, userID, CurrentStep)) { oaMod.Status = status; oaMod.CurStepNum = CurrentStep.stepNum; content = oaMod.Title + "已完成会签审批,成功通过"; } } else { oaMod.Status = status; oaMod.CurStepNum = CurrentStep.stepNum; content = oaMod.Title + "已完成审批,成功通过"; } } if (!string.IsNullOrEmpty(CurrentStep.EmailAlert))//Email与sms通知 { //发送邮件包括会员组里的会员(需扩展支持会员组) string ids = ""; //if (!string.IsNullOrEmpty(CurrentStep.EmailGroup)) // ids += groupBll.GetUserIDByGroupIDS(CurrentStep.EmailGroup); ids += CurrentStep.SmsAlert; ids = ids.Trim(','); emailToUser(content, ids); } //if (!string.IsNullOrEmpty(CurrentStep.SmsAlert)) //{ // smsTouser(content, CurrentStep.SmsAlert); //} progBll.Insert(progMod); oaBll.UpdateByID(oaMod); }
private M_Product FillProductModel(ref DataTable table, M_Product proMod = null) { if (proMod == null) { proMod = new M_Product(); } string adminname = badmin.GetAdminLogin().AdminName; //DataTable gpdt = gpBll.GetGroupList(); /*--------------proMod------------*/ if (proMod.ID < 1) { proMod.Nodeid = NodeID; proMod.FirstNodeID = nodeBll.SelFirstNodeID(proMod.Nodeid); proMod.ModelID = ModelID; proMod.TableName = modBll.SelReturnModel(ModelID).TableName; proMod.AddUser = adminname; } DataTable dt = fieldBll.GetModelFieldList(proMod.ModelID); table = new Call().GetDTFromMVC(dt, Request); //------------------------------------------- proMod.ProCode = Request.Form["ProCode"]; proMod.BarCode = Request.Form["BarCode"]; proMod.Proname = Request.Form["Proname"]; proMod.ShortProName = Request.Form["ShortProName"]; proMod.Kayword = Request.Form["tabinput"]; keyBll.AddKeyWord(proMod.Kayword, 1); proMod.ProUnit = Request.Form["ProUnit"]; proMod.AllClickNum = DataConverter.CLng(Request.Form["AllClickNum"]); proMod.Weight = DataConvert.CDouble(Request.Form["Weight_T"]); proMod.ProClass = DataConverter.CLng(Request.Form["proclass_rad"]); proMod.IDCPrice = Request.Form["IDC_Hid"]; proMod.PointVal = DataConverter.CLng(Request.Form["PointVal"]); proMod.Proinfo = Request.Form["Proinfo"]; proMod.Procontent = Request.Form["Procontent"]; proMod.Clearimg = Request.Form["txt_Clearimg"]; proMod.Thumbnails = Request.Form["txt_Thumbnails"]; proMod.Producer = Request.Form["Producer"]; proMod.Brand = Request.Form["Brand"]; //proMod.Quota = DataConverter.CLng(Quota.Text); //proMod.DownQuota = DataConverter.CLng(DownQuota.Text); proMod.StockDown = DataConverter.CLng(Request.Form["StockDown"]); proMod.Rate = DataConverter.CDouble(Request.Form["Rate"]); proMod.Rateset = DataConverter.CLng(Request.Form["Rateset"]); proMod.Dengji = DataConverter.CLng(Request.Form["Dengji"]); proMod.ShiPrice = DataConverter.CDouble(Request.Form["ShiPrice"]); proMod.LinPrice = DataConverter.CDouble(Request.Form["LinPrice"]); //proMod.Preset = (OtherProject.SelectedValue == null) ? "" : OtherProject.SelectedValue; //促销 //proMod.Integral = DataConverter.CLng(Integral.Text); //proMod.Propeid = DataConverter.CLng(Propeid.Text); proMod.Recommend = DataConverter.CLng(Request.Form["Recommend"]); //proMod.Largesspirx = DataConverter.CLng(Largesspirx.Text); proMod.Largess = DataConvert.CLng(Request.Form["Largess"]); //更新时间,若没有指定则为当前时间 proMod.UpdateTime = DataConverter.CDate(Request.Form["UpdateTime"]); proMod.AddTime = DataConverter.CDate(Request.Form["AddTime"]); proMod.ModeTemplate = Request.Form["ModeTemplate_hid"]; //proMod.bookDay = DataConverter.CLng(BookDay_T.Text); proMod.BookPrice = DataConverter.CDouble(Request.Form["BookPrice"]); proMod.FarePrice = Request.Form["FareTlp_Rad"]; proMod.UserShopID = DataConvert.CLng(Request.Form["UserShopID"]);//店铺页面应该禁止此项 proMod.UserType = DataConverter.CLng(Request.Form["UserPrice_Rad"]); proMod.Quota = DataConvert.CLng(Request.Form["Quota_Rad"]); proMod.DownQuota = DataConvert.CLng(Request.Form["DownQuota_Rad"]); switch (proMod.UserType) { case 1: proMod.UserPrice = Request.Form["UserPrice"]; break; case 2: proMod.UserPrice = Request.Form["Price_Group_Hid"]; break; } switch (proMod.Quota) { case 0: break; case 2: proMod.Quota_Json = Request.Form["Quota_Group_Hid"]; break; } switch (proMod.DownQuota) { case 0: break; case 2: proMod.DownQuota_Json = Request.Form["DownQuota_Group_Hid"]; break; } proMod.Sales = DataConverter.CLng(Request.Form["Sales_Chk"]); proMod.Istrue = DataConverter.CLng(Request.Form["istrue_chk"]); proMod.Ishot = DataConverter.CLng(Request.Form["ishot_chk"]); proMod.Isnew = DataConverter.CLng(Request.Form["isnew_chk"]); proMod.Isbest = DataConverter.CLng(Request.Form["isbest_chk"]); proMod.Allowed = DataConverter.CLng(Request.Form["Allowed"]); proMod.GuessXML = Request.Form["GuessXML"]; proMod.Wholesalesinfo = Request.Form["ChildPro_Hid"]; proMod.DownCar = DataConvert.CLng(Request.Form["DownCar"]); ////捆绑商品 if (!string.IsNullOrEmpty(Request.Form["Bind_Hid"])) { //获取绑定商品 DataTable binddt = JsonHelper.JsonToDT(Request.Form["Bind_Hid"]); proMod.BindIDS = StrHelper.GetIDSFromDT(binddt, "ID"); } else { proMod.BindIDS = ""; } return(proMod); }
public string GetResult(object o) { return(progMod.GetResult(DataConvert.CLng(o.ToString()))); }
public ActionResult Addon_VerBak() { PageSetting setting = verBll.SelPage(CPage, PSize, DataConvert.CLng(Request["GeneralID"]), "product"); return(View("Addon/VerBak", setting)); }
/// <summary> /// IDC专用筛选 /// </summary> public DataTable IDC_Sel(int orderType, string skeetype, string skey, string order = "id desc", string addon = "", int orderStatus = -100, int payStatus = -100) { string where = " OrderType = " + orderType; List <SqlParameter> sp = new List <SqlParameter>(); sp.Add(new SqlParameter("skey", "%" + skey + "%")); switch (skeetype) { case "orderno": where += " AND OrderNo LIKE @skey"; break; case "rename": where += " AND Rename LIKE @skey"; break; case "proname": where += " AND ProName LIKE @skey"; break; case "userid": if (DataConvert.CLng(skey) > 0) { where += " AND Userid = " + DataConvert.CLng(skey); } break; } order = order ?? ""; switch (order.ToLower().Trim(' ')) { case "addtime desc": order = "A.STime DESC"; break; case "addtime asc": order = "A.STime ASC"; break; case "endtime desc": order = "A.ETime DESC"; break; case "endtime asc": order = "A.ETime ASC"; break; default: order = "A.ID DESC"; break; } addon = addon ?? ""; switch (addon.ToLower()) { case "normal": //正常订单 where += " AND DATEDIFF(DAY,GETDATE(),A.ETime)>0 AND Paymentstatus = 1"; break; case "aboutex": //30天内到期订单 where += " AND DATEDIFF(DAY,GETDATE(),A.ETime) < 30 AND DATEDIFF(DAY,GETDATE(),A.ETime) > 0 AND Paymentstatus = 1"; break; case "expired": //到期订单 where += " AND DATEDIFF(DAY,GETDATE(),A.ETime) <= 0 AND Paymentstatus = 1"; break; case "nopay": //未付款 where += " AND Paymentstatus = 0"; break; } string mtable = "(SELECT A.*,B.STime,B.ETime,B.Domain FROM ZL_OrderInfo A LEFT JOIN ZL_Order_IDC B ON A.OrderNo=B.OrderNo)"; return(DBCenter.JoinQuery("A.*,B.Proname,B.Proid,B.ID AS Cid", mtable, "ZL_CartPro", "A.ID=B.Orderlistid", where, order, sp.ToArray())); }
/// <summary> /// 根据模板和购物车商品数量/金额,计算出邮费的DataTable并返回 /// </summary> /// <param name="cartdt">某一店铺的购物车</param> /// <param name="faredt">运费dt</param> private DataTable GetFareDT(DataTable cartdt) { //以初始运费高的模板为准(运费,免邮条件等)(避免有漏造成商户损失) List <M_Shop_Fare> fareList = new List <M_Shop_Fare>(); M_Shop_Fare expMod = new M_Shop_Fare() { name = "exp", price = "0", plus = "0" }; M_Shop_Fare emsMod = new M_Shop_Fare() { name = "ems", price = "0", plus = "0", enabled = false }; M_Shop_Fare mailMod = new M_Shop_Fare() { name = "mail", price = "0", plus = "0", enabled = false }; DataTable tlpDT = cartdt.DefaultView.ToTable(true, "FarePrice1");//有多少运费模板 for (int i = 0; i < tlpDT.Rows.Count; i++) { int id = DataConvert.CLng(tlpDT.Rows[i]["FarePrice1"]); if (id < 1) { continue; } M_Shop_FareTlp fareMod = fareBll.SelReturnModel(id); JArray arr = JsonConvert.DeserializeObject <JArray>(fareMod.Express); //选出条件寄送方式不同,未禁用,价格最高的三种寄送方式 foreach (JObject obj in arr) { M_Shop_Fare model = JsonConvert.DeserializeObject <M_Shop_Fare>(obj.ToString()); if (!model.enabled) { continue; } switch (model.name) { case "exp": if (model.Price >= expMod.Price) { expMod = model; } break; case "ems": if (model.Price >= emsMod.Price) { emsMod = model; } break; case "mail": if (model.Price >= mailMod.Price) { mailMod = model; } break; default: throw new Exception("快递类型异常"); } } } fareList.Add(expMod); fareList.Add(emsMod); fareList.Add(mailMod); DataTable faredt = CreateFareDT(Convert.ToInt32(cartdt.Rows[0]["StoreID"])); return(FareDT(cartdt, faredt, fareList)); }
public static PageSetting Order_Sel(Filter_Order filter) { string where = "OrderType!=" + (int)M_OrderList.OrderEnum.Hide; List <SqlParameter> sp = new List <SqlParameter>(); //是否包含回收站订单 if (filter.aside != -100) { where += " AND Aside=" + filter.aside; } #region 用户中心快速筛选 switch (filter.fast) { case "all": //全部(不含回收站) where += " AND Aside=0"; break; case "unpaid": //待付款==状态为未付款的 where += " AND PaymentStatus=" + (int)M_OrderList.PayEnum.NoPay; break; case "prepay": //已预付款(尚未支付尾款的订单) where += " AND Aside=0 AND Delivery=1 AND IsCount=0"; break; case "paid": //已支付(只支付了预付款的不在此列) where += " AND Aside=0 AND ((PaymentStatus=" + (int)M_OrderList.PayEnum.HasPayed + " AND Delivery=0) OR (Delivery=1 AND IsCount=1 AND Settle=1)) "; break; case "needpay": //需付款 where += " AND Aside=0 AND PaymentStatus=0"; break; case "receive": //需确认收货 where += " AND Aside=0 AND StateLogistics=1"; break; case "comment": //已付款未评价 //where += " AND (OrderStatus=" + (int)M_OrderList.StatusEnum.OrderFinish + " AND StateLogistics=" + (int)M_OrderList.ExpEnum.HasReceived + ")"; //where += " AND (SELECT COUNT(*) FROM ZL_CartPro WHERE Orderlistid=ID AND (AddStatus IS NULL OR AddStatus=''))>0";//AddStatus中会有退货记录,所以筛选为必须为空 //break; case "finish": //客户已付款收货 ||客户已完成退货 { where += string.Format(" AND ({0} OR {1})", "(OrderStatus=" + (int)M_OrderList.StatusEnum.OrderFinish + " AND StateLogistics=" + (int)M_OrderList.ExpEnum.HasReceived + ")", "(PaymentStatus=" + (int)M_OrderList.PayEnum.Refunded + ")"); } break; case "issure": where += " AND IsSure=0 "; break; case "recycle": //订单回收站 where = "OrderType!=" + (int)M_OrderList.OrderEnum.Hide + " AND Aside=1"; break; } #endregion #region 后台快速筛选 switch (filter.addon) { case "unpaid": //待付款==状态为未付款的 where += " AND PaymentStatus=" + (int)M_OrderList.PayEnum.NoPay; break; case "prepay": //已预付款(尚未支付尾款的订单) where += " AND Delivery=1 AND IsCount=0"; break; case "paid": where += " AND ((PaymentStatus=" + (int)M_OrderList.PayEnum.HasPayed + " AND Delivery=0) OR (Delivery=1 AND IsCount=1 AND Settle=1)) "; //where += " AND PaymentStatus=" + (int)M_OrderList.PayEnum.HasPayed; break; case "unexp": //待发货==已付款+未发货 where += " AND PaymentStatus=" + (int)M_OrderList.PayEnum.HasPayed + " AND StateLogistics=" + (int)M_OrderList.ExpEnum.NoSend; break; case "exped": //已发货==大于未发货状态的订单 where += " AND StateLogistics>" + (int)M_OrderList.ExpEnum.NoSend; break; case "finished": //where += " AND OrderStatus=" + (int)M_OrderList.StatusEnum.OrderFinish + " AND StateLogistics=" + (int)M_OrderList.ExpEnum.HasReceived; //后期移除,暂时支持预付 where += " AND (OrderStatus=" + (int)M_OrderList.StatusEnum.OrderFinish + " AND StateLogistics=" + (int)M_OrderList.ExpEnum.HasReceived + ")"; break; case "unrefund": where += " AND PaymentStatus=" + (int)M_OrderList.PayEnum.RequestRefund; break; case "refunded": where += " AND PaymentStatus=" + (int)M_OrderList.PayEnum.Refunded; break; case "recycle": //订单回收站==已关闭 where = " Aside=1 "; break; case "all": //全部(不含回收站) default: break; } #endregion //店铺类型 switch (filter.storeType) { case "all": break; case "store": where += " AND StoreID>0"; break; case "shop": where += " AND StoreID=0 "; break; default: if (DataConvert.CLng(filter.storeType) > 0) { where += " AND StoreID=" + DataConvert.CLng(filter.storeType) + " "; } break; } if (filter.isSure != -100) { where += " AND IsSure=" + filter.isSure; } //订单类型,未指定则抽出常规订单 if (string.IsNullOrEmpty(filter.orderType)) { where += " AND OrderType IN (0,1,4)"; } else if (filter.orderType.Equals("-100") || filter.orderType.Equals("-1")) { } else { SafeSC.CheckIDSEx(filter.orderType); where += " AND OrderType IN (" + filter.orderType + ")"; } //商品名,订单号,用户名,手机号,用户ids if (!string.IsNullOrEmpty(filter.proname)) { where += " AND ProName LIKE @proname"; sp.Add(new SqlParameter("proname", "%" + filter.proname + "%")); } if (!string.IsNullOrEmpty(filter.orderno)) { where += " AND OrderNo LIKE @orderno"; sp.Add(new SqlParameter("orderno", "%" + filter.orderno + "%")); } if (!string.IsNullOrEmpty(filter.reuser)) { where += " AND (Rename LIKE @reuser OR Receiver LIKE @reuser)"; sp.Add(new SqlParameter("reuser", "%" + filter.reuser + "%")); } if (!string.IsNullOrEmpty(filter.mobile)) { where += " AND MobileNum LIKE @mobile"; sp.Add(new SqlParameter("mobile", "%" + filter.mobile + "%")); } if (!string.IsNullOrEmpty(filter.uids) && SafeSC.CheckIDS(filter.uids)) { where += " AND Receiver IN (" + filter.uids + ")"; } //下单日期 if (!string.IsNullOrEmpty(filter.stime)) { DateTime result = DateTime.Now; if (DateTime.TryParse(filter.stime, out result)) { where += " AND AddTime>=@stime"; sp.Add(new SqlParameter("stime", result.ToString("yyyy/MM/dd 00:00:00"))); } } if (!string.IsNullOrEmpty(filter.etime)) { DateTime result = DateTime.Now; if (DateTime.TryParse(filter.etime, out result)) { where += " AND AddTime<=@etime"; sp.Add(new SqlParameter("etime", result.ToString("yyyy/MM/dd 23:59:59"))); } } //发货时间 if (!string.IsNullOrEmpty(filter.expstime) || !string.IsNullOrEmpty(filter.expetime)) { where += " AND ExpSTime IS NOT NULL "; } if (!string.IsNullOrEmpty(filter.expstime))//按发货日期筛选 { DateTime result = DateTime.Now; if (DateTime.TryParse(filter.expstime, out result)) { where += " AND ExpSTime>=@expstime"; sp.Add(new SqlParameter("expstime", result.ToString("yyyy/MM/dd 00:00:00"))); } } if (!string.IsNullOrEmpty(filter.expetime)) { DateTime result = DateTime.Now; if (DateTime.TryParse(filter.expetime, out result)) { where += " AND ExpSTime<=@expetime"; sp.Add(new SqlParameter("expetime", result.ToString("yyyy/MM/dd 23:59:59"))); } } //搜索,支持指定条件 if (!string.IsNullOrEmpty(filter.skey)) { sp.Add(new SqlParameter("skey", "%" + filter.skey + "%")); switch (filter.stype) { case "exp": where += " AND ExpressDelivery LIKE @skey"; break; case "oid": where += " AND ID= " + DataConvert.CLng(filter.skey); break; } } if (!String.IsNullOrEmpty(filter.oids)) { SafeSC.CheckIDSEx(filter.oids); where += " AND ID IN (" + filter.oids + ")"; } if (filter.payType != -100) { where += " AND PayType=" + filter.payType; } string view = "ZL_CartProView"; //只取订单的ID PageSetting setting = PageSetting.Single(filter.cpage, filter.psize, view, "ID", where, " GROUP BY ID ORDER BY ID DESC", sp, "ID"); DBCenter.SelPage(setting); string ids = ""; foreach (DataRow dr in setting.dt.Rows) { ids += dr["id"] + ","; } ids = ids.TrimEnd(','); setting.itemCount = DataConvert.CLng(DBCenter.Count("(SELECT ID FROM ZL_CartProView WHERE " + where + " GROUP BY ID) A", "", sp)); setting.pageCount = SqlBase.GetPageCount(setting.itemCount, setting.psize); //根据订单ID取出购物车中的数据,需要进行名称等筛选 if (!string.IsNullOrEmpty(ids)) { sp.Clear(); string cartWhere = "ID IN (" + ids + ") "; if (!string.IsNullOrEmpty(filter.proname)) { cartWhere += " AND ProName LIKE @proname"; sp.Add(new SqlParameter("proname", "%" + filter.proname + "%")); } setting.dt = DBCenter.Sel(view, cartWhere, "ID DESC", sp); } return(setting); }
public void MyBind() { CartDT = cartBll.SelByCookID(CartCookID, ProClass, ids); if (CartDT.Rows.Count < 1) { function.WriteErrMsg("你尚未选择商品,<a href='/User/Order/OrderList.aspx'>查看我的订单</a>"); } //旅游,酒店等不需要检测地址栏 switch (DataConvert.CLng(CartDT.Rows[0]["ProClass"])) { case (int)M_Product.ClassType.LY: { userli.Visible = true; M_Cart_Travel model = JsonConvert.DeserializeObject <M_Cart_Travel>(CartDT.Rows[0]["Additional"].ToString()); model.Guest.AddRange(model.Contract); UserRPT.DataSource = model.Guest; UserRPT.DataBind(); } break; case (int)M_Product.ClassType.JD: { userli.Visible = true; M_Cart_Hotel model = JsonConvert.DeserializeObject <M_Cart_Hotel>(CartDT.Rows[0]["Additional"].ToString()); model.Guest.AddRange(model.Contract); UserRPT.DataSource = model.Guest; UserRPT.DataBind(); } break; default: //------地址 DataTable addressDT = receBll.SelByUID(buser.GetLogin().UserID); AddressRPT.DataSource = addressDT; AddressRPT.DataBind(); EmptyDiv.Visible = addressDT.Rows.Count < 1; //地址为空提醒 break; } //------核算费用 double allmoney = UpdateCartAllMoney(CartDT); //------费用统计 itemnum_span.InnerText = CartDT.Rows.Count.ToString(); totalmoney_span1.InnerText = allmoney.ToString("f2"); //------店铺 Store_RPT.DataSource = orderCom.SelStoreDT(CartDT); Store_RPT.DataBind(); //------发票绑定 DataTable invoceDT = new DataTable();//orderBll.SelInvoByUser(buser.GetLogin().UserID); if (invoceDT.Rows.Count > 0) { Invoice_RPT.DataSource = invoceDT; Invoice_RPT.DataBind(); } else { Invoice_RPT.Visible = false; } //------积分抵扣 if (SiteConfig.ShopConfig.PointRatiot > 0 && SiteConfig.ShopConfig.PointRatiot < 100 && SiteConfig.ShopConfig.PointRate > 0) { point_body.Visible = true; M_UserInfo usermod = buser.GetLogin(); Point_L.Text = usermod.UserExp.ToString(); int usepoint = (int)(allmoney * (SiteConfig.ShopConfig.PointRatiot * 0.01) / SiteConfig.ShopConfig.PointRate); function.Script(this, "SumByPoint(" + usepoint + ");"); PointRate_Hid.Value = SiteConfig.ShopConfig.PointRate.ToString(); } else { point_tips.Visible = true; } }
protected void Save_Btn_Click(object sender, EventArgs e) { if (Mid > 0) { scheMod = scheBll.GetModel(Mid); } scheMod.TaskName = TaskName_T.Text; //scheMod.ExecuteTime = ExecuteTime_T1.Text; scheMod.Interval = DataConvert.CLng(Interval_T.Text); if (TaskContent_T.Text.StartsWith("/"))//任务内容为脚本路径时 { if (!File.Exists(function.VToP(TaskContent_T.Text))) { function.WriteErrMsg("脚本不存在"); } else { scheMod.TaskContent = TaskContent_T.Text; } } else { scheMod.TaskContent = TaskContent_T.Text; } scheMod.Remind = Remind_T.Text; //任务类型不允许修改 if (Mid <= 0) { scheMod.TaskType = DataConvert.CLng(Request.Form["taskType_rad"]); } scheMod.ExecuteType = DataConvert.CLng(Request.Form["executeType_rad"]); scheMod.Status = DataConvert.CLng(Request.Form["status_rad"]); if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.Interval) { if (scheMod.Interval <= 0) { function.WriteErrMsg("未指定正确的间隔时间"); } } else if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.JustOnce) { scheMod.ExecuteTime = ExecuteTime_T1.Text; if (DataConvert.CDate(scheMod.ExecuteTime) < DateTime.Now) { function.WriteErrMsg("执行时间无效"); } } else if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.EveryDay) { scheMod.ExecuteTime = ExecuteTime_T2.Text; } else if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.EveryMonth) { scheMod.ExecuteTime = ExecuteTime_T1.Text; } if (Mid > 0) { scheBll.Update(scheMod); } else { M_AdminInfo adminMod = B_Admin.GetLogin(); scheMod.CDate = DateTime.Now; scheMod.AdminID = adminMod.AdminId; scheMod.ID = scheBll.Add(scheMod); } TaskCenter.AddTask(scheMod); function.WriteSuccessMsg("操作成功", "Default.aspx"); }
// 保存 protected void Button1_Click(object sender, EventArgs e) { SiteConfig.SiteOption.AdvertisementDir = txtAdvertisementDir.Text; SiteConfig.SiteOption.CssDir = txtCssDir.Text; SiteConfig.SiteOption.StylePath = txtStylePath.Text; SiteConfig.SiteOption.SiteManageMode = SiteManageMode_Chk.Checked ? 1 : 0; //检索是否存在该语言 //if (languages.SelectedIndex > 1) //{ // string dirPath = HttpContext.Current.Server.MapPath("~/Language/" + languages.SelectedValue + ".xml"); // if (!File.Exists(dirPath)) // { // function.WriteErrMsg("对不起,系统未配置此语言,请检索配置或联系官网获取此语言配置!", Request.RawUrl); // } //} //SiteConfig.SiteOption.Language = languages.SelectedValue; lang.LangOP = languages.SelectedValue; SiteConfig.SiteOption.EnableSiteManageCode = EnableSiteManageCod.Checked; SiteConfig.SiteOption.EnableSoftKey = EnableSoftKey.Checked; SiteConfig.SiteOption.EnableUploadFiles = EnableUploadFiles.Checked; if (rdoIapTrue.Checked) { SiteConfig.SiteOption.IsAbsoluatePath = true; } else { SiteConfig.SiteOption.IsAbsoluatePath = false; } SiteConfig.SiteOption.OpenSendMessage = OpenSendMessage.Checked; SiteConfig.SiteOption.DomainMerge = DomainMerge_Chk.Checked; //云盘 SiteConfig.SiteOption.Cloud_Auth = ""; for (int i = 0; i < cloud_ChkList.Items.Count; i++) { if (cloud_ChkList.Items[i].Selected) { SiteConfig.SiteOption.Cloud_Auth += cloud_ChkList.Items[i].Value + ","; } } SiteConfig.SiteOption.IsMall = IsMall.Checked; SiteConfig.SiteOption.CloudLeadTips = cloudLeadTips.Checked ? "1" : "0"; if (UAgent.Checked) { SiteConfig.SiteOption.UAgent = true; } else { SiteConfig.SiteOption.UAgent = false; } //SiteConfig.SiteOption.KDAPI = RB_switch.Checked ? 1 : 0;//快递100 SiteConfig.SiteOption.KDKey = KDKey_T.Text.Trim(); //商城模块配置 SiteConfig.SiteOption.OrderMsg_Chk = GetCheckVal(OrderMsg_Chk); SiteConfig.SiteOption.THDate = Convert.ToInt32(ReturnDate_T.Text); SiteConfig.SiteOption.OrderMsg_Tlp = GetJson(orderparam, OrderMsg_ordered_T.Text, OrderMsg_payed_T.Text); SiteConfig.SiteOption.OrderMasterMsg_Chk = GetCheckVal(OrderMasterMsg_Chk); SiteConfig.SiteOption.OrderMasterMsg_Tlp = GetJson(orderparam, OrderMasterMsg_ordered_Tlp.Text, OrderMasterMsg_payed_Tlp.Text); SiteConfig.SiteOption.OrderMasterEmail_Chk = GetCheckVal(OrderMasterEmail_Chk); SiteConfig.SiteOption.OrderMasterEmail_Tlp = GetJson(orderparam, OrderMasterEmail_ordered_Tlp.Text, OrderMasterEmail_payed_Tlp.Text); //---- //SiteConfig.SiteOption.SMSTips = SMSTips.Checked; SiteConfig.SiteOption.DomainRoute = DomainRoute_chk.Checked ? "1" : "0"; //SiteConfig.SiteOption.Savadaylog = DataConverter.CLng(Savadaylog.Text).ToString(); //SiteConfig.SiteOption.Savanumlog = DataConverter.CLng(Savanumlog.Text).ToString(); SiteConfig.SiteOption.SiteCollKey = SiteCollKey_T.Text.Trim(); SiteConfig.SiteOption.SafeDomain = safeDomain_Chk.Checked ? "1" : "0"; SiteConfig.SiteOption.SiteManageCode = txtSiteManageCode.Text; SiteConfig.SiteOption.TemplateDir = DropTemplateDir.SelectedItem.Text; SiteConfig.SiteOption.ProjectServer = txtProjectServer.Text; SiteConfig.SiteOption.GeneratedDirectory = txtCatalog.Text; //生成页面目录 SiteConfig.SiteOption.PdfDirectory = txtPdf.Text; //生成PDF目录 SiteConfig.SiteOption.IndexEx = IndexEx.Text; SiteConfig.SiteOption.IndexTemplate = IndexTemplate_DP_hid.Value; SiteConfig.SiteOption.ShopTemplate = ShopTemplate_DP_hid.Value; SiteConfig.SiteOption.UploadDir = txtUploadDir.Text; SiteConfig.SiteOption.UploadFileExts = txtUploadFileExts.Text; SiteConfig.SiteOption.UploadPicExts = TxtUpPicExt.Text; SiteConfig.SiteOption.UploadPicMaxSize = int.Parse(TxtUpPicSize.Text); SiteConfig.SiteOption.EditVer = EditVer.SelectedValue; SiteConfig.SiteOption.IsSaveRemoteImage = EditVer.SelectedValue == "1" ? true : false; SiteConfig.SiteOption.UploadMdaExts = TxtUpMediaExt.Text; SiteConfig.SiteOption.UploadMdaMaxSize = int.Parse(TxtUpMediaSize.Text); SiteConfig.SiteOption.UploadFlhMaxSize = int.Parse(TxtUpFlashSize.Text); //SiteConfig.ShopConfig.OrderNum = decimal.Parse(txtSetPrice.Text); SiteConfig.ShopConfig.ItemRegular = ItemRegular_T.Text; SiteConfig.ShopConfig.IsCheckPay = IsCheckPay.Checked ? 1 : 0; SiteConfig.ShopConfig.OrderExpired = DataConvert.CLng(OrderExpired_T.Text); //SiteConfig.ShopConfig.EnablePointBuy = EnablePointBuy_Chk.Checked; SiteConfig.ShopConfig.PointRatiot = DataConvert.CDouble(PointRatio_T.Text); SiteConfig.ShopConfig.PointRate = DataConvert.CDouble(PointRate_T.Text); SiteConfig.SiteOption.OpenMoneySel = OpenMoneySel_Chk.Checked; SiteConfig.SiteOption.OpenMessage = OpenMessage.Checked ? 1 : 0; SiteConfig.SiteOption.DupTitleNum = DataConvert.CLng(DupTitleNum_T.Text); SiteConfig.SiteOption.FileRj = SiteConfig.SiteOption.DupTitleNum > 0 ? 1 : 0; SiteConfig.SiteOption.OpenAudit = OpenAudit.Checked ? 1 : 0; SiteConfig.SiteOption.IsSensitivity = rdoIsSensitivity.Checked ? 1 : 0; SiteConfig.SiteOption.Sensitivity = TxtSensitivity.Text.Trim(); SiteConfig.SiteOption.Videourl = Videourl.Text.Trim(); SiteConfig.SiteOption.FlexKey = FlexKey.Text.Trim(); SiteConfig.SiteOption.WxAppID = APPAuth_T.Text.Trim(); SiteConfig.SiteOption.RegPageStart = rdoBtnLSh.Checked; SiteConfig.SiteOption.MailPermission = MailPermission.Checked ? "1" : "0"; SiteConfig.SiteOption.FileN = FileN.SelectedIndex; SiteConfig.SiteOption.DeleteLocal = DeleteLocal.Checked; SiteConfig.SiteOption.IsOpenHelp = IsOpenHelp.Checked ? "1" : "0"; SiteConfig.UserConfig.CommentRule = DataConverter.CLng(CommentRule.Text); SiteConfig.SiteOption.SiteID = Request.Form["PayType"]; SiteConfig.SiteOption.LoggedUrl = LoggedUrl_T.Text; SiteConfig.SiteOption.MastMoney = DataConvert.CDouble(MastMoney_T.Text); //SiteConfig.SiteOption.RegManager = IsManageReg.Checked ? 1 : 0; string path = Request.PhysicalApplicationPath + "/manage/help"; if (IsOpenHelp.Checked) { if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } if (DeleteLocal.Checked) { System.Net.WebClient myWebClient = new System.Net.WebClient(); DataSet ds = new DataSet(); try { ds.ReadXml(SiteConfig.SiteOption.ProjectServer + "/api/gettemplate.aspx?menu=gethelp"); } catch { function.WriteErrMsg("请检查云端设置是否正常", CustomerPageAction.customPath + "Config/SiteOption.aspx"); } DataTable dt = ds.Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { myWebClient.DownloadFile(SiteConfig.SiteOption.ProjectServer + "/help/" + dt.Rows[i]["TempDirName"].ToString(), Request.PhysicalApplicationPath + "/manage/help/" + dt.Rows[i]["TempDirName"].ToString()); } } } if ((!IsOpenHelp.Checked) && DeleteLocal.Checked) { if (Directory.Exists(path)) { FileSystemObject.Delete(path, FsoMethod.Folder); } } XmlDocument appDoc = new XmlDocument(); appDoc.Load(Server.MapPath("/Config/AppSettings.config")); XmlNodeList amde = appDoc.SelectSingleNode("appSettings").ChildNodes; foreach (XmlNode xn in amde) { XmlElement xe = (XmlElement)xn; if (xe.GetAttribute("key").ToString() == "TraditionalChinese") { xe.SetAttribute("value", TraditionalChinese.SelectedValue); } } try { appDoc.Save(Server.MapPath("/Config/AppSettings.config")); } catch (System.IO.IOException) { } try { SiteConfig.Update(); if (Convert.ToInt64(txtUploadFileMaxSize.Text) > 4096) { function.WriteErrMsg("IIS可支持最大文件上传的容量为4G!"); } webhelper.UpdateMaxFile((Convert.ToInt64(txtUploadFileMaxSize.Text) * 1024 * 1024).ToString()); function.WriteSuccessMsg("网站参数配置保存成功", CustomerPageAction.customPath + "Config/SiteOption.aspx"); } catch (FileNotFoundException) { function.WriteErrMsg("文件未找到", "SiteOption.aspx"); } catch (UnauthorizedAccessException) { function.WriteErrMsg("检查您的服务器是否给配置文件或文件夹配置了写入权限", CustomerPageAction.customPath + "Config/SiteOption.aspx"); } }
protected void ProRPT_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dr = e.Item.DataItem as DataRowView; switch (DataConvert.CLng(dr["Class"])) { case 2: //套装促销 Repeater rpt = e.Item.FindControl("SuitPro_RPT") as Repeater; rpt.DataSource = proBll.Suit_GetProduct(DataConvert.CStr(dr["procontent"]), DataConvert.CLng(dr["Pronum"])); rpt.DataBind(); break; default: //普通商品,支持赠品等促销逻辑 { Label ptLabel = e.Item.FindControl("Present_HTML") as Label; ptLabel.Text = PageHelper.Aspx_GetHtml("/cart/comp/cart_present.aspx", dr); } break; } } }
private void SendMsg(Object info) { try { M_WxTextMsg reqMod = (M_WxTextMsg)info; System.Threading.Thread.Sleep(1000);//延迟1秒,避免先于欢迎消息 M_WX_APPID appmod = new B_WX_APPID().GetAppByWxNo(reqMod.ToUserName); if (appmod == null) { throw new Exception("目标公众号[" + reqMod.ToUserName + "]不存在"); } string msgStr = ""; Appinfo uappMod = new Appinfo(); B_UserAPP uappBll = new B_UserAPP(); M_UserInfo mu = new M_UserInfo(); uappMod = uappBll.SelModelByOpenID(reqMod.FromUserName, "wechat"); if (uappMod != null) { mu = buser.GetUserByUserID(uappMod.UserID); M_UserInfo pmu = buser.GetUserByUserID(DataConvert.CLng(reqMod.EventKey.Replace("qrscene_", ""))); if (mu != null && mu.UserID > 0) { if (DataConvert.CLng(mu.ParentUserID) > 0) { msgStr = "您已绑定了推荐人不能重复绑定!"; } else { if (mu.UserID == DataConvert.CLng(reqMod.EventKey.Replace("qrscene_", ""))) { msgStr = "您扫描的是您自己的二维码!"; } else { if (pmu != null && pmu.UserID > 0) { string err = ""; if (CheckParentUser(pmu.UserID, mu.UserID, ref err)) { mu.ParentUserID = pmu.UserID.ToString(); if (buser.UpdateByID(mu)) { msgStr = "您成功绑定了推荐人:" + pmu.TrueName + "!"; } else { msgStr = "绑定推荐人失败!"; } } else { msgStr = "绑定推荐失败,错误信息:" + err; } } else { msgStr = "绑定推荐失败,推荐人不存在!"; } } } } WxAPI.Code_Get(appmod).SendMsg(reqMod.FromUserName, msgStr); } } catch (Exception ex) { ZLLog.L("微信多信息出错,原因:" + ex.Message); } }
// 会员价 private void OtherBind(M_Product pinfo) { DataTable gpdt = gpBll.GetGroupList(); //附加会员价,限购数,最低购买数等限制 gpdt.Columns.Add(new DataColumn("price", typeof(string))); gpdt.Columns.Add(new DataColumn("quota", typeof(string))); gpdt.Columns.Add(new DataColumn("downquota", typeof(string))); if (pinfo != null && pinfo.ID > 0) { if (pinfo.UserPrice.Contains("[")) { DataTable dt = JsonConvert.DeserializeObject <DataTable>(pinfo.UserPrice); if (dt.Columns.Contains("price")) { dt.Columns["price"].ColumnName = "value"; } foreach (DataRow dr in dt.Rows) { DataRow[] gps = gpdt.Select("GroupID='" + dr["gid"] + "'"); if (gps.Length > 0) { gps[0]["price"] = DataConvert.CDouble(dr["value"]).ToString("F2"); } } } if (pinfo.Quota_Json.Contains("[")) { DataTable dt = JsonConvert.DeserializeObject <DataTable>(pinfo.Quota_Json); foreach (DataRow dr in dt.Rows) { DataRow[] gps = gpdt.Select("GroupID='" + dr["gid"] + "'"); if (gps.Length > 0) { gps[0]["quota"] = DataConvert.CLng(dr["value"]); } } } if (pinfo.DownQuota_Json.Contains("[")) { DataTable dt = JsonConvert.DeserializeObject <DataTable>(pinfo.DownQuota_Json); foreach (DataRow dr in dt.Rows) { DataRow[] gps = gpdt.Select("GroupID='" + dr["gid"] + "'"); if (gps.Length > 0) { gps[0]["downquota"] = DataConvert.CLng(dr["value"]); } } } } Price_Group_RPT.DataSource = gpdt; Price_Group_RPT.DataBind(); Quota_RPT.DataSource = gpdt; Quota_RPT.DataBind(); DownQuota_RPT.DataSource = gpdt; DownQuota_RPT.DataBind(); //----------------------------------------------------------- FareTlp_Rad.DataSource = fareBll.Sel(); FareTlp_Rad.DataBind(); FareTlp_Rad.Items.Insert(0, new ListItem("免费", "0")); FareTlp_Rad.SelectedValue = "0"; }