当前位置: 首页>>代码示例>>C#>>正文


C# BLL.orders.UpdateField方法代码示例

本文整理汇总了C#中BLL.orders.UpdateField方法的典型用法代码示例。如果您正苦于以下问题:C# BLL.orders.UpdateField方法的具体用法?C# BLL.orders.UpdateField怎么用?C# BLL.orders.UpdateField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BLL.orders的用法示例。


在下文中一共展示了BLL.orders.UpdateField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            //读取站点配置信息
            Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(DTKeys.FILE_SITE_XML_CONFING);

            string order_type = DTRequest.GetFormString("pay_order_type"); //订单类型
            string order_no = DTRequest.GetFormString("pay_order_no");
            decimal order_amount = DTRequest.GetFormDecimal("pay_order_amount", 0);
            string subject = DTRequest.GetFormString("pay_subject");
            if (order_no == "" || order_amount == 0 )
            {
                Response.Redirect(siteConfig.webpath + "error.aspx?msg=" + Utils.UrlEncode("对不起,您提交的参数有误!"));
                return;
            }
            //检查是否已登录
            Model.users userModel = new Web.UI.BasePage().GetUserInfo();
            if (userModel == null)
            {
                Response.Redirect(new Web.UI.BasePage().linkurl("payment", "login")); //尚未登录
                return;
            }
            if (userModel.amount < order_amount)
            {
                Response.Redirect(new Web.UI.BasePage().linkurl("payment", "recharge")); //账户的余额不足
                return;
            }

            if (order_type.ToLower() == DTEnums.AmountTypeEnum.BuyGoods.ToString().ToLower()) //购买商品
            {
                BLL.orders bll = new BLL.orders();
                Model.orders model = bll.GetModel(order_no);
                if (model == null)
                {
                    Response.Redirect(siteConfig.webpath + "error.aspx?msg=" + Utils.UrlEncode("对不起,商品订单号不存在!"));
                    return;
                }
                //执行扣取账户金额
                int result = new BLL.amount_log().Add(userModel.id, userModel.user_name, DTEnums.AmountTypeEnum.BuyGoods.ToString(), order_no, model.payment_id, -1 * order_amount, subject, 1);
                if (result > 0)
                {
                    //更改订单状态
                    bool result1 = bll.UpdateField(order_no, "payment_status=2,payment_time='" + DateTime.Now + "'");
                    if (!result1)
                    {
                        Response.Redirect(new Web.UI.BasePage().linkurl("payment", "error"));
                        return;
                    }
                    //扣除积分
                    if (model.point < 0)
                    {
                        new BLL.point_log().Add(model.user_id, model.user_name, model.point, "换购扣除积分,订单号:" + model.order_no);
                    }
                    //支付成功
                    Response.Redirect(new Web.UI.BasePage().linkurl("payment1", "succeed", order_type, order_no));
                    return;
                }
            }
            Response.Redirect(siteConfig.webpath + "error.aspx?msg=" + Utils.UrlEncode("对不起,找不到需要支付的订单类型!"));
            return;
        }
开发者ID:sichina,项目名称:or-dtcms2.0,代码行数:60,代码来源:index.aspx.cs

示例2: lbtnComplete_Click

 //完成订单
 protected void lbtnComplete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("orders", DTEnums.ActionEnum.Edit.ToString()); //检查权限
     BLL.orders bll = new BLL.orders();
     Model.orders model = bll.GetModel(this.id);
     //检查订单状态
     if (model == null || model.status != 2 || model.distribution_status != 2)
     {
         JscriptMsg("订单不符合要求,无法发货!", "", "Error");
         return;
     }
     //检查支付方式
     Model.payment payModel = new BLL.payment().GetModel(model.payment_id);
     if (payModel == null)
     {
         JscriptMsg("支付方式不存在,无法完成订单!", "", "Error");
         return;
     }
     //增加积分/经验值
     if (model.point > 0)
     {
         new BLL.point_log().Add(model.user_id, model.user_name, model.point, "购物获得积分,订单号:" + model.order_no);
     }
     //如果配送方式为先款后货,则检查付款状态
     if (payModel.type == 2)
     {
         bll.UpdateField(this.id, "status=3,complete_time='" + DateTime.Now + "'," + "payment_status=2,payment_time='" + DateTime.Now + "'");
     }
     else
     {
         bll.UpdateField(this.id, "status=3,complete_time='" + DateTime.Now + "'");
     }
     JscriptMsg("订单已经完成啦!", "order_edit.aspx?id=" + this.id, "Success");
 }
开发者ID:egojit,项目名称:B2C,代码行数:35,代码来源:order_edit.aspx.cs

示例3: btnInvalid_Click

 //作废订单
 protected void btnInvalid_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("orders", DTEnums.ActionEnum.Invalid.ToString()); //检查权限
     BLL.orders bll = new BLL.orders();
     Model.orders model = bll.GetModel(this.id);
     if (model == null && model.status != 3)
     {
         JscriptMsg("订单未完成,无法作废!", "", "Error");
         return;
     }
     bll.UpdateField(this.id, "status=5");
     JscriptMsg("订单取消成功啦!", "order_edit.aspx?id=" + this.id, "Success");
 }
开发者ID:egojit,项目名称:B2C,代码行数:14,代码来源:order_edit.aspx.cs

示例4: btnCancel_Click

 //取消订单
 protected void btnCancel_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("orders", DTEnums.ActionEnum.Cancel.ToString()); //检查权限
     BLL.orders bll = new BLL.orders();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             Model.orders model = bll.GetModel(id);
             if (model != null && model.status == 1)
             {
                 bll.UpdateField(id, "status=4");
             }
         }
     }
     JscriptMsg("符合的订单已取消!", Utils.CombUrlTxt("order_list.aspx", "status={0}&payment_status={1}&distribution_status={2}&keywords={3}",
     this.status.ToString(), this.payment_status.ToString(), this.distribution_status.ToString(), this.keywords), "Success");
 }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:21,代码来源:order_list.aspx.cs

示例5: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            SortedDictionary<string, string> sPara = GetRequestPost();

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify = new Notify();
                bool verifyResult = aliNotify.Verify(sPara, DTRequest.GetString("notify_id"), DTRequest.GetString("sign"));

                if (verifyResult)//验证成功
                {
                    string trade_no = DTRequest.GetString("trade_no"); //支付宝交易号
                    string order_no = DTRequest.GetString("out_trade_no"); //获取订单号
                    string total_fee = DTRequest.GetString("total_fee"); //获取总金额
                    string subject = DTRequest.GetString("subject"); //商品名称、订单名称
                    string body = DTRequest.GetString("body"); //商品描述、订单备注、描述
                    string buyer_email = DTRequest.GetString("buyer_email"); //买家支付宝账号
                    string trade_status = DTRequest.GetString("trade_status"); //交易状态
                    string order_type = DTRequest.GetString("extra_common_param"); //订单交易类别

                    if (DTRequest.GetString("trade_status") == "TRADE_FINISHED" || DTRequest.GetString("trade_status") == "TRADE_SUCCESS")
                    {
                        //修改支付状态、时间
                        if (order_type.ToLower() == DTEnums.AmountTypeEnum.Recharge.ToString().ToLower()) //在线充值
                        {
                            BLL.amount_log bll = new BLL.amount_log();
                            Model.amount_log model = bll.GetModel(order_no);
                            if (model == null)
                            {
                                Response.Write("该订单号不存在");
                                return;
                            }
                            if (model.value != decimal.Parse(total_fee))
                            {
                                Response.Write("订单金额和支付金额不相符");
                                return;
                            }
                            model.status = 1;
                            model.complete_time = DateTime.Now;
                            bool result = bll.Update(model);
                            if (!result)
                            {
                                Response.Write("修改订单状态失败");
                                return;
                            }
                        }
                        else
                            if (order_type.ToLower() == DTEnums.AmountTypeEnum.BuyGoods.ToString().ToLower()) //购买商品
                            {
                                BLL.orders bll = new BLL.orders();
                                Model.orders model = bll.GetModel(order_no);
                                if (model == null)
                                {
                                    Response.Write("该订单号不存在");
                                    return;
                                }
                                if (model.order_amount != decimal.Parse(total_fee))
                                {
                                    Response.Write("订单金额和支付金额不相符");
                                    return;
                                }
                                bool result = bll.UpdateField(order_no, "payment_status=2,payment_time='" + DateTime.Now + "'");
                                if (!result)
                                {
                                    Response.Write("修改订单状态失败");
                                    return;
                                }
                                //扣除积分
                                if (model.point < 0)
                                {
                                    new BLL.point_log().Add(model.user_id, model.user_name, model.point, "换购扣除积分,订单号:" + model.order_no);
                                }
                            }
                    }

                    Response.Write("success"); //请不要修改或删除
                }
                else//验证失败
                {
                    Response.Write("fail");
                }
            }
            else
            {
                Response.Write("无通知参数");
            }
        }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:87,代码来源:notify_url2.aspx.cs

示例6: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            //读取站点配置信息
            Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig();
            string order_no = DTRequest.GetFormString("pay_order_no").ToUpper();
            BLL.orders objorders = new BLL.orders();
            Model.orders modelorders = objorders.GetModel(order_no);
            if (modelorders == null)
            {
                Response.Redirect(new Web.UI.BasePage().linkurl("error", "?msg=" + Utils.UrlEncode("对不起,订单详情获取出错,请重试!")));
                return;
            }
            decimal order_amount = modelorders.order_amount;
            string subject = DTRequest.GetFormString("pay_subject");
            if (order_no == "" || order_amount == 0 )
            {
                Response.Redirect(new Web.UI.BasePage().linkurl("error", "?msg=" + Utils.UrlEncode("对不起,您提交的参数有误!")));
                return;
            }
            //检查是否已登录
            Model.users userModel = new Web.UI.BasePage().GetUserInfo();
            if (userModel == null)
            {
                Response.Redirect(new Web.UI.BasePage().linkurl("payment", "?action=login")); //尚未登录
                return;
            }
            if (userModel.amount < order_amount)
            {
                Response.Redirect(new Web.UI.BasePage().linkurl("payment", "?action=recharge")); //账户的余额不足
                return;
            }

            if (order_no.StartsWith("B")) //B开头为商品订单
            {
                BLL.orders bll = new BLL.orders();
                Model.orders model = bll.GetModel(order_no);
                if (model == null)
                {
                    Response.Redirect(new Web.UI.BasePage().linkurl("error", "?msg=" + Utils.UrlEncode("对不起,商品订单号不存在!")));
                    return;
                }
                if (model.payment_status == 1)
                {
                    //执行扣取账户金额
                    int result = new BLL.user_amount_log().Add(userModel.id, userModel.user_name, -1 * order_amount, subject);
                    if (result > 0)
                    {
                        //更改订单状态
                        bool result1 = bll.UpdateField(order_no, "status=2,payment_status=2,payment_time='" + DateTime.Now + "'");
                        if (!result1)
                        {
                            Response.Redirect(new Web.UI.BasePage().linkurl("payment", "?action=error"));
                            return;
                        }
                        //扣除积分
                        if (model.point < 0)
                        {
                            new BLL.user_point_log().Add(model.user_id, model.user_name, model.point, "换购扣除积分,订单号:" + model.order_no, false);
                        }
                    }
                    else
                    {
                        Response.Redirect(new Web.UI.BasePage().linkurl("payment", "?action=error"));
                        return;
                    }
                }
                //支付成功
                Response.Redirect(new Web.UI.BasePage().linkurl("payment", "?action=succeed&order_no=" + order_no));
                return;
            }
            Response.Redirect(new Web.UI.BasePage().linkurl("error", "?msg=" + Utils.UrlEncode("对不起,找不到需要支付的订单类型!")));
            return;
        }
开发者ID:rockhe168,项目名称:CMS,代码行数:73,代码来源:index.aspx.cs

示例7: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            SortedDictionary<string, string> sPara = GetRequestPost();

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify = new Notify();
                bool verifyResult = aliNotify.Verify(sPara, DTRequest.GetString("notify_id"), DTRequest.GetString("sign"));

                //写日志
                //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "验证结果:" + verifyResult.ToString() + "\n", System.Text.Encoding.UTF8);

                if (verifyResult)//验证成功
                {
                    string trade_no = DTRequest.GetString("trade_no");                  //支付宝交易号
                    string order_no = DTRequest.GetString("out_trade_no").ToUpper();    //获取订单号
                    string total_fee = DTRequest.GetString("total_fee");                //获取总金额
                    string trade_status = DTRequest.GetString("trade_status");          //交易状态

                    if (trade_status == "TRADE_FINISHED" || trade_status == "TRADE_SUCCESS")
                    {
                        if (order_no.StartsWith("R")) //充值订单
                        {
                            BLL.user_amount_log bll = new BLL.user_amount_log();
                            Model.user_amount_log model = bll.GetModel(order_no);
                            if (model == null)
                            {
                                Response.Write("该订单号不存在");
                                return;
                            }
                            if (model.status == 1) //已成功
                            {
                                Response.Write("success");
                                return;
                            }
                            if (model.value != decimal.Parse(total_fee))
                            {
                                Response.Write("订单金额和支付金额不相符");
                                return;
                            }
                            model.trade_no = trade_no;
                            model.status = 1;
                            model.complete_time = DateTime.Now;
                            bool result = bll.Update(model);
                            if (!result)
                            {
                                Response.Write("修改订单状态失败");
                                return;
                            }
                        }
                        else if (order_no.StartsWith("B")) //商品订单
                        {
                            //写日志
                            //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "商品订单\n", System.Text.Encoding.UTF8);

                            BLL.orders bll = new BLL.orders();
                            Model.orders model = bll.GetModel(order_no);
                            if (model == null)
                            {
                                //写日志
                                //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "订单号:" + order_no + "不存在\n", System.Text.Encoding.UTF8);
                                Response.Write("该订单号不存在");
                                return;
                            }
                            if (model.payment_status == 2) //已付款
                            {
                                //写日志
                                //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "订单号:" + order_no + "已付款\n", System.Text.Encoding.UTF8);
                                Response.Write("success");
                                return;
                            }
                            if (model.order_amount != decimal.Parse(total_fee))
                            {
                                //写日志
                                //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "订单号:" + order_no + "订单金额" + model.order_amount + "和支付金额" + total_fee + "不相符\n", System.Text.Encoding.UTF8);
                                Response.Write("订单金额和支付金额不相符");
                                return;
                            }
                            bool result = bll.UpdateField(order_no, "trade_no='" + trade_no + "',status=2,payment_status=2,payment_time='" + DateTime.Now + "'");
                            if (!result)
                            {
                                Response.Write("修改订单状态失败");
                                return;
                            }
                            //写日志
                            //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "修改订单状态:" + result.ToString() + "\n", System.Text.Encoding.UTF8);

                            //扣除积分
                            if (model.point < 0)
                            {
                                new BLL.user_point_log().Add(model.user_id, model.user_name, model.point, "换购扣除积分,订单号:" + model.order_no, false);
                            }
                        }
                    }

                    Response.Write("success");  //请不要修改或删除
                }
                else//验证失败
                {
                    Response.Write("fail");
//.........这里部分代码省略.........
开发者ID:LutherW,项目名称:MTMS,代码行数:101,代码来源:notify_url.aspx.cs

示例8: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            SortedDictionary<string, string> sPara = GetRequestPost();

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify = new Notify();
                bool verifyResult = aliNotify.Verify(sPara, DTRequest.GetString("notify_id"), DTRequest.GetString("sign"));

                if (verifyResult)//验证成功
                {
                    string trade_no = DTRequest.GetString("trade_no");                  //支付宝交易号
                    string order_no = DTRequest.GetString("out_trade_no").ToUpper();    //获取订单号
                    string total_fee = DTRequest.GetString("total_fee");                //获取总金额
                    string trade_status = DTRequest.GetString("trade_status");          //交易状态

                    if (Config.Type == "1") //即时到帐接口处理方法
                    {
                        if (trade_status == "TRADE_FINISHED" || trade_status == "TRADE_SUCCESS")
                        {
                            if (order_no.StartsWith("R")) //充值订单
                            {
                                BLL.user_recharge bll = new BLL.user_recharge();
                                Model.user_recharge model = bll.GetModel(order_no);
                                if (model == null)
                                {
                                    Response.Write("该订单号不存在");
                                    return;
                                }
                                if (model.status == 1) //已成功
                                {
                                    Response.Write("success");
                                    return;
                                }
                                if (model.amount != decimal.Parse(total_fee))
                                {
                                    Response.Write("订单金额和支付金额不相符");
                                    return;
                                }
                                bool result = bll.Confirm(order_no);
                                if (!result)
                                {
                                    Response.Write("修改订单状态失败");
                                    return;
                                }
                            }
                            else if (order_no.StartsWith("B")) //商品订单
                            {
                                BLL.orders bll = new BLL.orders();
                                Model.orders model = bll.GetModel(order_no);
                                if (model == null)
                                {
                                    Response.Write("该订单号不存在");
                                    return;
                                }
                                if (model.payment_status == 2) //已付款
                                {
                                    Response.Write("success");
                                    return;
                                }
                                if (model.order_amount != decimal.Parse(total_fee))
                                {
                                    Response.Write("订单金额和支付金额不相符");
                                    return;
                                }
                                bool result = bll.UpdateField(order_no, "trade_no='" + trade_no + "',status=2,payment_status=2,payment_time='" + DateTime.Now + "'");
                                if (!result)
                                {
                                    Response.Write("修改订单状态失败");
                                    return;
                                }
                                //扣除积分
                                if (model.point < 0)
                                {
                                    new BLL.user_point_log().Add(model.user_id, model.user_name, model.point, "换购扣除积分,订单号:" + model.order_no, false);
                                }
                            }
                        }
                    }
                    else //担保交易接口处理方法
                    {
                        if (trade_status == "WAIT_SELLER_SEND_GOODS") //付款成功
                        {
                            if (order_no.StartsWith("R")) //充值订单
                            {
                                BLL.user_recharge bll = new BLL.user_recharge();
                                Model.user_recharge model = bll.GetModel(order_no);
                                if (model == null)
                                {
                                    Response.Write("该订单号不存在");
                                    return;
                                }
                                if (model.status == 1) //已成功
                                {
                                    Response.Write("success");
                                    return;
                                }
                                if (model.amount != decimal.Parse(total_fee))
                                {
                                    Response.Write("订单金额和支付金额不相符");
//.........这里部分代码省略.........
开发者ID:rockhe168,项目名称:CMS,代码行数:101,代码来源:notify_url.aspx.cs

示例9: Page_Load


//.........这里部分代码省略.........
                                    //------------------------------
                                    //即时到账处理业务开始
                                    //------------------------------
                                    //处理数据库逻辑
                                    //注意交易单不要重复处理
                                    //注意判断返回金额

                                    //修改支付状态、时间
                                    if (order_type.ToLower() == DTEnums.AmountTypeEnum.Recharge.ToString().ToLower()) //在线充值
                                    {
                                        BLL.amount_log bll = new BLL.amount_log();
                                        Model.amount_log model = bll.GetModel(out_trade_no);
                                        if (model == null)
                                        {
                                            Response.Write("该订单号不存在");
                                            return;
                                        }
                                        if (model.value != (decimal.Parse(total_fee) / 100))
                                        {
                                            Response.Write("订单金额和支付金额不相符");
                                            return;
                                        }
                                        model.status = 1;
                                        model.complete_time = DateTime.Now;
                                        bool result = bll.Update(model);
                                        if (!result)
                                        {
                                            Response.Write("修改订单状态失败");
                                            return;
                                        }
                                    }
                                    else if (order_type.ToLower() == DTEnums.AmountTypeEnum.BuyGoods.ToString().ToLower()) //购买商品
                                    {
                                        BLL.orders bll = new BLL.orders();
                                        Model.orders model = bll.GetModel(out_trade_no);
                                        if (model == null)
                                        {
                                            Response.Write("该订单号不存在");
                                            return;
                                        }
                                        if (model.order_amount != (decimal.Parse(total_fee) / 100))
                                        {
                                            Response.Write("订单金额和支付金额不相符");
                                            return;
                                        }
                                        bool result = bll.UpdateField(out_trade_no, "payment_status=2,payment_time='" + DateTime.Now + "'");
                                        if (!result)
                                        {
                                            Response.Write("修改订单状态失败");
                                            return;
                                        }
                                        //扣除积分
                                        if (model.point < 0)
                                        {
                                            new BLL.point_log().Add(model.user_id, model.user_name, model.point, "换购扣除积分,订单号:" + model.order_no);
                                        }
                                    }

                                    //------------------------------
                                    //即时到账处理业务完毕
                                    //------------------------------

                                    //给财付通系统发送成功信息,财付通系统收到此结果后不再进行后续通知
                                    Response.Write("success");
                                }
                                else
                                {
                                    Response.Write("即时到账支付失败");
                                }
                            }
                        }
                        else
                        {
                            //错误时,返回结果可能没有签名,写日志trade_state、retcode、retmsg看失败详情。
                            //通知财付通处理失败,需要重新通知
                            Response.Write("查询验证签名失败或id验证失败");
                            Response.Write("retcode:" + queryRes.getParameter("retcode"));
                        }
                        #endregion
                    }
                    else
                    {
                        Response.Write("通知ID查询签名验证失败");
                    }
                }
                else
                {
                    //通知财付通处理失败,需要重新通知
                    Response.Write("后台调用通信失败");
                    //写错误日志
                    Response.Write("call err:" + httpClient.getErrInfo() + "<br>" + httpClient.getResponseCode() + "<br>");

                }
            }
            else
            {
                Response.Write("签名验证失败");
            }
            Response.End();
        }
开发者ID:sichina,项目名称:dtcms_21_sql_src,代码行数:101,代码来源:notify_url.aspx.cs

示例10: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            SortedDictionary<string, string> sPara = GetRequestPost();

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify = new Notify();
                bool verifyResult = aliNotify.Verify(sPara, MXRequest.GetString("notify_id"), MXRequest.GetString("sign"));

                //写日志
                //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "验证结果:" + verifyResult.ToString() + "\n", System.Text.Encoding.UTF8);

                if (verifyResult)//验证成功
                {
                    string trade_no = MXRequest.GetString("trade_no");                  //支付宝交易号
                    string order_no = MXRequest.GetString("out_trade_no").ToUpper();    //获取订单号
                    string total_fee = MXRequest.GetString("total_fee");                //获取总金额
                    string trade_status = MXRequest.GetString("trade_status");          //交易状态

                    //写日志
                    //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "接口类型:" + Config.Type + "\n", System.Text.Encoding.UTF8);

                    if (Config.Type == "1") //即时到帐接口处理方法
                    {
                        //写日志
                        //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "即时到帐返回交易状态:" + trade_status + "\n", System.Text.Encoding.UTF8);

                        if (trade_status == "TRADE_FINISHED" || trade_status == "TRADE_SUCCESS")
                        {
                            if (order_no.StartsWith("R")) //充值订单
                            {
                                BLL.user_amount_log bll = new BLL.user_amount_log();
                                Model.user_amount_log model = bll.GetModel(order_no);
                                if (model == null)
                                {
                                    Response.Write("该订单号不存在");
                                    return;
                                }
                                if (model.status == 1) //已成功
                                {
                                    Response.Write("success");
                                    return;
                                }
                                if (model.value != decimal.Parse(total_fee))
                                {
                                    Response.Write("订单金额和支付金额不相符");
                                    return;
                                }
                                model.trade_no = trade_no;
                                model.status = 1;
                                model.complete_time = DateTime.Now;
                                bool result = bll.Update(model);
                                if (!result)
                                {
                                    Response.Write("修改订单状态失败");
                                    return;
                                }
                            }
                            else if (order_no.StartsWith("B")) //商品订单
                            {
                                //写日志
                                //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "商品订单\n", System.Text.Encoding.UTF8);

                                BLL.orders bll = new BLL.orders();
                                Model.orders model = bll.GetModel(order_no);
                                if (model == null)
                                {
                                    //写日志
                                    //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "订单号:" + order_no + "不存在\n", System.Text.Encoding.UTF8);
                                    Response.Write("该订单号不存在");
                                    return;
                                }
                                if (model.payment_status == 2) //已付款
                                {
                                    //写日志
                                    //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "订单号:" + order_no + "已付款\n", System.Text.Encoding.UTF8);
                                    Response.Write("success");
                                    return;
                                }
                                if (model.order_amount != decimal.Parse(total_fee))
                                {
                                    //写日志
                                    //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "订单号:" + order_no + "订单金额" + model.order_amount + "和支付金额" + total_fee + "不相符\n", System.Text.Encoding.UTF8);
                                    Response.Write("订单金额和支付金额不相符");
                                    return;
                                }
                                bool result = bll.UpdateField(order_no, "trade_no='" + trade_no + "',status=2,payment_status=2,payment_time='" + DateTime.Now + "'");
                                if (!result)
                                {
                                    Response.Write("修改订单状态失败");
                                    return;
                                }
                                //写日志
                                //System.IO.File.AppendAllText(Utils.GetMapPath("alipaylog.txt"), "修改订单状态:" + result.ToString() + "\n", System.Text.Encoding.UTF8);

                                //扣除积分
                                if (model.point < 0)
                                {
                                    new BLL.user_point_log().Add(model.user_id, model.user_name, model.point, "换购扣除积分,订单号:" + model.order_no, false);
                                }
//.........这里部分代码省略.........
开发者ID:wujiang1984,项目名称:WechatBuilder,代码行数:101,代码来源:notify_url.aspx.cs

示例11: Page_Load


//.........这里部分代码省略.........
                                        {
                                            Response.Write("订单金额和支付金额不相符");
                                            return;
                                        }
                                        model.trade_no = trade_no;
                                        model.status = 1;
                                        model.complete_time = DateTime.Now;
                                        bool result = bll.Update(model);
                                        if (!result)
                                        {
                                            Response.Write("修改订单状态失败");
                                            return;
                                        }
                                    }
                                    else if (order_no.StartsWith("B")) //商品订单
                                    {
                                        BLL.orders bll = new BLL.orders();
                                        Model.orders model = bll.GetModel(order_no);
                                        if (model == null)
                                        {
                                            Response.Write("该订单号不存在");
                                            return;
                                        }
                                        if (model.payment_status == 2) //已付款
                                        {
                                            Response.Write("success");
                                            return;
                                        }
                                        if (model.order_amount != (decimal.Parse(total_fee) / 100))
                                        {
                                            Response.Write("订单金额和支付金额不相符");
                                            return;
                                        }
                                        bool result = bll.UpdateField(order_no, "trade_no='" + trade_no + "',status=2,payment_status=2,payment_time='" + DateTime.Now + "'");
                                        if (!result)
                                        {
                                            Response.Write("修改订单状态失败");
                                            return;
                                        }
                                        //扣除积分
                                        if (model.point < 0)
                                        {
                                            new BLL.user_point_log().Add(model.user_id, model.user_name, model.point, "换购扣除积分,订单号:" + model.order_no, false);
                                        }
                                    }
                                    //给财付通系统发送成功信息,财付通系统收到此结果后不再进行后续通知
                                    Response.Write("success");
                                }
                                else
                                {
                                    Response.Write("即时到账支付失败");
                                }
                                #endregion
                            }
                            else if ("2".Equals(trade_mode)) //担保交易
                            {
                                #region 担保交易处理方法====================================
                                if ("0".Equals(trade_state)) //付款成功
                                {
                                    if (order_no.StartsWith("R")) //充值订单
                                    {
                                        BLL.user_amount_log bll = new BLL.user_amount_log();
                                        Model.user_amount_log model = bll.GetModel(order_no);
                                        if (model == null)
                                        {
                                            Response.Write("该订单号不存在");
开发者ID:wangjinfang,项目名称:DTCMS,代码行数:67,代码来源:notify_url.aspx.cs

示例12: lbtnConfirm_Click

 //确认订单
 protected void lbtnConfirm_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("orders", DTEnums.ActionEnum.Edit.ToString()); //检查权限
     BLL.orders bll = new BLL.orders();
     Model.orders model = bll.GetModel(this.id);
     //检查订单状态
     if (model == null || model.status > 1)
     {
         JscriptMsg("订单不符合要求,无法确认!", "", "Error");
         return;
     }
     //检查支付方式
     Model.payment payModel = new BLL.payment().GetModel(model.payment_id);
     if (payModel == null)
     {
         JscriptMsg("支付方式不存在,无法确认!", "", "Error");
         return;
     }
     //如果支付方式为线上支付,则检查付款状态
     if (payModel.type == 1)
     {
         if (model.payment_status != 2)
         {
             JscriptMsg("订单未付款,无法确认!", "", "Error");
             return;
         }
     }
     bll.UpdateField(this.id, "status=2,confirm_time='" + DateTime.Now + "'");
     JscriptMsg("订单确认成功!", "order_edit.aspx?id=" + this.id, "Success");
 }
开发者ID:sichina,项目名称:or-dtcms2.0,代码行数:31,代码来源:order_edit.aspx.cs

示例13: Page_Load

        protected string v_pstring; //支付状态描述

        #endregion Fields

        #region Methods

        protected void Page_Load(object sender, EventArgs e)
        {
            //读取站点配置信息
            Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig();
            Config xmlConfig = new Config(); //读取配置

            v_oid = DTRequest.GetString("v_oid").ToUpper();
            v_pstatus = DTRequest.GetString("v_pstatus");
            v_pstring = DTRequest.GetString("v_pstring");
            v_pmode = DTRequest.GetString("v_pmode");
            v_md5str = DTRequest.GetString("v_md5str");
            v_amount = DTRequest.GetString("v_amount");
            v_moneytype = DTRequest.GetString("v_moneytype");
            remark1 = DTRequest.GetString("remark1");
            remark2 = DTRequest.GetString("remark2");

            // 拼凑加密串
            string signtext = v_oid + v_pstatus + v_amount + v_moneytype + xmlConfig.Key;
            signtext = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(signtext, "md5").ToUpper();

            if (signtext == v_md5str && v_pstatus.Equals("20"))
            {
                //成功状态
                if (v_oid.StartsWith("R")) //充值订单
                {
                    BLL.user_recharge bll = new BLL.user_recharge();
                    Model.user_recharge model = bll.GetModel(v_oid);
                    if (model == null)
                    {
                        Response.Write("error");
                        return;
                    }
                    if (model.status == 1) //已成功
                    {
                        Response.Write("ok");
                        return;
                    }
                    if (model.amount != decimal.Parse(v_amount))
                    {
                        Response.Write("error");
                        return;
                    }
                    bool result = bll.Confirm(v_oid);
                    if (!result)
                    {
                        Response.Write("error");
                        return;
                    }
                }
                else if (v_oid.StartsWith("B")) //商品订单
                {
                    BLL.orders bll = new BLL.orders();
                    Model.orders model = bll.GetModel(v_oid);
                    if (model == null)
                    {
                        Response.Write("error");
                        return;
                    }
                    if (model.payment_status == 2) //已付款
                    {
                        Response.Write("ok");
                        return;
                    }
                    if (model.order_amount != decimal.Parse(v_amount))
                    {
                        Response.Write("error");
                        return;
                    }
                    bool result = bll.UpdateField(v_oid, "status=2,payment_status=2,payment_time='" + DateTime.Now + "'");
                    if (!result)
                    {
                        Response.Write("error");
                        return;
                    }

                    //扣除积分
                    if (model.point < 0)
                    {
                        new BLL.user_point_log().Add(model.user_id, model.user_name, model.point, "换购扣除积分,订单号:" + model.order_no, false);
                    }
                }

                //成功状态
                Response.Write("ok");
                return;
            }

            //失败状态
            Response.Write("error");
            return;
        }
开发者ID:uwitec,项目名称:MWMS,代码行数:97,代码来源:notify_url.aspx.cs

示例14: ProcessRequest


//.........这里部分代码省略.........
                model.mobile = uaddrList[0].tel;
                model.area = uaddrList[0].province;
                model.city = uaddrList[0].city;
                model.district = uaddrList[0].area;
                model.address = uaddrList[0].province + " " + uaddrList[0].city + " " + uaddrList[0].area + " " + uaddrList[0].addrDetail;
                model.message = "";
                model.payable_amount = payable_amount;//应付商品总金额
                model.real_amount = payable_amount;//实际商品总金额,
                model.status = 1;
                model.express_status = 1;
                model.express_fee = expModel.express_fee; //物流费用

                if (payment_id == 1)
                {  //货到付款,需要确认订单
                    model.payment_status = 0; //标记未付款
                }
                else
                {//先款后货
                    model.payment_status = 1; //标记未付款
                }
                bool quicklyFH = false;
                //如果是先款后货的话
                if (payment_id == 3)
                {

                    if (payModel.poundage_type == 1) //百分比
                    {
                        model.payment_fee = model.real_amount * payModel.poundage_amount / 100;
                    }
                    else //固定金额
                    {
                        model.payment_fee = payModel.poundage_amount;
                    }
                    BLL.wx_payment_wxpay wxBll = new BLL.wx_payment_wxpay();
                    Model.wx_payment_wxpay wxpay = wxBll.GetModelByWid(wid);
                    quicklyFH = wxpay.quicklyFH;

                }
                if (quicklyFH)
                {
                    model.express_status = 0;
                }
                //订单总金额=实付商品金额+运费+支付手续费
                model.order_amount = model.real_amount + model.express_fee + model.payment_fee;
                //购物积分,可为负数
                model.point = 0;
                model.add_time = DateTime.Now;
                //商品详细列表
                List<Model.order_goods> gls = new List<Model.order_goods>();
                foreach (Model.cartProduct item in cartList)
                {
                    gls.Add(new Model.order_goods { goods_id = item.productId, goods_title = item.productName, goods_price = item.totPrice, real_price = item.totPrice, quantity = item.productNum, point = 0 });
                }
                model.order_goods = gls;
                int result = new BLL.orders().Add(model);
                if (result < 1)
                {
                    context.Response.Write("{\"errCode\":3, \"msg\":\"订单保存过程中发生错误,请重新提交!\"}");
                    return;
                }

                //清空购物车
                cartBll.RemoveCartInfo(wid, openid);
                //提交成功,返回URL  order_no
                context.Response.Write("{\"errCode\":true, \"payType\":\"" + payment_id + "\", \"order_no\":\"" + model.order_no + "\",\"orderid\":\"" + result + "\",\"wid\":\"" + wid + "\",\"openid\":\"" + openid + "\",\"payable_amount\":\"" + payable_amount + "\", \"msg\":\"恭喜您,订单已成功提交!\"}");
                return;
                #endregion
            }
            else if (_action == "order_canel")
            {
                #region  //取消订单
                int orderid = MyCommFun.RequestInt("order_id");
                BLL.orders oBll = new BLL.orders();
                oBll.UpdateField(orderid, "status=4");
                context.Response.Write("{\"errCode\":true, \"msg\":\"订单已取消!\"}");
                #endregion

            }
            else if (_action == "shouhuo")
            {
                #region  //确认收货
                int orderid = MyCommFun.RequestInt("order_id");
                BLL.orders oBll = new BLL.orders();
                Model.orders order = oBll.GetModel(orderid);
                if (order.payment_id == 1)
                {
                    //货到付款
                    oBll.UpdateField(orderid, "express_status=2,payment_status=2 , status=3");
                }
                else
                {
                    //在线支付
                    oBll.UpdateField(orderid, "express_status=2,payment_status=2 , status=3");
                }

                context.Response.Write("{\"errCode\":true, \"msg\":\"确人收货!\"}");
                #endregion

            }
        }
开发者ID:yi724926089,项目名称:MyWx,代码行数:101,代码来源:shopmgr.ashx.cs

示例15: cancel_order

        private void cancel_order(HttpContext context)
        {
            int order_id = DTRequest.GetQueryInt("order_id");
            BLL.orders bll_order = new BLL.orders();
            Model.users model_user = new BasePage().GetUserInfo();
            if (model_user == null)
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"请先登录!\"}");
                return;
            }

            Model.orders model_order = bll_order.GetModel(order_id);
            if (model_order == null)
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"该订单不存在或已删除!\"}");
                return;
            }

            if (!bll_order.UpdateField(model_order.order_no, "status=4"))
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"取消订单失败!\"}");
                return;
            }
            else
            {
                context.Response.Write("{\"status\":\"1\", \"msg\":\"取消订单成功!\"}");
                return;
            }
        }
开发者ID:wangjinfang,项目名称:DTCMS,代码行数:29,代码来源:submit_ajax.ashx.cs


注:本文中的BLL.orders.UpdateField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。