Ejemplo n.º 1
0
        //protected void Search_Btn_Click(object sender, EventArgs e)
        //{
        //    Response.Redirect("/Plat/Blog/?Skey=" + Main_Skey_T.Text.Trim());
        //}
        private void GetNotify(M_User_Plat upMod)
        {
            //用户登录,检测有消息则提示
            B_Common_Notify comBll = new B_Common_Notify();
            DataTable       dt     = comBll.Blog_SelMy(upMod.UserID);

            foreach (DataRow dr in dt.Rows)//移除rows中的值,并添加已读列表
            {
                B_User_Notify.Add(dr["Title"].ToString(), dr["Content"].ToString(), upMod.UserID.ToString());
                string rece            = StrHelper.RemoveToIDS(dr["ReceUsers"].ToString(), upMod.UserID.ToString());
                string readed          = StrHelper.AddToIDS(dr["ReadedUsers"].ToString(), upMod.UserID.ToString());
                List <SqlParameter> sp = new List <SqlParameter>()
                {
                    new SqlParameter("rece", rece), new SqlParameter("readed", readed)
                };
                DBCenter.UpdateSQL("ZL_Common_Notify", "ReadedUsers=@readed,ReceUsers=@rece", "ID=" + dr["ID"], sp);
            }
        }
Ejemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            M_UserInfo mu = buser.GetLogin();

            retMod.retcode = M_APIResult.Failed;
            if (mu.IsNull)
            {
                retMod.retmsg = "用户未登录"; RepToClient(retMod);
            }
            //retMod.callback = CallBack;//暂不开放JsonP
            try
            {
                switch (Action)
                {
                case "add":    //授权开放
                    break;

                case "list":
                    var list = B_User_Notify.ReadNotify(mu.UserID.ToString());
                    if (list.Count < 1)
                    {
                        retMod.retmsg = "没有通知信息";
                    }
                    else
                    {
                        retMod.retcode = M_APIResult.Success; retMod.result = JsonConvert.SerializeObject(list);
                    }
                    break;

                default:
                    retMod.retmsg = "[" + Action + "]接口不存在";
                    break;
                }
            }
            catch (Exception ex) { retMod.retmsg = ex.Message; }
            RepToClient(retMod);
        }
Ejemplo n.º 3
0
        //支付成功时执行的操作
        private void PayOrder_Success(M_Payment pinfo, WxPayData result)
        {
            ZLLog.L(ZLEnum.Log.pay, PayPlat + " 支付单:" + result.GetValue("out_trade_no") + " 金额:" + result.GetValue("total_fee"));
            try
            {
                M_Order_PayLog paylogMod = new M_Order_PayLog();
                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 += PayPlat;
                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);
                    M_UserInfo mu   = buser.GetUserByUserID(orderMod.Userid);
                    M_UserInfo pmu1 = buser.SelReturnModel(DataConvert.CLng(mu.ParentUserID));
                    M_UserInfo pmu2 = buser.SelReturnModel(DataConvert.CLng(pmu1.ParentUserID));
                    M_UserInfo pmu3 = buser.SelReturnModel(DataConvert.CLng(pmu2.ParentUserID));

                    //消息推送
                    B_User_Notify notifyBll = new B_User_Notify();
                    M_User_Notify notifyMod = new M_User_Notify();
                    notifyMod.CDate = DateTime.Now;

                    if (!pmu1.IsNull)
                    {
                        B_User_Notify.Add("订单购买消息", "您的初级乐享会员[会员ID:" + mu.UserID + ",微信名:" + mu.TrueName + "]下单成功,订单号为:" + orderMod.OrderNo, pmu1.UserID.ToString());
                    }
                    if (!pmu2.IsNull)
                    {
                        B_User_Notify.Add("订单购买消息", "您的中级乐享会员[会员ID:" + mu.UserID + ",微信名:" + mu.TrueName + "]下单成功,订单号为:" + orderMod.OrderNo, pmu1.UserID.ToString());
                    }
                    if (!pmu3.IsNull)
                    {
                        B_User_Notify.Add("订单购买消息", "您的高级乐享会员[会员ID:" + mu.UserID + ",微信名:" + mu.TrueName + "]下单成功,订单号为:" + orderMod.OrderNo, pmu1.UserID.ToString());
                    }
                    //订单返利
                    //M_UserInfo mu = buser.GetUserByUserID(orderMod.Userid);
                    //M_UserInfo pmu1 = buser.SelReturnModel(DataConvert.CLng(mu.ParentUserID));
                    //M_UserInfo pmu2 = buser.SelReturnModel(DataConvert.CLng(pmu1.ParentUserID));
                    //M_UserInfo pmu3 = buser.SelReturnModel(DataConvert.CLng(pmu2.ParentUserID));
                    //if (!pmu1.IsNull) { OrderRebates(pmu1.UserID, orderMod, mu); }
                    //if (!pmu2.IsNull) { OrderRebates(pmu2.UserID, orderMod, mu); }
                    //if (!pmu3.IsNull) { OrderRebates(pmu3.UserID, orderMod, mu); }
                }
                ZLLog.L(ZLEnum.Log.pay, PayPlat + "成功!支付单:" + result.GetValue("out_trade_no").ToString());
            }
            catch (Exception ex)
            {
                ZLLog.L(ZLEnum.Log.pay, new M_Log()
                {
                    Action  = "支付回调报错",
                    Message = PayPlat + ",支付单:" + result.GetValue("out_trade_no").ToString() + ",原因:" + ex.Message
                });
            }
        }