예제 #1
0
        /// <summary>
        /// 重写虚方法,此方法在Init事件执行
        /// </summary>
        protected override void InitPage()
        {
            action = HotoRequest.GetQueryString("action");

            //获得最后登录日志
            DataTable dt = new Hoto.BLL.user_login_log().GetList(2, "user_name='" + userModel.user_name + "'", "id desc").Tables[0];
            if (dt.Rows.Count == 2)
            {
                curr_login_ip = dt.Rows[0]["login_ip"].ToString();
                pre_login_ip = dt.Rows[1]["login_ip"].ToString();
                pre_login_time = dt.Rows[1]["login_time"].ToString();
            }
            else if (dt.Rows.Count == 1)
            {
                curr_login_ip = dt.Rows[0]["login_ip"].ToString();
            }
            //未完成订单
            total_order = new Hoto.BLL.orders().GetCount("user_name='" + userModel.user_name + "' and status<3");
            //未读短信息
            total_msg = new Hoto.BLL.user_message().GetCount("accept_user_name='" + userModel.user_name + "' and is_read=0");

            //退出登录==========================================================
            if (action == "exit")
            {
                //清险Session
                HttpContext.Current.Session[HotoKeys.SESSION_USER_INFO] = null;
                //清除Cookies
                HotoUtils.WriteCookie(HotoKeys.COOKIE_USER_NAME_REMEMBER, "DTcms", -43200);
                HotoUtils.WriteCookie(HotoKeys.COOKIE_USER_PWD_REMEMBER, "DTcms", -43200);
                HotoUtils.WriteCookie("UserName", "DTcms", -1);
                HotoUtils.WriteCookie("Password", "DTcms", -1);
                //自动登录,跳转URL
                HttpContext.Current.Response.Redirect(linkurl("login"));
            }
        }
예제 #2
0
        /// <summary>
        /// 返回订单状态
        /// </summary>
        /// <param name="_id">订单ID</param>
        /// <returns>String</returns>
        protected string get_order_status(int _id)
        {
            string _title = "";

            Hoto.Model.orders model = new Hoto.BLL.orders().GetModel(_id);
            switch (model.status)
            {
            case 1:
                _title = "等待确认";
                Hoto.Model.payment payModel = new Hoto.BLL.payment().GetModel(model.payment_id);
                if (payModel != null && payModel.type == 1)
                {
                    if (model.payment_status > 1)
                    {
                        _title = "付款成功";
                    }
                    else
                    {
                        _title = "等待付款";
                    }
                }
                break;

            case 2:
                if (model.distribution_status > 1)
                {
                    _title = "已发货";
                }
                else
                {
                    _title = "待发货";
                }
                break;

            case 3:
                _title = "交易完成";
                break;

            case 4:
                _title = "订单取消";
                break;

            case 5:
                _title = "订单作废";
                break;
            }

            return(_title);
        }
예제 #3
0
 /// <summary>
 /// 重写虚方法,此方法在Init事件执行
 /// </summary>
 protected override void InitPage()
 {
     id = HotoRequest.GetQueryInt("id");
     Hoto.BLL.orders bll = new Hoto.BLL.orders();
     if (!bll.Exists(id))
     {
         HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
         return;
     }
     model    = bll.GetModel(id);
     payModel = new Hoto.BLL.payment().GetModel(model.payment_id);
     if (payModel == null)
     {
         payModel = new Hoto.Model.payment();
     }
 }
예제 #4
0
 /// <summary>
 /// 重写虚方法,此方法在Init事件执行
 /// </summary>
 protected override void InitPage()
 {
     id = HotoRequest.GetQueryInt("id");
     Hoto.BLL.orders bll = new Hoto.BLL.orders();
     if (!bll.Exists(id))
     {
         HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
         return;
     }
     model = bll.GetModel(id);
     payModel = new Hoto.BLL.payment().GetModel(model.payment_id);
     if (payModel == null)
     {
         payModel = new Hoto.Model.payment();
     }
 }
예제 #5
0
 /// <summary>
 /// 返回订单商品列表
 /// </summary>
 /// <param name="order_id">订单</param>
 /// <returns>List</returns>
 protected List<Hoto.Model.article_goods> get_order_goods_list(int order_id)
 {
     Hoto.Model.orders model = new Hoto.BLL.orders().GetModel(order_id);
     if (model == null)
     {
         return null;
     }
     List<Hoto.Model.article_goods> ls = new List<Hoto.Model.article_goods>();
     if (model.order_goods != null)
     {
         foreach (Hoto.Model.order_goods modelt in model.order_goods)
         {
             Hoto.Model.article_goods goodsModel = new Hoto.BLL.article().GetGoodsModel(modelt.goods_id);
             if (goodsModel != null)
             {
                 ls.Add(goodsModel);
             }
         }
     }
     return ls;
 }
예제 #6
0
 /// <summary>
 /// 返回订单是否需要在线支付
 /// </summary>
 /// <param name="order_id">订单ID</param>
 /// <returns>bool</returns>
 protected bool get_order_payment_status(int order_id)
 {
     Hoto.Model.orders model = new Hoto.BLL.orders().GetModel(order_id);
     if (model == null)
     {
         return false;
     }
     if (model.status > 1)
     {
         return false;
     }
     Hoto.Model.payment payModel = new Hoto.BLL.payment().GetModel(model.payment_id);
     if (payModel == null)
     {
         return false;
     }
     if (payModel.type == 1 && model.payment_status == 1)
     {
         return true;
     }
     return false;
 }
예제 #7
0
        /// <summary>
        /// 返回订单商品列表
        /// </summary>
        /// <param name="order_id">订单</param>
        /// <returns>List</returns>
        protected List <Hoto.Model.article_goods> get_order_goods_list(int order_id)
        {
            Hoto.Model.orders model = new Hoto.BLL.orders().GetModel(order_id);
            if (model == null)
            {
                return(null);
            }
            List <Hoto.Model.article_goods> ls = new List <Hoto.Model.article_goods>();

            if (model.order_goods != null)
            {
                foreach (Hoto.Model.order_goods modelt in model.order_goods)
                {
                    Hoto.Model.article_goods goodsModel = new Hoto.BLL.article().GetGoodsModel(modelt.goods_id);
                    if (goodsModel != null)
                    {
                        ls.Add(goodsModel);
                    }
                }
            }
            return(ls);
        }
예제 #8
0
 /// <summary>
 /// 返回订单是否需要在线支付
 /// </summary>
 /// <param name="order_id">订单ID</param>
 /// <returns>bool</returns>
 protected bool get_order_payment_status(int order_id)
 {
     Hoto.Model.orders model = new Hoto.BLL.orders().GetModel(order_id);
     if (model == null)
     {
         return(false);
     }
     if (model.status > 1)
     {
         return(false);
     }
     Hoto.Model.payment payModel = new Hoto.BLL.payment().GetModel(model.payment_id);
     if (payModel == null)
     {
         return(false);
     }
     if (payModel.type == 1 && model.payment_status == 1)
     {
         return(true);
     }
     return(false);
 }
예제 #9
0
        /// <summary>
        /// 返回订单状态
        /// </summary>
        /// <param name="_id">订单ID</param>
        /// <returns>String</returns>
        protected string get_order_status(int _id)
        {
            string _title = "";
            Hoto.Model.orders model = new Hoto.BLL.orders().GetModel(_id);
            switch (model.status)
            {
                case 1:
                    _title = "等待确认";
                    Hoto.Model.payment payModel = new Hoto.BLL.payment().GetModel(model.payment_id);
                    if (payModel != null && payModel.type == 1)
                    {
                        if (model.payment_status > 1)
                        {
                            _title = "付款成功";
                        }
                        else
                        {
                            _title = "等待付款";
                        }
                    }
                    break;
                case 2:
                    if (model.distribution_status > 1)
                    {
                        _title = "已发货";
                    }
                    else
                    {
                        _title = "待发货";
                    }
                    break;
                case 3:
                    _title = "交易完成";
                    break;
                case 4:
                    _title = "订单取消";
                    break;
                case 5:
                    _title = "订单作废";
                    break;
            }

            return _title;
        }
예제 #10
0
        /// <summary>
        /// 将在Init事件执行
        /// </summary>
        protected void payment_Init(object sender, EventArgs e)
        {
            //取得处事类型
            action = HotoRequest.GetString("action");
            order_type = HotoRequest.GetString("order_type");
            order_no = HotoRequest.GetString("order_no");

            switch (action)
            {
                case "confirm":
                    if (string.IsNullOrEmpty(action) || string.IsNullOrEmpty(order_type) || string.IsNullOrEmpty(order_no))
                    {
                        HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,URL传输参数有误!"));
                        return;
                    }
                    //检查用户是否登录
                    userModel = new Web.UI.BasePage().GetUserInfo();
                    if (userModel == null)
                    {
                        //用户未登录
                        HttpContext.Current.Response.Redirect(linkurl("payment", "login"));
                        return;
                    }
                    //检查订单的类型(充值或购物)
                    if (order_type == HotoEnums.AmountTypeEnum.Recharge.ToString()) //充值
                    {
                        amountModel = new Hoto.BLL.amount_log().GetModel(order_no);
                        if (amountModel == null)
                        {
                            HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,订单号不存在或已删除!"));
                            return;
                        }
                        //检查订单号是否已支付
                        if (amountModel.status == 1)
                        {
                            HttpContext.Current.Response.Redirect(linkurl("payment1", "succeed", order_type, amountModel.order_no));
                            return;
                        }
                        //检查支付方式
                        payModel = new Hoto.BLL.payment().GetModel(amountModel.payment_id);
                        if (payModel == null)
                        {
                            HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,支付方式不存在或已删除!"));
                            return;
                        }
                        //检查是否线上支付
                        if (payModel.type == 2)
                        {
                            HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,账户充值不允许线下支付!"));
                            return;
                        }
                        order_amount = amountModel.value; //订单金额
                    }
                    else if (order_type == HotoEnums.AmountTypeEnum.BuyGoods.ToString()) //购物
                    {
                        //检查订单是否存在
                        orderModel = new Hoto.BLL.orders().GetModel(order_no);
                        if (orderModel == null)
                        {
                            HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,订单号不存在或已删除!"));
                            return;
                        }
                        //检查是否已支付过
                        if (orderModel.payment_status == 2)
                        {
                            HttpContext.Current.Response.Redirect(linkurl("payment1", "succeed", order_type, orderModel.order_no));
                            return;
                        }
                        //检查支付方式
                        payModel = new Hoto.BLL.payment().GetModel(orderModel.payment_id);
                        if (payModel == null)
                        {
                            HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,支付方式不存在或已删除!"));
                            return;
                        }
                        //检查是否线下付款
                        if (payModel.type == 2)
                        {
                            HttpContext.Current.Response.Redirect(linkurl("payment1", "succeed", order_type, orderModel.order_no));
                            return;
                        }
                        //检查是否积分换购,直接跳转成功页面
                        if (orderModel.order_amount == 0)
                        {
                            //修改订单状态
                            bool result = new Hoto.BLL.orders().UpdateField(orderModel.order_no, "payment_status=2,payment_time='" + DateTime.Now + "'");
                            if (!result)
                            {
                                HttpContext.Current.Response.Redirect(linkurl("payment", "error"));
                                return;
                            }
                            HttpContext.Current.Response.Redirect(linkurl("payment1", "succeed", order_type, orderModel.order_no));
                            return;
                        }
                        order_amount = orderModel.order_amount; //订单金额
                    }
                    else
                    {
                        HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,找不到您要提交的订单类型!"));
                        return;
                    }
                    break;
                case "succeed":
                    //检查订单的类型(充值或购物)
                    if (order_type == HotoEnums.AmountTypeEnum.Recharge.ToString()) //充值
                    {
                        amountModel = new Hoto.BLL.amount_log().GetModel(order_no);
                        if (amountModel == null)
                        {
                            HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,订单号不存在或已删除!"));
                            return;
                        }

                    }
                    else if (order_type == HotoEnums.AmountTypeEnum.BuyGoods.ToString()) //购物
                    {
                        orderModel = new Hoto.BLL.orders().GetModel(order_no);
                        if (orderModel == null)
                        {
                            HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,订单号不存在或已删除!"));
                            return;
                        }
                    }
                    else
                    {
                        HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,找不到您要提交的订单类型!"));
                        return;
                    }
                    break;
            }
        }
예제 #11
0
        /// <summary>
        /// 将在Init事件执行
        /// </summary>
        protected void payment_Init(object sender, EventArgs e)
        {
            //取得处事类型
            action     = HotoRequest.GetString("action");
            order_type = HotoRequest.GetString("order_type");
            order_no   = HotoRequest.GetString("order_no");

            switch (action)
            {
            case "confirm":
                if (string.IsNullOrEmpty(action) || string.IsNullOrEmpty(order_type) || string.IsNullOrEmpty(order_no))
                {
                    HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,URL传输参数有误!"));
                    return;
                }
                //检查用户是否登录
                userModel = new Web.UI.BasePage().GetUserInfo();
                if (userModel == null)
                {
                    //用户未登录
                    HttpContext.Current.Response.Redirect(linkurl("payment", "login"));
                    return;
                }
                //检查订单的类型(充值或购物)
                if (order_type == HotoEnums.AmountTypeEnum.Recharge.ToString())     //充值
                {
                    amountModel = new Hoto.BLL.amount_log().GetModel(order_no);
                    if (amountModel == null)
                    {
                        HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,订单号不存在或已删除!"));
                        return;
                    }
                    //检查订单号是否已支付
                    if (amountModel.status == 1)
                    {
                        HttpContext.Current.Response.Redirect(linkurl("payment1", "succeed", order_type, amountModel.order_no));
                        return;
                    }
                    //检查支付方式
                    payModel = new Hoto.BLL.payment().GetModel(amountModel.payment_id);
                    if (payModel == null)
                    {
                        HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,支付方式不存在或已删除!"));
                        return;
                    }
                    //检查是否线上支付
                    if (payModel.type == 2)
                    {
                        HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,账户充值不允许线下支付!"));
                        return;
                    }
                    order_amount = amountModel.value;                                //订单金额
                }
                else if (order_type == HotoEnums.AmountTypeEnum.BuyGoods.ToString()) //购物
                {
                    //检查订单是否存在
                    orderModel = new Hoto.BLL.orders().GetModel(order_no);
                    if (orderModel == null)
                    {
                        HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,订单号不存在或已删除!"));
                        return;
                    }
                    //检查是否已支付过
                    if (orderModel.payment_status == 2)
                    {
                        HttpContext.Current.Response.Redirect(linkurl("payment1", "succeed", order_type, orderModel.order_no));
                        return;
                    }
                    //检查支付方式
                    payModel = new Hoto.BLL.payment().GetModel(orderModel.payment_id);
                    if (payModel == null)
                    {
                        HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,支付方式不存在或已删除!"));
                        return;
                    }
                    //检查是否线下付款
                    if (payModel.type == 2)
                    {
                        HttpContext.Current.Response.Redirect(linkurl("payment1", "succeed", order_type, orderModel.order_no));
                        return;
                    }
                    //检查是否积分换购,直接跳转成功页面
                    if (orderModel.order_amount == 0)
                    {
                        //修改订单状态
                        bool result = new Hoto.BLL.orders().UpdateField(orderModel.order_no, "payment_status=2,payment_time='" + DateTime.Now + "'");
                        if (!result)
                        {
                            HttpContext.Current.Response.Redirect(linkurl("payment", "error"));
                            return;
                        }
                        HttpContext.Current.Response.Redirect(linkurl("payment1", "succeed", order_type, orderModel.order_no));
                        return;
                    }
                    order_amount = orderModel.order_amount;     //订单金额
                }
                else
                {
                    HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,找不到您要提交的订单类型!"));
                    return;
                }
                break;

            case "succeed":
                //检查订单的类型(充值或购物)
                if (order_type == HotoEnums.AmountTypeEnum.Recharge.ToString())     //充值
                {
                    amountModel = new Hoto.BLL.amount_log().GetModel(order_no);
                    if (amountModel == null)
                    {
                        HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,订单号不存在或已删除!"));
                        return;
                    }
                }
                else if (order_type == HotoEnums.AmountTypeEnum.BuyGoods.ToString())     //购物
                {
                    orderModel = new Hoto.BLL.orders().GetModel(order_no);
                    if (orderModel == null)
                    {
                        HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,订单号不存在或已删除!"));
                        return;
                    }
                }
                else
                {
                    HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,找不到您要提交的订单类型!"));
                    return;
                }
                break;
            }
        }