Beispiel #1
0
        protected void Pay_Btn_Click(object sender, EventArgs e)
        {
            function.WriteErrMsg("提现功能暂未开放");
            double max = GetMaxMoney();

            if (max < 1)
            {
                function.WriteErrMsg("可提现余额不够"); return;
            }
            WxAPI     wxapi  = WxAPI.Code_Get();
            M_UserAPP appMod = appBll.SelReturnModel(mu.UserID);

            if (appMod == null || string.IsNullOrEmpty(appMod.OpenID))
            {
                function.WriteErrMsg("未绑定微信账号"); return;
            }
            CommonReturn ret = SendMoney(wxapi.AppId, appMod.OpenID, max, "余额提现");

            if (ret.isok)
            {
                buser.MinusVMoney(mu.UserID, max, M_UserExpHis.SType.Purse, "余额提现");
                function.WriteSuccessMsg("提现成功", "/User/");
            }
            else
            {
                function.WriteErrMsg("操作失败,原因:" + ret.err);
            }
            //var cert= HttpService.Cert_GetByName(wxapi.AppId.Pay_SSLPath);
            //CommonReturn ret = SendMoney(wxapi.AppId, "oGUkXxN83jNbKCbtrNFny5tqHtok", 1, "测试付款");
        }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         B_User.CheckIsLogged(Request.RawUrl);
         M_UserInfo mu    = buser.GetLogin();
         int        appid = DataConverter.CLng(Request.QueryString["appid"]);
         string     err   = "";
         if (!B_User.CheckUserStatus(mu, ref err))
         {
             function.WriteErrMsg(err);
         }
         uappMod = uappBll.SelModelByUid(mu.UserID, "wechat");
         if (uappMod != null)
         {
             function.WriteErrMsg("您已经绑定了微信公众号,不能重复绑定!");
         }
         else
         {
             if (appid > 0)
             {
                 bind_img.Src = "/Common/Common.ashx?url=" + HttpUtility.UrlEncode("http://www.zhichongw.com/wxpromo.aspx?bindid=" + mu.UserID + "&appid=" + appid);
             }
             else
             {
                 bind_img.Src = "/Common/Common.ashx?url=" + SiteConfig.SiteInfo.SiteUrl + "/wxpromo.aspx?bindid=" + mu.UserID;
             }
         }
     }
 }
Beispiel #3
0
    //支付成功时执行的操作
    private void PayOrder_Success(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();
            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 = 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);
                //发送微信消息
                B_UserAPP  userappBll = new B_UserAPP();
                M_UserAPP  userappMod = new M_UserAPP();
                M_UserInfo mu         = buser.GetUserByUserID(orderMod.Userid);
                userappMod = userappBll.SelModelByUid(mu.UserID, "wechat");
                if (userappMod != null)
                {
                    WxAPI  wxapi = WxAPI.Code_Get(1);
                    string json  = "{\"first\":{\"value\":\"您已成功支付" + orderMod.Ordersamount.ToString("0.00") + "元\",\"color\":\"#000\"},\"DateTime\":{\"value\":\"" + DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"PayAmount\":{\"value\":\"" + orderMod.Ordersamount.ToString("0.00") + "元\",\"color\":\"#173177\"},\"remark\":{\"value\":\"您的订单已成功付款!订单号:" + orderMod.OrderNo + "\",\"color\":\"#173177\"}}";
                    wxapi.Tlp_SendTlpMsg(userappMod.OpenID, "jAP4eGIOPvCdg33KBVDcClxRGYNNgcUpmHlVdO_FRV0", SiteConfig.SiteInfo.SiteUrl + "/User/Order/OrderProList?OrderNo=" + orderMod.OrderNo, json);
                }
            }
            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
            });
        }
    }
Beispiel #4
0
 public bool UpdateByID(M_UserAPP model)
 {
     if (string.IsNullOrEmpty(model.SourcePlat))
     {
         throw new Exception("未指定平台");
     }
     return(DBCenter.UpdateByID(model, model.ID));
 }
Beispiel #5
0
        public ActionResult RedPacket()
        {
            //用户必须关注公众号之后才可访问
            WxAPI.AutoSync(Request.RawUrl);
            M_UserAPP uaMod = uaBll.SelModelByUid(mu.UserID, "wechat");

            ViewBag.state = uaMod == null ? "0" : "1";
            return(View());
        }
Beispiel #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            M_UserInfo mu    = buser.GetLogin();
            int        appid = DataConverter.CLng(Request.QueryString["appid"]);

            if (mu != null && mu.UserID > 0)
            {
                try
                {
                    TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
                    timestr = Convert.ToInt64(ts.TotalSeconds).ToString();
                    if (appid == 0)
                    {
                        appid = 1;
                    }
                    WxAPI wxapi = WxAPI.Code_Get(appid);
                    appMod = appBll.SelReturnModel(appid);

                    uappMod  = uappBll.SelModelByUid(mu.UserID, "wechat");
                    wuserMod = wxapi.GetWxUserModel(uappMod.OpenID);

                    userface.Src  = wuserMod.HeadImgUrl;
                    userface.Alt  = wuserMod.Name;
                    NickName.Text = wuserMod.Name;

                    string  jsapi_ticket = APIHelper.GetWebResult("https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + wxapi.AccessToken + "&type=jsapi");
                    JObject jsapi_obj    = (JObject)JsonConvert.DeserializeObject(jsapi_ticket);
                    string  stringA      = "jsapi_ticket=" + jsapi_obj["ticket"].ToString() + "&noncestr=" + nonceStr + "&timestamp=" + timestr + "&url=" + Request.Url.AbsoluteUri;
                    paySign = EncryptHelper.SHA1(stringA).ToLower();

                    string jsapi_ticket1 = APIHelper.GetWebResult("https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + wxapi.AccessToken + "&type=jsapi", "POST", "{\"action_name\":\"QR_LIMIT_STR_SCENE\",\"action_info\":{\"scene\":{\"scene_str\":\"" + mu.UserID + "\"}}}");
                    if (jsapi_ticket1 != "")
                    {
                        JObject jsapi_obj1 = (JObject)JsonConvert.DeserializeObject(jsapi_ticket1);
                        Image1.ImageUrl = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" + jsapi_obj1["ticket"];
                    }
                }
                catch (Exception ex)
                {
                }
            }
            else
            {
                Response.Redirect("/wxpromo.aspx?r=/User");
            }
        }
    }
Beispiel #7
0
        /// <summary>
        /// 更新|新增openid与用户
        /// </summary>
        public M_UserAPP LinkToUser(string openid, string source, int uid)
        {
            M_UserAPP appMod = SelModelByUid(uid, source);

            if (appMod == null)
            {
                appMod        = new M_UserAPP();
                appMod.APPID  = "";
                appMod.OpenID = openid;
                appMod.UserID = uid;
                appMod.ID     = Insert(appMod);
            }
            else
            {
                appMod.OpenID = openid; UpdateByID(appMod);
            }
            return(appMod);
        }
Beispiel #8
0
    protected void GetHeadImg(M_UserInfo mu)
    {
        int appid = 1;

        if (AppID > 0)
        {
            appid = AppID;
        }
        WxAPI wxapi = WxAPI.Code_Get(appid);

        if (mu == null || mu.IsNull || mu.UserID < 1)
        {
        }
        else
        {
            uappMod = uappBll.SelModelByUid(mu.UserID, "wechat");
            M_WX_User wuserMod = new M_WX_User();
            if (uappMod != null)
            {
                try
                {
                    wuserMod = wxapi.GetWxUserModel(uappMod.OpenID);
                    if (string.IsNullOrEmpty(wuserMod.Name))
                    {
                        wxapi.GetToken();
                        wuserMod = wxapi.GetWxUserModel(uappMod.OpenID);
                    }
                }
                catch (Exception ex)
                {
                    wxapi.GetToken();
                    wuserMod = wxapi.GetWxUserModel(uappMod.OpenID);
                    throw ex;
                }
                if (wuserMod != null)
                {
                    Response.Write("{\"nickname\":\"" + wuserMod.Name + "\",\"headimgurl\":\"" + wuserMod.HeadImgUrl + "\"}");
                }
            }
        }
    }
Beispiel #9
0
        //https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=TICKET
        //或可直接使用返回的URL字段
        #endregion
        /// <summary>
        /// 用户是否绑定微信并关注你的公众号
        /// </summary>
        /// <returns></returns>
        public bool IsFollow(int uid)
        {
            B_UserAPP appBll = new B_UserAPP();
            M_UserAPP appMod = appBll.SelModelByUid(uid, "wechat");

            if (appMod == null || string.IsNullOrEmpty(appMod.OpenID))
            {
                return(false);
            }
            string  result = APIHelper.GetWebResult(apiurl + "user/info?access_token=" + AccessToken + "&openid=" + appMod.OpenID);
            JObject jobj   = JsonConvert.DeserializeObject <JObject>(result);

            if (jobj["subscribe"] != null && jobj["subscribe"].ToString() == "1")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #10
0
    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  = "";
            M_UserAPP  uappMod = new M_UserAPP();
            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); }
    }
Beispiel #11
0
    /// <summary>
    /// 系统事件,如订阅等处理
    /// </summary>
    public void WxEventHandler(M_WxTextMsg reqMod)
    {
        M_WX_User userMod = null;

        errmsg += ",事件:" + reqMod.Event;
        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_", ""));
            M_UserAPP uappMod1 = new M_UserAPP();

            M_UserInfo mu1      = new M_UserInfo();
            M_WX_User  wuserMod = new M_WX_User();
            M_Uinfo    mubase   = new M_Uinfo();
            uappMod1 = uappBll.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;
                    try
                    {
                        string vpath = SiteConfig.SiteOption.UploadDir + "User/" + mu1.UserName + mu1.UserID + "/wxheadimg.jpg";
                        HttpHelper.DownFile(wuserMod.HeadImgUrl, vpath);
                        mu1.UserFace = vpath;
                    }
                    catch (Exception ex)
                    {
                        ZLLog.L("微信更新头像错误,原因:" + ex.Message);
                    }

                    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;
                    try
                    {
                        string vpath = SiteConfig.SiteOption.UploadDir + "User/" + mu1.UserName + mu1.UserID + "/wxheadimg.jpg";
                        HttpHelper.DownFile(wuserMod.HeadImgUrl, vpath);
                        mu1.UserFace = vpath;
                    }
                    catch (Exception ex)
                    {
                        ZLLog.L("微信更新头像错误,原因:" + ex.Message);
                    }

                    mu1.UserID = buser.Add(mu1);

                    uappMod1.UserID     = mu1.UserID;
                    uappMod1.SourcePlat = "wechat";
                    uappMod1.OpenID     = reqMod.FromUserName;
                    uappBll.UpdateByID(uappMod1);
                    mubase.UserId = mu1.UserID;
                    buser.AddBase(mubase);
                }
            }
            else
            {
                uappMod1     = new M_UserAPP();
                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;
                try
                {
                    string vpath = SiteConfig.SiteOption.UploadDir + "User/" + mu1.UserName + mu1.UserID + "/wxheadimg.jpg";
                    HttpHelper.DownFile(wuserMod.HeadImgUrl, vpath);
                    mu1.UserFace = vpath;
                }
                catch (Exception ex)
                {
                    ZLLog.L("微信更新头像错误,原因:" + ex.Message);
                }

                mu1.UserID = buser.Add(mu1);

                uappMod1.UserID     = mu1.UserID;
                uappMod1.SourcePlat = "wechat";
                uappMod1.OpenID     = reqMod.FromUserName;
                uappBll.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":    //用户进入公众号(包含定位信息)
            break;

        case "scan":
            M_UserAPP   uappMod   = new M_UserAPP();
            M_UserInfo  mu        = new M_UserInfo();
            M_WxTextMsg textMod2  = new M_WxTextMsg();
            M_WX_User   wuserMod1 = api.GetWxUserModel(reqMod.FromUserName);
            M_Uinfo     mubase1   = new M_Uinfo();

            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 = "";
                                try
                                {
                                    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;
                                    }
                                }
                                catch (Exception ex)
                                {
                                    textMod2.Content = "绑定推荐失败,错误信息:" + pmu.TrueName + "的推荐关系有循环!";
                                }
                            }
                            else
                            {
                                textMod2.Content = "绑定推荐失败,推荐人不存在!";
                            }
                        }
                        RepToClient(textMod2.ToXML());
                    }
                }
            }
            else
            {
                uappMod1    = new M_UserAPP();
                mu.UserName = "******" + DateTime.Now.ToString("yyyyMMddHHmmss") + function.GetRandomString(2).ToLower();
                mu.UserPwd  = StringHelper.MD5(function.GetRandomString(6));
                mu.Email    = function.GetRandomString(10) + "@wx.com";
                mu.Question = function.GetRandomString(5);
                mu.Answer   = function.GetRandomString(5);
                mu.TrueName = wuserMod1.Name;
                mu.GroupID  = 1;
                try
                {
                    string vpath = SiteConfig.SiteOption.UploadDir + "User/" + mu.UserName + mu.UserID + "/wxheadimg.jpg";
                    HttpHelper.DownFile(wuserMod1.HeadImgUrl, vpath);
                    mu.UserFace = vpath;
                }
                catch (Exception ex)
                {
                    ZLLog.L("微信更新头像错误,原因:" + ex.Message);
                }

                M_UserInfo pmu = buser.GetUserByUserID(DataConvert.CLng(reqMod.EventKey));
                if (pmu != null && pmu.UserID > 0)
                {
                    mu.ParentUserID = reqMod.EventKey;
                }
                mu.UserID = buser.Add(mu);

                uappMod1.UserID     = mu.UserID;
                uappMod1.SourcePlat = "wechat";
                uappMod1.OpenID     = reqMod.FromUserName;
                uappBll.Insert(uappMod1);
                mubase1.UserId = mu.UserID;
                buser.AddBase(mubase1);

                if (pmu != null && pmu.UserID > 0)
                {
                    textMod2.Content = "您成功绑定了推荐人:" + pmu.TrueName + "!";
                    RepToClient(textMod2.ToXML());
                }
            }
            break;

        default:
            break;
        }
    }
Beispiel #12
0
 public int Insert(M_UserAPP model)
 {
     return(DBCenter.Insert(model));
 }
Beispiel #13
0
    /// <summary>
    /// 系统事件,如订阅等处理
    /// </summary>
    public void WxEventHandler(M_WxTextMsg reqMod)
    {
        M_WX_User userMod = null;

        errmsg += ",事件:" + reqMod.Event;
        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 = new M_WxImgMsg();
            msgmod.ToUserName   = reqMod.FromUserName;
            msgmod.FromUserName = reqMod.ToUserName;

            M_WX_ReplyMsg rpMod1 = new M_WX_ReplyMsg();
            rpMod1 = rpBll.SelByFileAndDef(appBll.GetAppByWxNo(reqMod.ToUserName).ID, "头图");
            if (rpMod1 != null)
            {
                M_WXImgItem item = JsonConvert.DeserializeObject <M_WXImgItem>(rpMod1.Content);
                msgmod.Articles.Add(new M_WXImgItem()
                {
                    Title = item.Title, Url = item.Url, Description = item.Description, PicUrl = item.PicUrl
                });
            }
            rpMod1 = rpBll.SelByFileAndDef(appBll.GetAppByWxNo(reqMod.ToUserName).ID, "推送1");
            {
                M_WXImgItem item = JsonConvert.DeserializeObject <M_WXImgItem>(rpMod1.Content);
                msgmod.Articles.Add(new M_WXImgItem()
                {
                    Title = item.Title, Url = item.Url, Description = item.Description, PicUrl = item.PicUrl
                });
            }
            rpMod1 = rpBll.SelByFileAndDef(appBll.GetAppByWxNo(reqMod.ToUserName).ID, "推送2");
            {
                M_WXImgItem item = JsonConvert.DeserializeObject <M_WXImgItem>(rpMod1.Content);
                msgmod.Articles.Add(new M_WXImgItem()
                {
                    Title = item.Title, Url = item.Url, Description = item.Description, PicUrl = item.PicUrl
                });
            }
            rpMod1 = rpBll.SelByFileAndDef(appBll.GetAppByWxNo(reqMod.ToUserName).ID, "推送3");
            {
                M_WXImgItem item = JsonConvert.DeserializeObject <M_WXImgItem>(rpMod1.Content);
                msgmod.Articles.Add(new M_WXImgItem()
                {
                    Title = item.Title, Url = item.Url, Description = item.Description, PicUrl = item.PicUrl
                });
            }
            rpMod1 = rpBll.SelByFileAndDef(appBll.GetAppByWxNo(reqMod.ToUserName).ID, "推送4");
            {
                M_WXImgItem item = JsonConvert.DeserializeObject <M_WXImgItem>(rpMod1.Content);
                msgmod.Articles.Add(new M_WXImgItem()
                {
                    Title = item.Title, Url = item.Url, Description = item.Description, PicUrl = item.PicUrl
                });
            }
            rpMod1 = rpBll.SelByFileAndDef(appBll.GetAppByWxNo(reqMod.ToUserName).ID, "推送5");
            {
                M_WXImgItem item = JsonConvert.DeserializeObject <M_WXImgItem>(rpMod1.Content);
                msgmod.Articles.Add(new M_WXImgItem()
                {
                    Title = item.Title, Url = item.Url, Description = item.Description, PicUrl = item.PicUrl
                });
            }
            RepToClient(msgmod.ToXML());
            System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(SendMsg), reqMod);
            break;

        case "unsubscribe":
        {
            userMod = wxuserBll.SelForOpenid(reqMod.FromUserName);
            if (userMod != null)
            {
                wxuserBll.Del(userMod.ID);
            }
        }
        break;

        case "location":    //用户进入公众号(包含定位信息)
            break;

        case "scan":    //带参数的二维码扫描进入(关注事件在上方处理)
            M_UserAPP   uappMod  = new M_UserAPP();
            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;
        }
    }
Beispiel #14
0
        protected void RPT_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            WxAPI       wxapi    = WxAPI.Code_Get();
            int         oid      = DataConvert.CLng(e.CommandArgument);
            M_OrderList orderMod = orderBll.SelReturnModel(oid);
            M_UserAPP   appMod   = appBll.SelModelByUid(orderMod.Userid, "wechat");
            M_UserAPP   appMod2  = appBll.SelModelByUid(storeMod.UserID, "wechat");
            string      tlpid    = "dlAIEAkV0lgDfc7-RYsdLVFMyP9UF7gHi_9kjPblVAU";

            switch (e.CommandName)
            {
            case "return":    //确认归还
            {
                Unbrealla.FinalOrder(orderMod);
                if (appMod != null && !string.IsNullOrEmpty(appMod.OpenID))
                {
                    string json = "{\"first\": {\"value\":\"还伞成功通知\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + orderMod.OrderNo + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + orderMod.AddTime.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + orderMod.Ordersamount.ToString("0.00") + "元\",\"color\":\"#173177\"},\"remark\":{\"value\":\"您已还伞成功,如需继续借伞,请扫描借伞点二维码进行借伞!\",\"color\":\"#173177\"}}";
                    string r    = wxapi.Tlp_SendTlpMsg(appMod.OpenID, tlpid, ZoomLa.Components.SiteConfig.SiteInfo.SiteUrl + "/BU/UE/MyLend.aspx", json);
                }
                if (appMod2 != null && !string.IsNullOrEmpty(appMod2.OpenID))
                {
                    string json1 = "{\"first\": {\"value\":\"还伞成功通知\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + orderMod.OrderNo + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + orderMod.AddTime.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + orderMod.Ordersamount.ToString("0.00") + "元\",\"color\":\"#173177\"},\"remark\":{\"value\":\"用户已还伞成功!\",\"color\":\"#173177\"}}";
                    wxapi.Tlp_SendTlpMsg(appMod2.OpenID, tlpid, ZoomLa.Components.SiteConfig.SiteInfo.SiteUrl + "/Class_2/NodePage.aspx", json1);
                }

                //更新库存
                string    sql = "select * from ZL_Commodities where UserShopID=" + orderMod.StoreID;
                DataTable dt  = SqlHelper.ExecuteTable(CommandType.Text, sql);
                if (dt.Rows.Count > 0)
                {
                    M_Product proMod = proBll.GetproductByid(DataConvert.CLng(dt.Rows[0]["ID"]));
                    proMod.Stock = proMod.Stock + 1;
                    proBll.UpdateByID(proMod);
                }
            }
            break;

            case "cancel":    //取消归还
            {
                DBCenter.UpdateSQL(orderMod.TbName, "OrderStatus=0", "ID=" + oid + " AND OrderStatus=-1");
            }
            break;

            case "repair":    //坏伞回收
            {
                Unbrealla.FinalOrder(orderMod);
                string json = "{\"first\": {\"value\":\"还伞成功通知\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + orderMod.OrderNo + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + orderMod.AddTime.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + orderMod.Ordersamount.ToString("0.00") + "元\",\"color\":\"#173177\"},\"remark\":{\"value\":\"您已还伞成功,如需继续借伞,请扫描借伞点二维码进行借伞!\",\"color\":\"#173177\"}}";
                Unbrealla.SendWXNotify(appMod, tlpid, "/BU/UE/MyLend.aspx", json);
                json = "{\"first\": {\"value\":\"还伞成功通知\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + orderMod.OrderNo + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + orderMod.AddTime.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + orderMod.Ordersamount.ToString("0.00") + "元\",\"color\":\"#173177\"},\"remark\":{\"value\":\"用户已还伞成功,请等待公司工作人员收取坏伞!\",\"color\":\"#173177\"}}";
                Unbrealla.SendWXNotify(appMod2, tlpid, "/Class_2/NodePage.aspx", json);
            }
            break;

            case "cancel_repair":    //取消报修申请,返还余额
            {
                double money = orderMod.Specifiedprice;
                orderMod.IsCount         = false;
                orderMod.Internalrecords = "";
                orderMod.Specifiedprice  = 0;
                orderMod.OrderStatus     = 0;
                orderBll.UpdateByID(orderMod);
                buser.AddMoney(orderMod.Userid, money, M_UserExpHis.SType.Purse, "取消报修,返还预扣余额[" + orderMod.id + "]");
            }
            break;
            }
            MyBind();
        }
Beispiel #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B_User.CheckIsLogged(Request.RawUrl);
            if (!IsPostBack)
            {
                int         num      = 1;
                M_OrderList orderMod = orderBll.SelReturnModel(Oid);
                M_UserInfo  frommu   = buser.SelReturnModel(orderMod.Userid);
                M_UserInfo  mu       = buser.GetLogin(false);
                //检测订单是否可借
                if (orderMod == null)
                {
                    HttpContext.Current.Response.Write("<script>alert('订单不存在')</script>");
                }
                if (orderMod.Ordertype != (int)M_OrderList.OrderEnum.Fast)
                {
                    HttpContext.Current.Response.Write("<script>alert('订单不可操作')</script>");
                }
                if (orderMod.OrderStatus != 0)
                {
                    HttpContext.Current.Response.Write("<script>alert('订单状态不正确')</script>");
                }
                if (mu.UserID == orderMod.Userid)
                {
                    HttpContext.Current.Response.Write("<script>alert('不可转借给本人')</script>");
                }


                //=================================检测是否符合条件
                double money = Unbrealla.T_CheckForegift(mu, num);
                //---------需要充值押金
                string json = JsonHelper.GetJson("oid,action".Split(','),
                                                 (orderMod.id + ",ue_lenttouser").Split(','));
                if (money > 0)
                {
                    M_OrderList foreMod = Unbrealla.H_NewFGOrder(mu, money);
                    foreMod.StoreID = orderMod.StoreID;
                    M_Payment forePay = Unbrealla.H_NewFGPayment(foreMod);
                    forePay.SysRemark = json;
                    orderBll.insert(foreMod);
                    payBll.Add(forePay);
                    Response.Redirect("/PayOnline/wxpay_mp.aspx?payno=" + forePay.PayNo); return;
                }
                //---------余额必须为正数,否则必须充值
                if (mu.Purse <= 0)
                {
                    //9,19,50,100
                    M_OrderList chargeMod = orderBll.NewOrder(mu, M_OrderList.OrderEnum.Purse);
                    chargeMod.Ordersamount = 9;
                    chargeMod.StoreID      = orderMod.StoreID;
                    M_Payment payMod = payBll.CreateByOrder(chargeMod);
                    payMod.SysRemark = json;
                    payMod.Remark   += "充值" + chargeMod.Ordersamount.ToString("F2") + "元";
                    orderBll.insert(chargeMod);
                    payMod.PaymentID = payBll.Add(payMod);
                    Response.Redirect("/PayOnline/wxpay_mp.aspx?payno=" + payMod.PayNo); return;
                }
                //=================================

                //终止上一份订单,并生成新的转借订单
                orderMod.Ordermessage = "转借";
                Unbrealla.FinalOrder(orderMod);
                //创建新的订单
                M_OrderList newMod = orderBll.NewOrder(mu, M_OrderList.OrderEnum.Fast);
                newMod.Balance_remark = orderMod.Balance_remark;
                newMod.Promoter       = frommu.UserID;
                newMod.StoreID        = orderMod.StoreID;
                newMod.Extend         = DateTime.Now.ToString();
                newMod.id             = orderBll.insert(newMod);

                //新用户
                mu = buser.GetLogin(false);
                if (mu.PageID == 0)
                {
                    buser.AddMoney(orderMod.Userid, 5, M_UserExpHis.SType.Purse, "新用户转借奖励,订单[" + newMod.id + "]");
                    mu.PageID = 1;
                    buser.UpdateByID(mu);
                    WxAPI     wxapi  = WxAPI.Code_Get();
                    M_UserAPP appMod = appBll.SelModelByUid(orderMod.Userid, "wechat");
                    if (appMod != null && !string.IsNullOrEmpty(appMod.OpenID))
                    {
                        string tlp1 = "{\"first\": {\"value\":\"奖励到帐提醒\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + orderMod.OrderNo + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + orderMod.Ordersamount.ToString("0.00") + "元\",\"color\":\"#173177\"},\"remark\":{\"value\":\"转借5元奖励已到账,该奖励可提现,请注意查收账户内余额\",\"color\":\"#173177\"}}";
                        wxapi.Tlp_SendTlpMsg(appMod.OpenID, "dlAIEAkV0lgDfc7-RYsdLVFMyP9UF7gHi_9kjPblVAU", ZoomLa.Components.SiteConfig.SiteInfo.SiteUrl + "/BU/UE/MyLend.aspx", tlp1);
                    }
                }
                HttpContext.Current.Response.Write("<script>alert('操作成功')</script>");
                Response.Redirect("/BU/UE/MyLend.aspx");
            }
        }
Beispiel #16
0
    //进入该页即开始推广,自动创建用户,关联APPID
    protected void Page_Load(object sender, EventArgs e)
    {
        int AppID = DataConverter.CLng(Request.QueryString["appid"]);

        B_UserAPP appBll = new B_UserAPP();
        int       puid   = DataConverter.CLng(Session["WX_PUserID"]);
        string    rurl   = DataConvert.CStr(Session["WX_R"]);

        //if (puid < 1) { function.WriteErrMsg("推荐用户不存在"); }
        M_WX_APPID appMod = new M_WX_APPID();//自行置入缓存,使用时取出

        appMod = WxPayApi.Pay_GetByID(AppID);

        if (string.IsNullOrEmpty(rurl))
        {
            string url = HttpUtility.UrlEncode(SiteConfig.SiteInfo.SiteUrl + "/User/");
            rurl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appMod.APPID + "&redirect_uri=" + url + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
        }

        string     code         = Request["code"];
        string     access_token = APIHelper.GetWebResult("https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + appMod.APPID + "&secret=" + appMod.Secret + "&code=" + code + "&grant_type=authorization_code");
        JObject    obj          = (JObject)JsonConvert.DeserializeObject(access_token);
        JObject    userobj      = (JObject)JsonConvert.DeserializeObject(APIHelper.GetWebResult("https://api.weixin.qq.com/sns/userinfo?access_token=" + obj["access_token"] + "&openid=" + obj["openid"] + "&lang=zh_CN"));
        string     openID       = obj["openid"].ToString();
        M_UserAPP  umod         = appBll.SelModelByOpenID(openID, "wechat");
        M_UserInfo mu           = new M_UserInfo();

        if (umod != null)
        {
            mu = buser.SelReturnModel(umod.UserID);
            buser.SetLoginState(mu);
            try
            {
                string vpath = SiteConfig.SiteOption.UploadDir + "User/" + mu.UserName + "/wxheadimg.jpg";
                HttpHelper.DownFile(userobj["headimgurl"].ToString(), vpath);
                mu.UserFace = vpath;
                buser.UpdateByID(mu);
            }
            catch (Exception ex)
            {
            }
            if (puid > 0 && DataConvert.CLng(mu.ParentUserID) <= 0)
            {
                if (puid == mu.UserID)
                {
                    function.WriteErrMsg("不能绑定自己!");
                }
                else
                {
                    string err = "";
                    if (CheckParentUser(puid, mu.UserID, ref err))
                    {
                        mu.ParentUserID = puid.ToString();
                        buser.UpdateByID(mu);
                    }
                    else
                    {
                        function.WriteErrMsg("绑定失败,错误信息:" + err);
                    }
                }
            }
            Response.Redirect(rurl);
        }
        else //新用户则注册
        {
            umod            = new M_UserAPP();
            mu.UserName     = "******" + DateTime.Now.ToString("yyyyMMddHHmmss") + function.GetRandomString(2).ToLower();
            mu.UserPwd      = StringHelper.MD5(function.GetRandomString(6));
            mu.Email        = function.GetRandomString(10) + "@wx.com";
            mu.Question     = function.GetRandomString(5);
            mu.Answer       = function.GetRandomString(5);
            mu.ParentUserID = puid.ToString();
            mu.TrueName     = userobj["nickname"].ToString();
            try
            {
                string vpath = SiteConfig.SiteOption.UploadDir + "User/" + mu.UserName + "/wxheadimg.jpg";
                HttpHelper.DownFile(userobj["headimgurl"].ToString(), vpath);
                mu.UserFace = vpath;
            }
            catch (Exception ex)
            {
            }
            mu.GroupID = 1;
            mu.UserID  = buser.Add(mu);

            umod.UserID     = mu.UserID;
            umod.SourcePlat = "wechat";
            umod.OpenID     = openID;
            appBll.Insert(umod);
            M_Uinfo mubase = new M_Uinfo();
            mubase.UserId = mu.UserID;
            buser.AddBase(mubase);
            //推广人得积分
            if (puid > 0)
            {
                M_UserInfo pmu = buser.SelReturnModel(puid);
                if (!pmu.IsNull)
                {
                    buser.ChangeVirtualMoney(pmu.UserID, new M_UserExpHis()
                    {
                        score     = 20,
                        ScoreType = (int)M_UserExpHis.SType.Point,
                        detail    = "新用户[" + mu.UserName + "]注册,获得推广积分:" + 20
                    });
                }
            }
            buser.SetLoginState(mu);
            Response.Redirect(rurl);
        }
    }
Beispiel #17
0
        public ActionResult GetRedPacket()
        {
            ViewBag.state = "2";
            ViewBag.err   = "";
            string flow    = Request["flow"];
            string redcode = Request["redcode"];
            string rurl    = Request["rurl"];//成功后的返回页
            //红包相关检测
            M_WX_RedDetail detMod = new M_WX_RedDetail();

            try
            {
                detMod = detBll.SelModelByCode(redcode);
                M_UserAPP uaMod = uaBll.SelModelByUid(mu.UserID, "wechat");
                if (detMod == null)
                {
                    ViewBag.err = "红包不存在";
                }
                else if (detMod.ZStatus != 1)
                {
                    ViewBag.err = "该红包已经被使用";
                }
                else if (detMod.Amount < 1 || detMod.Amount > 200)
                {
                    ViewBag.err = "红包金额不正确";
                }
                if (!string.IsNullOrEmpty(ViewBag.err))
                {
                    return(View("RedPacket"));
                }
                M_WX_RedPacket redMod = redBll.SelReturnModel(detMod.MainID);
                if (!redMod.Flow.Equals(flow))
                {
                    ViewBag.err = "匹配码不正确";
                }
                else if (redMod.SDate > DateTime.Now)
                {
                    ViewBag.err = "活动尚未开始";
                }
                else if (redMod.EDate < DateTime.Now)
                {
                    ViewBag.err = "活动已经结束";
                }
                if (!string.IsNullOrEmpty(ViewBag.err))
                {
                    return(View("RedPacket"));
                }
                WxAPI api = WxAPI.Code_Get(redMod.AppID);
                WxAPI.AutoSync(Request.RawUrl, api.AppId);
                if (mu.IsNull)
                {
                    ViewBag.err = "用户不存在";
                }
                if (uaMod == null)
                {
                    ViewBag.err = "用户信息不存在";
                }
                if (!string.IsNullOrEmpty(ViewBag.err))
                {
                    return(View("RedPacket"));
                }
                //-------------------
                string apiUrl = "https://api.mch.weixin.qq.com/mmpaymkttransfers/sendredpack";
                //生成提交参数
                WxPayData wxdata = new WxPayData();
                wxdata.SetValue("nonce_str", WxAPI.nonce);
                wxdata.SetValue("mch_billno", api.AppId.Pay_AccountID + DateTime.Now.ToString("yyyyMMdd") + function.GetRandomString(10, 2));
                wxdata.SetValue("mch_id", api.AppId.Pay_AccountID);
                wxdata.SetValue("wxappid", api.AppId.APPID);
                wxdata.SetValue("send_name", SiteConfig.SiteInfo.SiteName);
                //接受红包的用户用户在wxappid下的openid
                wxdata.SetValue("re_openid", uaMod.OpenID);//oDTTbwLa7WuySP0WcJJzYJmErCQ4
                wxdata.SetValue("total_amount", (int)(detMod.Amount * 100));
                wxdata.SetValue("total_num", 1);
                wxdata.SetValue("wishing", redMod.Wishing);   //红包祝福语
                wxdata.SetValue("client_ip", "58.215.75.11"); //调用接口的机器IP地址
                wxdata.SetValue("act_name", redMod.Name);     //活动名称
                wxdata.SetValue("remark", redMod.Remind);
                wxdata.SetValue("sign", wxdata.MakeSign());
                //随机码,签名
                string xml      = wxdata.ToXml();
                string response = HttpService.Post(xml, apiUrl, true, 60, api.AppId);
                //------------------------发放完成(不论成功失败均算已领取,记录好返回)
                detMod.UserID   = mu.UserID;
                detMod.UserName = mu.UserName;
                detMod.UseTime  = DateTime.Now.ToString();
                //WxPayData result = new WxPayData(api.AppId.Pay_Key);
                //result.FromXml(response);
                //if (result.GetValue("return_code").ToString().Equals("SUCCESS"))//return_msg
                //{
                //    detMod.ZStatus = 99;
                //}
                //else
                //{
                //    detMod.ZStatus = -1;
                //    detMod.Remind = response;
                //}
                detMod.ZStatus = 99; detMod.Remind = response;
                detBll.UpdateByID(detMod);
                ViewBag.state  = "3";
                ViewBag.amount = detMod.Amount.ToString("f2");
                return(View("RedPacket"));
            }
            catch (Exception ex)
            {
                ZLLog.L(ZLEnum.Log.pay, "微信红包异常,领取码:" + redcode + ",原因:" + ex.Message);
                ViewBag.state = "3";
                ViewBag.err   = ex.Message;
                //如异常,该红包禁用,等待管理员审核
                detMod.ZStatus = -1;
                detMod.Remind  = ex.Message;
                detBll.UpdateByID(detMod);
                return(View("RedPacket"));
            }
        }