Exemplo n.º 1
0
        protected void Print_Btn_Click(object sender, EventArgs e)
        {
            int devID = DataConvert.CLng(Request.Form["Dev_R"]);

            if (devID < 1)
            {
                function.WriteErrMsg("你还没有选择打印设备!");
            }
            int Num = DataConvert.CLng(Num_T.Text.Replace(" ", ""));

            if (Num < 1)
            {
                function.WriteErrMsg("请输入正确的打印数量!");
            }
            int orderID = DataConvert.CLng(Order_DP.SelectedValue);
            int tlpID   = DataConvert.CLng(Tlp_DP.SelectedValue);
            //------------------------------
            DataTable          orderDT = DBCenter.Sel("ZL_OrderInfo", "ID=" + orderID);
            M_Shop_PrintTlp    tlpMod  = tlpBll.SelReturnModel(tlpID);
            M_Shop_PrintDevice devMod  = devBll.SelReturnModel(devID);
            string             msg     = orderCOM.TlpDeal(tlpMod.Content, orderDT);

            msgBll.Insert(msg, tlpMod.ID, devMod, Num);
            function.WriteSuccessMsg("信息已发送", "MessageList.aspx");
        }
Exemplo n.º 2
0
 private void MyBind()
 {
     if (Mid > 0)
     {
         M_Shop_PrintTlp tlpMod = tlpBll.SelReturnModel(Mid);
         Alias_T.Text   = tlpMod.Alias;
         Content_T.Text = tlpMod.Content;
         Remind_T.Text  = tlpMod.Remind;
     }
 }
Exemplo n.º 3
0
        protected void Save_Btn_Click(object sender, EventArgs e)
        {
            M_Shop_PrintTlp tlpMod = new M_Shop_PrintTlp();

            if (Mid > 0)
            {
                tlpMod = tlpBll.SelReturnModel(Mid);
            }
            tlpMod.Alias   = Alias_T.Text;
            tlpMod.Content = Content_T.Text;
            tlpMod.Remind  = Remind_T.Text;
            if (Mid > 0)
            {
                tlpBll.UpdateByID(tlpMod);
            }
            else
            {
                tlpBll.Insert(tlpMod);
            }
            function.WriteSuccessMsg("操作成功", "QuickPrint.aspx");
        }
Exemplo n.º 4
0
    //支付成功时执行的操作
    private void PayOrder_Success(WxPayData result)
    {
        ZLLog.L(ZLEnum.Log.pay, "微信:微信支付 支付单:" + result.GetValue("out_trade_no") + " 金额:" + result.GetValue("total_fee"));
        try
        {
            M_Order_PayLog paylogMod = new M_Order_PayLog();
            M_Payment      pinfo     = payBll.SelModelByPayNo(result.GetValue("out_trade_no").ToString());
            if (pinfo == null)
            {
                throw new Exception("支付单不存在");
            }                                                    //支付单检测合为一个方法
            if (pinfo.Status != (int)M_Payment.PayStatus.NoPay)
            {
                throw new Exception("支付单状态不为未支付");
            }
            pinfo.Status       = (int)M_Payment.PayStatus.HasPayed;
            pinfo.PlatformInfo = "微信扫码|公众号支付";
            pinfo.SuccessTime  = DateTime.Now;
            pinfo.PayTime      = DateTime.Now;
            pinfo.CStatus      = true;
            //1=100,
            double tradeAmt = Convert.ToDouble(result.GetValue("total_fee")) / 100;
            pinfo.MoneyTrue = tradeAmt;
            payBll.Update(pinfo);
            DataTable orderDT = orderBll.GetOrderbyOrderNo(pinfo.PaymentNum);
            foreach (DataRow dr in orderDT.Rows)
            {
                M_OrderList orderMod = orderBll.SelModelByOrderNo(dr["OrderNo"].ToString());
                OrderHelper.FinalStep(pinfo, orderMod, paylogMod);
                if (orderMod.Ordertype == (int)M_OrderList.OrderEnum.Purse)
                {
                    M_UserInfo mu = buser.SelReturnModel(orderMod.Userid);
                    new B_Shop_MoneyRegular().AddMoneyByMin(mu, orderMod.Ordersamount, ",订单号[" + orderMod.OrderNo + "]");
                }
                orderCom.SendMessage(orderMod, paylogMod, "payed");
                //orderCom.SaveSnapShot(orderMod);

                if (orderMod.Ordertype != 6)
                {
                    buser.ChangeVirtualMoney(orderMod.Userid, new M_UserExpHis()
                    {
                        score     = orderMod.Ordersamount,
                        ScoreType = 3,
                        detail    = "在线消费赠送积分:" + orderMod.Ordersamount
                    });
                }
                //订单返利
                OrderRebates(orderMod.Userid, orderMod.Ordersamount);
                //订单打印
                int orderID  = DataConvert.CLng(dr["ID"].ToString());
                int StoreID  = DataConvert.CLng(dr["StoreID"].ToString());
                int devID    = GetPrintDevice(StoreID);  //设备ID
                int tlpID    = GetPrintModelID(StoreID); //模板ID
                int printnum = GetPrintNum(StoreID);
                //------------------------------
                DataTable          orderDT1 = DBCenter.Sel("ZL_OrderInfo", "ID=" + orderID);
                M_Shop_PrintTlp    tlpMod   = tlpBll.SelReturnModel(tlpID);
                M_Shop_PrintDevice devMod   = devBll.SelReturnModel(devID);
                string             msg      = orderCOM.TlpDeal(tlpMod.Content, orderDT1);
                ZLLog.L(ZLEnum.Log.pay, msg);
                msgBll.Insert(msg, tlpMod.ID, devMod, printnum);
                //function.WriteSuccessMsg("信息已发送", "MessageList.aspx");

                //发送微信通知
                try
                {
                    userappMod = userappBll.SelModelByUid(DataConvert.CLng(dr["UserID"]), "wechat");
                    if (userappMod != null)
                    {
                        WxAPI wxapi = WxAPI.Code_Get(1);
                        if (dr["Ordertype"].ToString() == "6")
                        {
                            M_UserInfo userMod = buser.GetUserByUserID(DataConvert.CLng(dr["UserID"]));
                            wxapi.Tlp_SendTlpMsg(userappMod.OpenID, "vRUiDj-k6EGjwQC2GO4oU1G37CJjiu2fZ-ePBj1jJ60", "http://v.wodian8.com/User/Order/OrderList1.aspx", "{\"first\": {\"value\":\"您好,您已经充值成功。\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + DataConvert.CDouble(dr["Ordersamount"]).ToString("0.00") + "\",\"color\":\"#173177\"},\"keyword2\": {\"value\":\"" + DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + userMod.Purse.ToString("0.00") + "\",\"color\":\"#173177\"},\"remark\":{\"value\":\"感谢您对我们的信任,我们将为您提供更优质的服务。\",\"color\":\"#173177\"}}");
                        }
                        else
                        {
                            wxapi.Tlp_SendTlpMsg(userappMod.OpenID, "E-yWv8GVKeJHymtTB0zOGKnEv6LXodjr-M6tj1sLzfM", "http://v.wodian8.com/User/Order/OrderList1.aspx", "{\"first\": {\"value\":\"您的订单支付成功!\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + dr["OrderNo"].ToString() + "\",\"color\":\"#173177\"},\"keyword2\": {\"value\":\"" + GetProname(DataConvert.CLng(dr["ID"])) + "\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + DataConvert.CDouble(dr["Ordersamount"]).ToString("0.00") + "\",\"color\":\"#173177\"},\"keyword4\": {\"value\":\"" + DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"remark\":{\"value\":\"点击查看订单详情!\",\"color\":\"#173177\"}}");
                        }
                    }
                }
                catch (Exception ex)
                {
                    ZLLog.L(ZLEnum.Log.pay, new M_Log()
                    {
                        Action  = "发送微信通知报错",
                        Message = "原因:" + ex.Message
                    });
                    throw;
                }
            }
            ZLLog.L(ZLEnum.Log.pay, "微信支付成功!支付单:" + result.GetValue("out_trade_no").ToString());
        }
        catch (Exception ex)
        {
            ZLLog.L(ZLEnum.Log.pay, new M_Log()
            {
                Action  = "支付回调报错",
                Message = "平台:微信,支付单:" + result.GetValue("out_trade_no").ToString() + ",原因:" + ex.Message
            });
        }
    }