示例#1
0
        protected void btnSerImg_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["SerUserID"] != null)
            {
                int SerUserID = Convert.ToInt32(Request.QueryString["SerUserID"]);
                ZhongLi.Model.ServerUser user = bll.GetModel(SerUserID);
                user.Flag = 2;
                bll.Update(user);
                //添加消息表
                ZhongLi.Model.ServerUser_Message msg = new ZhongLi.Model.ServerUser_Message();
                msg.MesCon    = "您的身份认证通过啦";
                msg.SendTime  = DateTime.Now;
                msg.SerUserID = SerUserID;
                msg.MesType   = 0;
                new ZhongLi.BLL.ServerUser_Message().Add(msg);
                //推送通知
                JPushApiExample.ALERT       = "您的身份认证通过啦";
                JPushApiExample.MSG_CONTENT = "您的身份认证通过啦";
                PushPayload pushsms = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras("s" + SerUserID, "SerAuto");
                JPushApiExample.push(pushsms);

                webHelper.addLog("通过了职业介绍人“" + user.RealName + "”的职能身份认证");
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('职业介绍人职业身份认证','认证成功!','Auth.aspx?SerUserID=" + user.SerUserID + "',1)</script>");
            }
        }
示例#2
0
 protected void btnsave_Click(object sender, EventArgs e)
 {
     if (Request.QueryString["OrderID"] != null)
     {
         int        OrderID     = Convert.ToInt32(Request.QueryString["OrderID"]);
         DataTable  perdt       = bll.getPerByOrderID(OrderID);
         int        PerID       = Convert.ToInt32(perdt.Rows[0]["PerID"]);
         string     RealName    = perdt.Rows[0]["RealName"].ToString();
         int        SerUserID   = Convert.ToInt32(perdt.Rows[0]["SerUserID"]);
         decimal    RewardMoney = Convert.ToDecimal(perdt.Rows[0]["RewardMoney"]);
         siteconfig site        = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
         if (bll.PassAuth(OrderID, PerID, SerUserID, RewardMoney, site.Commission))
         {
             DateTime time = DateTime.Now;
             //添加消息表
             ZhongLi.Model.Person_Message msg = new ZhongLi.Model.Person_Message();
             msg.MesCon   = "您的悬赏订单审核通过啦,恭喜您成功入职!";
             msg.SendTime = time;
             msg.PerID    = PerID;
             msg.MesType  = 0;
             new ZhongLi.BLL.Person_Message().Add(msg);
             ZhongLi.Model.ServerUser_Message sermsg = new ZhongLi.Model.ServerUser_Message();
             sermsg.MesCon    = "您的订单审核通过啦,您已获得悬赏佣金,赶紧去钱包查看吧!";
             sermsg.SendTime  = time;
             sermsg.SerUserID = SerUserID;
             sermsg.MesType   = 0;
             new ZhongLi.BLL.ServerUser_Message().Add(sermsg);
             //推送通知
             //求职者
             JPushApiExample.ALERT       = "您的悬赏订单审核通过啦,恭喜您成功入职!";
             JPushApiExample.MSG_CONTENT = "您的悬赏订单审核通过啦,恭喜您成功入职!";
             PushPayload pushsms = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras("p" + PerID, "OrderAuth");
             JPushApiExample.push(pushsms);
             //人才经纪人
             JPushApiExample.ALERT       = "您的订单审核通过啦,您已获得悬赏佣金,赶紧去钱包查看吧!";
             JPushApiExample.MSG_CONTENT = "您的订单审核通过啦,您已获得悬赏佣金,赶紧去钱包查看吧!";
             PushPayload pushsms1 = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras("s" + SerUserID, "OrderAuth");
             JPushApiExample.push(pushsms1);
             webHelper.addLog("通过了“" + RealName + "”的入职资料审核");
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('入职协议审核','审核成功!','Auth.aspx?OrderID=" + OrderID + "',1)</script>");
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('入职协议审核','审核失败!','Auth.aspx?OrderID=" + OrderID + "',1)</script>");
         }
     }
 }
示例#3
0
        protected void btnPerbh_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["OrderID"] != null)
            {
                int       OrderID   = Convert.ToInt32(Request.QueryString["OrderID"]);
                DataTable perdt     = bll.getPerByOrderID(OrderID);
                int       PerID     = Convert.ToInt32(perdt.Rows[0]["PerID"]);
                string    RealName  = perdt.Rows[0]["RealName"].ToString();
                int       SerUserID = Convert.ToInt32(perdt.Rows[0]["SerUserID"]);
                if (bll.editOrderState(OrderID, 7))
                {
                    DateTime time = DateTime.Now;
                    //添加消息表
                    ZhongLi.Model.Person_Message msg = new ZhongLi.Model.Person_Message();
                    msg.MesCon   = "您的悬赏订单没有通过审核,快去检查入职协议并重新上传资料吧";
                    msg.SendTime = time;
                    msg.PerID    = PerID;
                    msg.MesType  = 0;
                    new ZhongLi.BLL.Person_Message().Add(msg);
                    //添加消息表
                    ZhongLi.Model.ServerUser_Message sermsg = new ZhongLi.Model.ServerUser_Message();
                    sermsg.MesCon    = "您的悬赏订单没有通过审核,快去检查入职协议并重新上传资料吧";
                    sermsg.SendTime  = time;
                    sermsg.SerUserID = PerID;
                    sermsg.MesType   = 0;
                    new ZhongLi.BLL.ServerUser_Message().Add(sermsg);
                    //推送通知

                    JPushApiExample.ALERT       = "您的订单没有通过审核,去检查一下您入职协议中的认证资料吧";
                    JPushApiExample.MSG_CONTENT = "您的订单没有通过审核,去检查一下您入职协议中的认证资料吧";
                    PushPayload pushsms = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras("p" + PerID, "OrderAuth");
                    JPushApiExample.push(pushsms);

                    JPushApiExample.ALERT       = "您的订单没有通过审核,去检查一下入职协议吧";
                    JPushApiExample.MSG_CONTENT = "您的订单没有通过审核,去检查一下入职协议吧";
                    PushPayload pushsms1 = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras("s" + SerUserID, "OrderAuth");
                    JPushApiExample.push(pushsms1);
                    webHelper.addLog("不通过“" + RealName + "”的悬赏订单审核");
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('入职协议审核','审核成功!','Auth.aspx?OrderID=" + OrderID + "',1)</script>");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('入职协议审核','审核失败!','Auth.aspx?OrderID=" + OrderID + "',1)</script>");
                }
            }
        }
示例#4
0
 void aTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     if (DateTime.Now.Hour == 11 || DateTime.Now.Hour == 12)
     {
         try
         {
             ZhongLi.BLL.Reward_Order bll = new ZhongLi.BLL.Reward_Order();
             int OrderCanceTime           = bll.getOrderCanceDay();//订单过期天数
             //已经过期的订单数据
             DataTable IsOverDt = bll.getOrderOverTime();
             //给已过期的订单的用户发送推送
             foreach (DataRow dr in IsOverDt.Rows)
             {
                 JPushApiExample.ALERT       = "您有悬赏订单已过期,快去延期吧~";
                 JPushApiExample.MSG_CONTENT = "您有悬赏订单已过期,快去延期吧~";
                 PushPayload pushsms1 = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras("p" + dr["PerID"], "Order");
                 JPushApiExample.push(pushsms1);
             }
             //过期订单还没有修改状态的订单
             DataTable OverDt = bll.getOrderOverTime(OrderCanceTime);
             if (OverDt.Rows.Count > 0)
             {
                 if (bll.setOrderOverTime(OverDt, OrderCanceTime))
                 {
                     foreach (DataRow dr in OverDt.Rows)
                     {
                         JPushApiExample.ALERT       = "您有悬赏订单已过期,快去延期吧~";
                         JPushApiExample.MSG_CONTENT = "您有悬赏订单已过期,快去延期吧~";
                         PushPayload pushsms1 = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras("p" + dr["PerID"], "Order");
                         JPushApiExample.push(pushsms1);
                     }
                 }
             }
         }
         catch (Exception ex)
         {
         }
     }
 }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SortedDictionary <string, string> sPara = GetRequestPost();

            WxLogger("进入回调");
            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify    = new Notify();
                bool   verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]);

                if (verifyResult)//验证成功
                {
                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    //请在这里加上商户的业务逻辑程序代码
                    try
                    {
                        WxLogger("验证成功");
                        //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                        //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                        //批量付款数据中转账成功的详细信息
                        // 1.修改批次支付状态 2.修改每个提现的状态 3提现成功需要减掉余额并添加交易记录  推送消息提醒
                        ZhongLi.BLL.PresentApplication bll = new ZhongLi.BLL.PresentApplication();
                        string batch_no = Request.Form["batch_no"];
                        WxLogger("批次号:" + batch_no);
                        if (bll.IsBatch(batch_no))
                        {
                            List <CommandInfo> list            = new List <CommandInfo>();
                            string             success_details = Request.Form["success_details"];

                            string SucPreNums = "";//支付成功流水号集合


                            //修改批次状态
                            CommandInfo cmd1 = new CommandInfo();
                            cmd1.CommandText = "update PresentApplication_Batch set BatchState=1 where Batch_No=@Batch_No";
                            SqlParameter[] para1 = { new SqlParameter("@Batch_No", batch_no) };
                            cmd1.Parameters = para1;
                            list.Add(cmd1);
                            if (!string.IsNullOrWhiteSpace(success_details))
                            {
                                string[] suc = success_details.Split('|');
                                WxLogger("获取成功的success_details:" + success_details);
                                foreach (string sucdetail in suc)
                                {
                                    string[] sucdetals = sucdetail.Split('^');
                                    SucPreNums += "'" + sucdetals[0] + "'" + ",";
                                }
                            }
                            //批量付款数据中转账失败的详细信息
                            string fail_details = Request.Form["fail_details"];
                            WxLogger("获取失败的success_details:" + fail_details);
                            string FailPreNum = "";//支付失败流水号集合
                            if (!string.IsNullOrWhiteSpace(fail_details))
                            {
                                string[] fail = fail_details.Split('|');
                                foreach (string faildetail in fail)
                                {
                                    string[] f = faildetail.Split('^');
                                    FailPreNum += "'" + f[0] + "'" + ",";
                                }
                            }
                            DataTable SusUserdt  = null;
                            DataTable FailUserdt = null;
                            if (SucPreNums != "")
                            {
                                SucPreNums = SucPreNums.TrimEnd(',');
                                //修改所有成功的提现的状态
                                CommandInfo cmd2 = new CommandInfo();
                                cmd2.CommandText = "update PresentApplication set State=2 where PreNum in (" + SucPreNums + ")";
                                list.Add(cmd2);
                                SusUserdt = bll.getUserByPreNum(SucPreNums);
                                //循环所有用户  修改余额和添加交易记录
                                foreach (DataRow dr in SusUserdt.Rows)
                                {
                                    if (dr["UserType"].ToString() == "0")//用户类型为人才
                                    {
                                        //CommandInfo blacmd = new CommandInfo();//修改余额
                                        //blacmd.CommandText = "update Person set Balance-=(select Money from PresentApplication where ID =" + dr["ID"] + ") where PerID=" + dr["UserID"];
                                        //list.Add(blacmd);
                                        CommandInfo reccmd = new CommandInfo();//添加交易记录
                                        reccmd.CommandText = "insert into TransactionRecord(UserID,RecordType,Money,RecordTime,UserType,RealName) values(" + dr["UserID"] + ",'提现(支付宝)'," + dr["Money"] + ",getdate(),0,'')";
                                        list.Add(reccmd);
                                        CommandInfo msgcmd = new CommandInfo();//添加消息提醒
                                        msgcmd.CommandText = "insert into Person_Message (PerID,MesType,SendTime,MesCon)values(" + dr["UserID"] + ",1,getdate(),'您的提现申请已经支付啦,提现资金将会在5-10分钟内到帐')";
                                        list.Add(msgcmd);
                                    }
                                    else//类型为人才经纪人
                                    {
                                        CommandInfo blacmd = new CommandInfo();//修改余额
                                        blacmd.CommandText = "update ServerUser set Balance-=(select Money from PresentApplication where ID =" + dr["ID"] + ") where SerUserID=" + dr["UserID"];
                                        list.Add(blacmd);
                                        CommandInfo reccmd = new CommandInfo();//添加交易记录
                                        reccmd.CommandText = "insert into TransactionRecord(UserID,RecordType,Money,RecordTime,UserType,RealName) values(" + dr["UserID"] + ",'提现(支付宝)'," + dr["Money"] + ",getdate(),1,'')";
                                        list.Add(reccmd);
                                        CommandInfo msgcmd = new CommandInfo();//添加消息提醒
                                        msgcmd.CommandText = "insert into ServerUser_Message (SerUserID,MesType,SendTime,MesCon)values(" + dr["UserID"] + ",1,getdate(),'您的提现申请已经支付啦,提现资金将会在5-10分钟内到帐')";
                                        list.Add(msgcmd);
                                    }
                                }
                            }
                            if (FailPreNum != "")
                            {
                                FailPreNum = FailPreNum.TrimEnd(',');
                                CommandInfo cmd3 = new CommandInfo();
                                cmd3.CommandText = "update PresentApplication set State=3 where PreNum in (" + FailPreNum + ")";
                                list.Add(cmd3);
                                FailUserdt = bll.getUserByPreNum(FailPreNum);
                                foreach (DataRow dr in FailUserdt.Rows)
                                {
                                    if (dr["UserType"].ToString() == "0")       //用户类型为人才
                                    {
                                        CommandInfo msgcmd = new CommandInfo(); //添加消息提醒
                                        msgcmd.CommandText = "insert into Person_Message (PerID,MesType,SendTime,MesCon)values(" + dr["UserID"] + ",1,getdate(),'您的提现申请支付失败了,资金已退回到您的钱包,请检查您提现时填写的账号资料是否正确')";
                                        list.Add(msgcmd);
                                        CommandInfo blacmd = new CommandInfo();
                                        blacmd.CommandText = "update Person set Balance+=" + dr["Money"] + " where PerID=" + dr["UserID"];
                                        list.Add(blacmd);
                                        //CommandInfo reccmd = new CommandInfo();//添加交易记录
                                        //reccmd.CommandText = "insert into TransactionRecord(UserID,RecordType,Money,RecordTime,UserType,RealName) values(" + dr["UserID"] + ",'提现失败退款'," + dr["Money"] + ",getdate(),0,'')";
                                        //list.Add(reccmd);
                                    }
                                    else
                                    {
                                        CommandInfo msgcmd = new CommandInfo();//添加消息提醒
                                        msgcmd.CommandText = "insert into ServerUser_Message (SerUserID,MesType,SendTime,MesCon)values(" + dr["UserID"] + ",1,getdate(),'您的提现申请支付失败了,资金已退回到您的钱包,请检查您提现时填写的账号资料是否正确')";
                                        list.Add(msgcmd);
                                        CommandInfo blacmd = new CommandInfo();
                                        blacmd.CommandText = "update ServerUser set Balance+=" + dr["Money"] + " where SerUserID=" + dr["UserID"];
                                        list.Add(blacmd);
                                        //CommandInfo reccmd = new CommandInfo();//添加交易记录
                                        //reccmd.CommandText = "insert into TransactionRecord(UserID,RecordType,Money,RecordTime,UserType,RealName) values(" + dr["UserID"] + ",'提现失败退款'," + dr["Money"] + ",getdate(),1,'')";
                                        //list.Add(reccmd);
                                    }
                                }
                            }
                            if (bll.exPreTran(list))//事物执行成功则发送推送
                            {
                                WxLogger("事务执行成功");
                                if (SusUserdt != null)
                                {
                                    foreach (DataRow dr in SusUserdt.Rows)
                                    {
                                        //推送通知
                                        string UserID = "";
                                        if (dr["UserType"].ToString() == "0")//用户类型为人才
                                        {
                                            UserID = "p" + dr["UserID"];
                                        }
                                        else
                                        {
                                            UserID = "s" + dr["UserID"];
                                        }
                                        JPushApiExample.ALERT       = "您的提现申请已经支付啦,提现资金将会在5-10分钟内到帐";
                                        JPushApiExample.MSG_CONTENT = "您的提现申请已经支付啦,提现资金将会在5-10分钟内到帐";
                                        PushPayload pushsms = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras(UserID, "Present");
                                        JPushApiExample.push(pushsms);
                                    }
                                }
                                if (FailUserdt != null)
                                {
                                    foreach (DataRow dr in FailUserdt.Rows)
                                    {
                                        //推送通知
                                        string UserID = "";
                                        if (dr["UserType"].ToString() == "0")//用户类型为人才
                                        {
                                            UserID = "p" + dr["UserID"];
                                        }
                                        else
                                        {
                                            UserID = "s" + dr["UserID"];
                                        }
                                        JPushApiExample.ALERT       = "您的提现申请支付失败了,资金已退回到您的钱包,请检查您提现时填写的账号资料是否正确";
                                        JPushApiExample.MSG_CONTENT = "您的提现申请支付失败了,资金已退回到您的钱包,请检查您提现时填写的账号资料是否正确";
                                        PushPayload pushsms = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras(UserID, "Present");
                                        JPushApiExample.push(pushsms);
                                    }
                                }
                            }
                            //判断是否在商户网站中已经做过了这次通知返回的处理
                            //如果没有做过处理,那么执行商户的业务程序
                            //如果有做过处理,那么不执行商户的业务程序
                            WxLogger("成功!");
                            Response.Write("success");  //请不要修改或删除

                            //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                            /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                        }
                        else
                        {
                            WxLogger("批次已被处理或没有该批次,批次:" + batch_no);
                            Response.Write("success");
                        }
                    }catch (Exception ex) {
                        WxLogger("异常:" + ex.Message);
                    }
                }
                else//验证失败
                {
                    WxLogger("验证失败");
                    Response.Write("fail");
                }
            }
            else
            {
                Response.Write("无通知参数");
            }
        }
        [ValidateInput(false)]// [ValidateAntiForgeryToken]
        public ActionResult Create(Push push, HttpPostedFileBase file)
        {
            List <SelectListItem> strict = (from u in sdb.nations//获取所有地区
                                            select new { Strict = u.Value }).Distinct().ToList().Select(s => new SelectListItem
            {
                Text  = s.Strict,
                Value = s.Strict
            }).Distinct().ToList();

            ViewBag.strict = strict;
            if (ModelState.IsValid)
            {
                string miniType   = file.ContentType;
                Stream fileStream = file.InputStream;
                string path       = AppDomain.CurrentDomain.BaseDirectory + "files\\push\\";
                string filename   = Path.GetFileName(file.FileName);
                file.SaveAs(Path.Combine(path, filename));
                Push p = new Push();
                p.Type         = Request["Type"];
                p.Tag          = Request["Tag"];
                p.TagContent   = push.TagContent;
                p.TagTitle     = push.TagTitle;
                p.Target       = push.Target;
                p.PersonName   = "张量办公";
                p.RecordPerson = "88888888888";
                p.RecordTime   = DateTime.Now;
                p.Url          = "http://" + Request.Url.Host + ":" + Request.Url.Port + "/files/push/" + filename;

                string[] selects = p.Tag.Split(',');



                PushPayload payload = new PushPayload();
                if (p.Target.Equals("所有用户"))
                {
                    payload = JPushApiExample.PushObject_all(p.TagContent);//选择一种方式
                }
                else if (p.Target.Equals("选择用户(只要符合其中一种条件的推送)"))
                {
                    payload = JPushApiExample.PushObject_tags(selects, p.TagContent);//选择一种方式
                }
                else
                {
                    payload = JPushApiExample.PushObject_tags_and(selects, p.TagContent);//选择一种方式
                }
                JPushClient client = new JPushClient(JPushApiExample.app_key, JPushApiExample.master_secret);

                try
                {
                    var result1 = client.SendPush(payload);//推送
                    //由于统计数据并非非是即时的,所以等待一小段时间再执行下面的获取结果方法
                    //System.Threading.Thread.Sleep(10000);
                    /*如需查询上次推送结果执行下面的代码*/
                    // var apiResult = client.getReceivedApi(result.msg_id.ToString());
                    //var apiResultv3 = client.getReceivedApi_v3(result1.msg_id.ToString());
                    /*如需查询某个messageid的推送结果执行下面的代码*/
                    //   var queryResultWithV2 = client.getReceivedApi("1739302794");
                    //var querResultWithV3 = client.getReceivedApi_v3("1739302794");
                }
                catch (APIRequestException e)//处理请求异常
                {
                    if (e.ErrorCode.Equals(1011))
                    {
                        var message1 = "您发送的推送目标组合条件不成立";
                        return(Json(message1, JsonRequestBehavior.AllowGet));
                    }
                    var message = "Error response from JPush server. Should review and fix it." + "HTTP Status:" + e.Status + "Error Code: " + e.ErrorCode + "Error Message: " + e.ErrorCode;
                    return(Json(message, JsonRequestBehavior.AllowGet));
                }
                catch (APIConnectionException e)//处理连接异常
                {
                    var message = e.Message;
                    return(Json(e.Message, JsonRequestBehavior.AllowGet));
                }
                sdb.Pushes.Add(p);
                sdb.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(push));
        }
示例#7
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int    ID        = Convert.ToInt32(e.CommandArgument);
            int    adminid   = Convert.ToInt32(Utils.GetCookie("UserID"));
            string adminname = new ZhongLi.BLL.User_Managers().GetModel(adminid).RealName;
            string realname  = ((Literal)e.Item.FindControl("ltlrealname")).Text;

            ZhongLi.Model.PresentApplication p = bll.GetModel(ID);
            if (e.CommandName.Equals("auth"))
            {
                if (bll.authPass(adminid, adminname, ID, p.UserType.Value, p.UserID.Value))
                {
                    //推送通知
                    string UserID = "";
                    if (p.UserType.Value == 0)                    //用户类型为人才
                    {
                        UserID = "p" + p.UserID;
                    }
                    else
                    {
                        UserID = "s" + p.UserID;
                    }
                    JPushApiExample.ALERT       = "您的提现申请审核通过啦,优青将会在3个工作日之内将体现金额支付到您的账户";
                    JPushApiExample.MSG_CONTENT = "您的提现申请审核通过啦,优青将会在3个工作日之内将体现金额支付到您的账户";
                    PushPayload pushsms = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras(UserID, "Present");
                    JPushApiExample.push(pushsms);
                    webHelper.addLog(adminname + "通过了:" + realname + "的提现申请");
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsg('审核提现申请','操作成功!','',1)</script>");
                    databind();
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsg('审核提现申请','操作失败!','',2)</script>");
                }
            }
            if (e.CommandName.Equals("noauth"))
            {
                if (bll.noauthPass(adminid, adminname, ID, p.UserType.Value, p.UserID.Value))
                {
                    //推送通知
                    //推送通知
                    string UserID = "";
                    if (p.UserType.Value == 0)                    //用户类型为人才
                    {
                        UserID = "p" + p.UserID;
                    }
                    else
                    {
                        UserID = "s" + p.UserID;
                    }
                    JPushApiExample.ALERT       = "您的提现申请没有通过审核";
                    JPushApiExample.MSG_CONTENT = "您的提现申请没有通过审核";
                    PushPayload pushsms = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras(UserID, "Present");
                    JPushApiExample.push(pushsms);
                    webHelper.addLog(adminname + "没通过:" + realname + "的提现申请");
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsg('审核提现申请','操作成功!','',1)</script>");
                    databind();
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsg('审核提现申请','操作失败!','',2)</script>");
                }
            }
        }
示例#8
0
        public override void ProcessNotify()
        {
            WxPayData notifyData = GetNotifyData();

            WxLogger("微信回调");
            //检查支付结果中transaction_id是否存在
            if (!notifyData.IsSet("transaction_id"))
            {
                //若transaction_id不存在,则立即返回结果给微信支付后台
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "FAIL");
                res.SetValue("return_msg", "支付结果中微信订单号不存在");
                WxLogger("支付订单不存在");
                Log.Error(this.GetType().ToString(), "The Pay result is error : " + res.ToXml());
                page.Response.Write(res.ToXml());
                page.Response.End();
            }

            string transaction_id = notifyData.GetValue("transaction_id").ToString();
            string out_trade_no   = notifyData.GetValue("out_trade_no").ToString();

            //查询订单,判断订单真实性
            if (!QueryOrder(transaction_id))
            {
                //若订单查询失败,则立即返回结果给微信支付后台
                WxLogger("订单查询失败");
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "FAIL");
                res.SetValue("return_msg", "订单查询失败");
                Log.Error(this.GetType().ToString(), "Order query failure : " + res.ToXml());
                page.Response.Write(res.ToXml());
                page.Response.End();
            }
            //查询订单成功
            else
            {
                WxLogger("订单查询成功");
                string t = out_trade_no.Substring(0, 1);
                //WxLogger("编号" + sPara["out_trade_no"] + "--t:" + t);
                if (t.Equals("d"))
                {
                    WxLogger("订单");
                    if (new ZhongLi.BLL.Reward_Order().isOrderState(out_trade_no))
                    {
                        bool issuss = new ZhongLi.BLL.Reward_Order().modOrderStateByOrderNum(out_trade_no, "微信");
                        WxLogger("修改数据库:" + issuss);
                    }
                    else
                    {
                        WxLogger("已修改数据库:" + out_trade_no);
                    }
                }
                else if (t.Equals("c"))
                {
                    WxLogger("充值");
                    if (new ZhongLi.BLL.Person().IsPayCheck(out_trade_no))
                    {
                        bool issuss = new ZhongLi.BLL.Person().EditPayCheck(out_trade_no, "微信");
                        WxLogger("修改数据库:" + issuss);
                    }
                    else
                    {
                        WxLogger("已修改数据库" + out_trade_no);
                    }
                }
                else if (t.Equals("y"))
                {
                    WxLogger("指定职位订单悬赏");
                    if (new ZhongLi.BLL.Reward_Order().isOrderState(out_trade_no))
                    {
                        bool issuss = new ZhongLi.BLL.Reward_Order().modOrderStateByNumPost(out_trade_no, "微信");
                        WxLogger("执行结果:" + issuss);
                        if (issuss)
                        {
                            DataTable dt = new ZhongLi.BLL.Reward_Order().getOrderInfo("SerUserID,RealName,EngagePost", out_trade_no);
                            JPushApiExample.ALERT       = "求职者" + dt.Rows[0]["RealName"] + "针对您的职位 " + dt.Rows[0]["EngagePost"] + "发送了悬赏订单,赶紧去我的订单里面查看吧";
                            JPushApiExample.MSG_CONTENT = "求职者" + dt.Rows[0]["RealName"] + "针对您的职位" + dt.Rows[0]["EngagePost"] + "发送了悬赏订单,赶紧去我的订单里面查看吧";
                            PushPayload pushsms = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras("s" + dt.Rows[0]["SerUserID"], "Order");
                            JPushApiExample.push(pushsms);
                        }
                    }
                    else
                    {
                    }
                }

                WxPayData res = new WxPayData();
                res.SetValue("return_code", "SUCCESS");
                res.SetValue("return_msg", "OK");
                Log.Info(this.GetType().ToString(), "order query success : " + res.ToXml());
                page.Response.Write(res.ToXml());
                page.Response.End();
            }
        }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WxLogger("进入回调函数ali_notify");
            try
            {
                Dictionary <string, string> sPara = GetRequestPost();
                string notify_id = Request.Form["notify_id"]; //获取notify_id
                string sign      = Request.Form["sign"];      //获取sign
                //过滤空值、sign与sign_type参数
                //Dictionary<string, string> aaa = Core.FilterPara(sPara);

                //获取待签名字符串
                //string preSignStr = Core.CreateLinkString(aaa);
                //WxLogger("参数:" + preSignStr);
                if (notify_id != null && notify_id != "")//判断是否有带返回参数
                {
                    Notify aliNotify = new Notify();
                    //WxLogger("公钥:" + Config.alipay_public_key.Trim());
                    //WxLogger("sign:" + sign);
                    //WxLogger("issign:" + aliNotify.GetSignVeryfy(sPara, sign));
                    //WxLogger("ResponseTxt:" + aliNotify.GetResponseTxt(Request.Form["notify_id"]));
                    //WxLogger("公钥:" + Notify.getPublicKeyStr(Config.alipay_public_key), context);
                    if (aliNotify.GetResponseTxt(notify_id) == "true")
                    {
                        if (aliNotify.GetSignVeryfy(sPara, sign))
                        {
                            //卖家支付宝账号	//订单号//
                            WxLogger("验证成功");
                            WxLogger("订单号:" + sPara["out_trade_no"]);
                            WxLogger("金额:" + sPara["total_fee"]);
                            //修改订单状态
                            string t = sPara["out_trade_no"].Substring(0, 1);
                            //WxLogger("编号" + sPara["out_trade_no"] + "--t:" + t);
                            if (t.Equals("d"))
                            {
                                WxLogger("订单");
                                if (new ZhongLi.BLL.Reward_Order().isOrderState(sPara["out_trade_no"]))
                                {
                                    bool issuss = new ZhongLi.BLL.Reward_Order().modOrderStateByOrderNum(sPara["out_trade_no"], "支付宝");
                                    WxLogger("修改数据库:" + issuss);
                                }
                                else
                                {
                                    WxLogger("已修改数据库:" + sPara["out_trade_no"]);
                                }
                            }
                            else if (t.Equals("c"))
                            {
                                WxLogger("充值");
                                if (new ZhongLi.BLL.Person().IsPayCheck(sPara["out_trade_no"]))
                                {
                                    bool issuss = new ZhongLi.BLL.Person().EditPayCheck(sPara["out_trade_no"], "支付宝");
                                    WxLogger("修改数据库:" + issuss);
                                }
                                else
                                {
                                    WxLogger("已修改数据库" + sPara["out_trade_no"]);
                                }
                            }
                            else if (t.Equals("y"))
                            {
                                WxLogger("指定职位订单悬赏");
                                if (new ZhongLi.BLL.Reward_Order().isOrderState(sPara["out_trade_no"]))
                                {
                                    bool issuss = new ZhongLi.BLL.Reward_Order().modOrderStateByNumPost(sPara["out_trade_no"], "支付宝");
                                    WxLogger("执行结果:" + issuss);
                                    if (issuss)
                                    {
                                        DataTable dt = new ZhongLi.BLL.Reward_Order().getOrderInfo("SerUserID,RealName,EngagePost", sPara["out_trade_no"]);
                                        JPushApiExample.ALERT       = "求职者" + dt.Rows[0]["RealName"] + "针对您的职位 " + dt.Rows[0]["EngagePost"] + "发送了悬赏订单,赶紧去我的订单里面查看吧";
                                        JPushApiExample.MSG_CONTENT = "求职者" + dt.Rows[0]["RealName"] + "针对您的职位" + dt.Rows[0]["EngagePost"] + "发送了悬赏订单,赶紧去我的订单里面查看吧";
                                        PushPayload pushsms = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras("s" + dt.Rows[0]["SerUserID"], "Order");
                                        JPushApiExample.push(pushsms);
                                    }
                                }
                                else
                                {
                                }
                            }
                            Response.Write("success");
                        }
                        else
                        {
                            WxLogger("订单号:" + sPara["out_trade_no"]);
                            WxLogger("验证失败");
                            Response.Write("sign fail!");
                        }
                    }
                    else
                    {
                        Response.Write("sign fail!");
                    }
                }
                else
                {
                    // Response.Write("非通知参数!");
                }
            }
            catch (Exception ex)
            {
                WxLogger("异常:" + ex.Message);
            }
        }