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


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

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


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

示例1: btnConfirm_Click

 //确认订单
 protected void btnConfirm_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("order_list", DTEnums.ActionEnum.Confirm.ToString()); //检查权限
     int sucCount = 0;
     int errorCount = 0;
     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)
             {
                 //检查订单是否使用在线支付方式
                 if (model.payment_status > 0)
                 {
                     //在线支付方式
                     model.payment_status = 2; //标志已付款
                     model.payment_time = DateTime.Now; //支付时间
                     model.status = 2; // 订单为确认状态
                     model.confirm_time = DateTime.Now; //确认时间
                 }
                 else
                 {
                     //线下支付方式
                     model.status = 2; // 订单为确认状态
                     model.confirm_time = DateTime.Now; //确认时间
                 }
                 if (bll.Update(model))
                 {
                     sucCount++;
                 }
                 else
                 {
                     errorCount++;
                 }
             }
             else
             {
                 errorCount++;
             }
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Confirm.ToString(), "确认订单成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
     JscriptMsg("确认成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("order_confirm.aspx", "keywords={0}", this.keywords), "Success");
 }
开发者ID:LutherW,项目名称:MTMS,代码行数:49,代码来源:order_confirm.aspx.cs

示例2: edit_order_status

        private void edit_order_status(HttpContext context)
        {
            //取得管理员登录信息
            Model.manager adminInfo = new Web.UI.ManagePage().GetAdminInfo();
            if (adminInfo == null)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"未登录或已超时,请重新登录!\"}");
                return;
            }
            //取得站点配置信息
            Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig();
            //取得订单配置信息
            Model.orderconfig orderConfig = new BLL.orderconfig().loadConfig();

            string order_no = MXRequest.GetString("order_no");
            string edit_type = MXRequest.GetString("edit_type");
            if (order_no == "")
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"传输参数有误,无法获取订单号!\"}");
                return;
            }
            if (edit_type == "")
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"无法获取修改订单类型!\"}");
                return;
            }

            BLL.orders bll = new BLL.orders();
            Model.orders model = bll.GetModel(order_no);
            if (model == null)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"订单号不存在或已被删除!\"}");
                return;
            }
            switch (edit_type.ToLower())
            {
                case "order_confirm": //确认订单
                    //检查权限
                    if (!new BLL.manager_role().Exists(adminInfo.role_id, "order_list", MXEnums.ActionEnum.Confirm.ToString()))
                    {
                        context.Response.Write("{\"status\": 0, \"msg\": \"您没有确认订单的权限!\"}");
                        return;
                    }
                    if (model.status > 1)
                    {
                        context.Response.Write("{\"status\": 0, \"msg\": \"订单已经确认,不能重复处理!\"}");
                        return;
                    }
                    model.status = 2;
                    model.confirm_time = DateTime.Now;
                    if (!bll.Update(model))
                    {
                        context.Response.Write("{\"status\": 0, \"msg\": \"订单确认失败!\"}");
                        return;
                    }
                    new BLL.manager_log().Add(adminInfo.id, adminInfo.user_name, MXEnums.ActionEnum.Confirm.ToString(), "确认订单号:" + model.order_no); //记录日志
                    #region 发送短信或邮件
                    if (orderConfig.confirmmsg > 0)
                    {
                        switch (orderConfig.confirmmsg)
                        {
                            case 1: //短信通知
                                if (string.IsNullOrEmpty(model.mobile))
                                {
                                    context.Response.Write("{\"status\": 1, \"msg\": \"订单确认成功,但无法发送短信<br/ >对方未填写手机号码!\"}");
                                    return;
                                }
                                Model.sms_template smsModel = new BLL.sms_template().GetModel(orderConfig.confirmcallindex); //取得短信内容
                                if (smsModel == null)
                                {
                                    context.Response.Write("{\"status\": 1, \"msg\": \"订单确认成功,但无法发送短信<br/ >短信通知模板不存在!\"}");
                                    return;
                                }
                                //替换标签
                                string msgContent = smsModel.content;
                                msgContent = msgContent.Replace("{webname}", siteConfig.webname);
                                msgContent = msgContent.Replace("{username}", model.user_name);
                                msgContent = msgContent.Replace("{orderno}", model.order_no);
                                msgContent = msgContent.Replace("{amount}", model.order_amount.ToString());
                                //发送短信
                                string tipMsg = string.Empty;
                                bool sendStatus = new BLL.sms_message().Send(model.mobile, msgContent, 2, out tipMsg);
                                if (!sendStatus)
                                {
                                    context.Response.Write("{\"status\": 1, \"msg\": \"订单确认成功,但无法发送短信<br/ >" + tipMsg + "\"}");
                                    return;
                                }
                                break;
                            case 2: //邮件通知
                                //取得用户的邮箱地址
                                if (model.user_id > 0)
                                {
                                    Model.users userModel = new BLL.users().GetModel(model.user_id);
                                    if (userModel == null || string.IsNullOrEmpty(userModel.email))
                                    {
                                        context.Response.Write("{\"status\": 1, \"msg\": \"订单确认成功,但无法发送邮件<br/ >该用户不存在或没有填写邮箱地址。\"}");
                                        return;
                                    }
                                    //取得邮件模板内容
                                    Model.mail_template mailModel = new BLL.mail_template().GetModel(orderConfig.confirmcallindex);
//.........这里部分代码省略.........
开发者ID:wujiang1984,项目名称:WechatBuilder,代码行数:101,代码来源:admin_ajax.ashx.cs

示例3: ProcessPaySuccess_wx

        /// <summary>
        /// 【微支付】 订单付款成功,处理订单:1将订单的状态改成付款完成;
        /// 
        /// </summary>
        /// <param name="beforeFunName"></param>
        /// <param name="notify_id">通知id</param>
        /// <param name="out_trade_no">商户订单号</param>
        /// <param name="transaction_id">订单交易号</param>
        /// <param name="pay_info">支付结果</param>
        /// <param name="total_fee">付款金额(单位为分)</param>
        /// <param name="otid">订单临时表id</param>
        /// <returns>有错误则返回错误信息,正确,则返回空字符串</returns>
        public string ProcessPaySuccess_wx(string beforeFunName, string notify_id, string out_trade_no, string transaction_id, string pay_info, int total_fee, int otid, int wid)
        {
            string payTmpType = "【微支付】";
            total_fee = total_fee / 100;
            BLL.orders orderBll = new BLL.orders();

            string funName = payTmpType + beforeFunName + " ProcessPaySuccess_wx ";

            BLL.wx_logs logBll = new BLL.wx_logs();
            logBll.AddLog(wid, "微支付", funName, "开始执行ProcessPaySuccess_wx方法[otid:" + otid + "]");
            try
            {
                #region 数据同步前
                IList<Model.orders> orderlist = orderBll.GetModelList("id=" + otid + " and order_no='" + out_trade_no + "'");
                if (orderlist == null || orderlist.Count <= 0)
                {
                    logBll.AddLog(wid,payTmpType, funName, "订单号【" + out_trade_no + "】订单号不存在", 0);
                    return "订单号不存在";
                }
                //这个暂时不处理
                if (logBll.ExistsFlg((out_trade_no + otid)))
                {  //如果已经处理过,则不再处理
                    return "";
                }
                logBll.AddFlg(wid,payTmpType, funName, (out_trade_no + otid));//加标志,防止重复提交

                Model.orders orderEntity = orderlist[0];
                if (orderEntity.order_amount > total_fee)
                {
                    return "付款的金额(" + total_fee + ")小于订单的预付款金额(" + orderEntity.order_amount + ")信息,直接退款";
                }
                orderEntity.notify_id = notify_id;
                orderEntity.trade_no = transaction_id;
                orderEntity.pay_info = pay_info;
                orderEntity.order_amount = total_fee;
                orderEntity.payment_time = DateTime.Now;
                orderEntity.status = 2;
                orderEntity.payment_status = 2;

                //判断是否需要立即发货
                if (orderEntity.express_status == 0)
                {
                    //立即发货
                    FaHuoProc fahuo = new FaHuoProc();
                    
                    BLL.wx_payment_wxpay payBll = new BLL.wx_payment_wxpay();
                    Model.wx_payment_wxpay paymentInfo = payBll.GetModelByWid(wid);
                    Dictionary<string, object> fahuoDict = fahuo.fahuomgr(paymentInfo, orderEntity);
                    string errcode = fahuoDict["errcode"].ToString();
                    string errmsg = fahuoDict["errmsg"].ToString();
                    orderEntity.fahuoCode = errcode;
                    orderEntity.fahuoMsg = errmsg;
                    if (errcode == "0")
                    {
                        orderEntity.express_status = 2;
                        orderEntity.express_time = DateTime.Now;
                    }
                    else
                    {
                        orderEntity.express_status =1;
                    }
                }

                bool ret = orderBll.Update(orderEntity);
                if (!ret)
                {
                    logBll.AddLog(wid,payTmpType, funName, "订单号【" + out_trade_no + "】支付成功后处理数据失败", 0);
                    return "订单号【" + out_trade_no + "】支付成功后处理数据失败";
                }

                logBll.AddLog(payTmpType, funName, "订单号【" + out_trade_no + "】支付成功后,处理数据成功", 1);
                return "";

                #endregion

            }
            catch (Exception ex)
            {

                logBll.AddLog(wid,payTmpType, funName, "订单号【" + out_trade_no + "】支付成功后处理数据同步出现错误:" + ex.Message, 0);
                return null;
            }

        }
开发者ID:wujiang1984,项目名称:WechatBuilder,代码行数:96,代码来源:wxOrderTmpMgr.cs

示例4: order_pay

        private void order_pay(HttpContext context)
        {
            Model.users model = new BasePage().GetUserInfo();
            if (model == null)
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"对不起,请重新登录!\"}");
                return;
            }

            string pay_type = DTRequest.GetQueryString("pay_type");//支付类型
            int pay_ment = DTRequest.GetQueryInt("pay_ment");//支付方式
            int order_id = DTRequest.GetQueryInt("order_id");

            BLL.orders bll = new BLL.orders();
            Model.orders model_order = bll.GetModel(order_id);
            if (model_order == null)
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"订单不存在!\"}");
                return;
            }

            switch (pay_type)
            {
                case "month":
                    model_order.is_up = 3;
                    break;
                case "is_up":
                    model_order.is_up = 2;
                    break;
                case "payno":
                    model_order.is_up = 1;
                    break;
            }

            //直接支付
            BLL.payment bll_pay = new BLL.payment();
            Model.payment model_pay = new Model.payment();
            string url = "";
            if (pay_type == "payno")
            {
                model_pay = bll_pay.GetModel(pay_ment);
                if (model_pay == null)
                {
                    context.Response.Write("{\"status\":\"0\", \"msg\":\"支付方式不存在或已删除!\"}");
                    return;
                }
                model_order.payment_id = model_pay.id;
                if (model_pay.type == 1)
                {
                    //用户余额
                    if (model_pay.api_path == "balance")
                    {
                        if (model.amount < model_order.order_amount)
                        {
                            context.Response.Write("{\"status\":\"0\", \"msg\":\"对不起,您的用户余额不足请充值!\"}");
                            return;
                        }
                        decimal user_amount = model.amount - model_order.order_amount;
                        if (new BLL.users().UpdateField(model.id, "amount=" + user_amount) <= 0)
                        {
                            context.Response.Write("{\"status\":\"0\", \"msg\":\"扣除余额失败,支付失败!\"}");
                            return;
                        }
                        model_order.status = 2;
                        model_order.payment_status = 2;
                    }
                    else
                    {
                        url = siteConfig.webpath + "api/payment/" + model_pay.api_path + "/index.aspx?action=pay&pay_user_name=" + model.nick_name.Trim()
                                  + "&pay_order_type=" + DTEnums.AmountTypeEnum.BuyGoods.ToString() + "&pay_order_no=" + model_order.order_no + "&pay_order_amount=" + model_order.order_amount + "&pay_subject=商品订单";
                    }
                }
                else
                {
                    //货到付款
                }
            }

            if (!bll.Update(model_order))
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"支付方式保存失败!\"}");
                return;
            }
            else
            {
                context.Response.Write("{\"status\":\"1\", \"msg\":\"支付成功!\",\"url\":\"" + url + "\"}");
                return;
            }
        }
开发者ID:wangjinfang,项目名称:DTCMS,代码行数:89,代码来源:submit_ajax.ashx.cs


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