protected void Page_Load(object sender, EventArgs e) { if (null != Common.Common.NoHtml(Request.QueryString["action"])) { strAction = Common.Common.NoHtml(Request.QueryString["action"]); } if (null != Common.Common.NoHtml(Request.QueryString["id"])) { strID = Common.Common.NoHtml(Request.QueryString["id"]); } MSProductOrderDAL dal = new MSProductOrderDAL(); switch (strAction) { case "del": if (dal.UpdateOrderState("OrderState", strID)) { strMessage = "操作成功!"; } else { strMessage = "操作失败!"; } break; } Response.Write(strMessage); Response.End(); }
/// <summary> /// 订单收货 /// </summary> void ReceiveOrder() { string oid = string.Empty; if (Request["oid"] != null && Request["oid"] != "") { oid = Common.Common.NoHtml(Request["oid"]); } if (oid != null && oid != "") { MSProductOrderDAL OrderDal = new MSProductOrderDAL(); if (OrderDal.UpdateOrderState("isReceive", oid)) { string buyName = string.Empty; try { buyName = OrderDal.GetOrderValueByID("BuyName", oid).ToString(); if (strOpenID == null || strOpenID == "") { string customerid = OrderDal.GetOrderDetailValueByOID("CustomerID", oid).ToString(); MSCustomersDAL CustomerDal = new MSCustomersDAL(); try { strOpenID = CustomerDal.GetCustomerValueByID("OpenID", customerid).ToString(); } catch (Exception) { } } WeiXinCore.WeiXin wx = WXHelper.CreateWeiXinInstanceBySiteCode("VYIGO"); List <TemplateMessageParam> paramList = new List <TemplateMessageParam>(); paramList.Add(new TemplateMessageParam("first", "尊敬的" + buyName)); paramList.Add(new TemplateMessageParam("OrderSn", oid)); paramList.Add(new TemplateMessageParam("OrderStatus", "已收货")); paramList.Add(new TemplateMessageParam("Remark", "请关注公众号【vgo2013】进入“服务中心进行查询”查看完整信息")); wx.SendTemplateMessage(strOpenID, "wmrxCKRq1hG3cHR0BXsuUnNq1chcbVosqYLqlsBBRCc", "http://www.vgo2013.com/PalmShop/ShopCode/CustomerOrder.aspx?receive=1", paramList.ToArray(), ""); MSOrderLogDAL.AddMSOrderLog("提示客户订单【" + oid + "】已确认收货,发送模板消息到客户OpenID【" + strOpenID + "】"); } catch (Exception) { } Response.Write("{\"success\":true}"); } else { Response.Write("{\"error\":true,\"msg\":\"操作失败,请稍后再操作\"}"); } } else { Response.Write("{\"error\":true,\"msg\":\"操作失败,请稍后再操作\"}"); } Response.End(); }
/// <summary> /// 提交订单 /// </summary> void submitOrder() { string oid = string.Empty; string cid = string.Empty; string cname = string.Empty; #region -获取页面请求值 try { oid = Request.Form.Get("ordernum").ToString(); } catch (Exception) { oid = ""; } try { cname = Request.Form.Get("cname").ToString(); } catch (Exception) { cname = ""; } try { cid = Request.Form.Get("cid").ToString(); } catch (Exception) { cid = ""; } #endregion strSiteCode = "VYIGO"; string customerid = string.Empty; string openid = string.Empty; if (oid != null && oid != "" && cid != null && cid != "") { MSOrderLogistics olModel = new MSOrderLogistics(); MSOrderLogisticsDAL olDal = new MSOrderLogisticsDAL(); MSProductOrderDAL OrderDal = new MSProductOrderDAL(); olModel.ID = cid; olModel.OID = oid; olModel.CName = cname; customerid = OrderDal.GetOrderValueByID("CustomerID", oid).ToString(); if (customerid != null && customerid != "") { MSCustomersDAL customerDal = new MSCustomersDAL(); openid = customerDal.GetCustomerValueByID("OpenID", customerid).ToString(); } if (olDal.AddOrderLogistics(olModel) && OrderDal.UpdateOrderState("IsSend", oid)) { string buyName = string.Empty; try { buyName = OrderDal.GetOrderValueByID("BuyName", oid).ToString(); WeiXinCore.WeiXin wx = WXHelper.CreateWeiXinInstanceBySiteCode(strSiteCode); List <TemplateMessageParam> paramList = new List <TemplateMessageParam>(); paramList.Add(new TemplateMessageParam("first", "亲,宝贝已经启程了,好想快点来到你身边")); paramList.Add(new TemplateMessageParam("delivername", cname)); paramList.Add(new TemplateMessageParam("ordername", cid)); paramList.Add(new TemplateMessageParam("remark", "请关注公众号【vgo2013】进入“快点我”查看完整物流信息")); SendTemplateMessageReturnObj temobj = wx.SendTemplateMessage(openid, "k4eMeEtKReeDvDRFAf8-Li9FuuHkaFPP1xQI6t3Jomo", "http://www.vgo2013.com/PalmShop/ShopCode/CopyOrder.aspx?oid=" + oid, paramList.ToArray(), ""); MSOrderLogDAL.AddMSOrderLog("提示客户订单【" + oid + "】已经发货,发送模板消息到客户OpenID【" + openid + "】"); bool flag = true; if (flag) { } } catch { } errormsg = JQDialog.alertOKMsgBox(3, "操作成功!", "OrderDelivery.aspx", "succeed"); } else { errormsg = JQDialog.alertOKMsgBoxGoBack(3, "操作失败,请重新操作!", false); } } else { errormsg = JQDialog.alertOKMsgBoxGoBack(3, "操作失败,请重新操作!", false); } }