Exemple #1
0
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     action   = HotoRequest.GetQueryString("action");
     username = HotoRequest.GetQueryString("username");
     //检查是否关闭会员注册服务
     if (action == "" && uconfig.regstatus == 0)
     {
         HttpContext.Current.Response.Redirect(linkurl("register") + "?action=close");
         return;
     }
     //Email验证
     if (action == "checkmail")
     {
         string               strcode = HotoRequest.GetQueryString("strcode");
         Hoto.BLL.user_code   bll     = new Hoto.BLL.user_code();
         Hoto.Model.user_code model   = bll.GetModel(strcode);
         if (model == null) //返回出错
         {
             HttpContext.Current.Response.Redirect(linkurl("register") + "?action=checkerror");
             return;
         }
         //修改申请码状态
         model.status = 1;
         bll.Update(model);
         //修改用户状态
         new Hoto.BLL.users().UpdateField(model.user_id, "is_lock=0");
     }
 }
Exemple #2
0
 /// <summary>
 /// 重写虚方法,此方法在Init事件执行
 /// </summary>
 protected override void InitPage()
 {
     id = HotoRequest.GetQueryInt("id");
     Hoto.BLL.user_message bll = new Hoto.BLL.user_message();
     if (!bll.Exists(id))
     {
         HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
         return;
     }
     model = bll.GetModel(id);
     //设为已阅读状态
     bll.UpdateField(id, "is_read=1,read_time='" + DateTime.Now + "'");
 }
 /// <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();
     }
 }
Exemple #4
0
 /// <summary>
 /// 重写父类的虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     action = HotoRequest.GetQueryString("action");
     if (action == "reset")
     {
         string strcode = HotoRequest.GetQueryString("code");
         if (strcode != null)
         {
             model = new Hoto.BLL.user_code().GetModel(strcode);
             if (model == null)
             {
                 HttpContext.Current.Response.Redirect(linkurl("repassword", "error"));
                 return;
             }
         }
     }
 }
Exemple #5
0
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     id   = HotoRequest.GetQueryInt("id");
     page = HotoRequest.GetQueryString("page");
     Hoto.BLL.article bll = new Hoto.BLL.article();
     if (id > 0)
     {
         if (!bll.Exists(id))
         {
             HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
             return;
         }
         model = bll.GetContentModel(id);
     }
     else if (!string.IsNullOrEmpty(page))
     {
         if (!bll.ContentExists(page))
         {
             HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
             return;
         }
         model = bll.GetContentModel(page);
     }
     else
     {
         Server.Transfer("error.aspx");
         return;
     }
     //浏览数+1
     bll.UpdateField(model.id, "click=click+1");
     //跳转URL
     if (model.link_url != null)
     {
         model.link_url = model.link_url.Trim();
     }
     if (!string.IsNullOrEmpty(model.link_url))
     {
         HttpContext.Current.Response.Redirect(model.link_url);
     }
 }
Exemple #6
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"));
            }
        }
Exemple #7
0
 protected int totalcount;   //OUT数据总数
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     page        = HotoRequest.GetQueryInt("page", 1);
     category_id = HotoRequest.GetQueryInt("category_id");
 }
Exemple #8
0
 protected int totalcount;                //OUT数据总数
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     page    = HotoRequest.GetQueryInt("page", 1);
     keyword = HotoRequest.GetQueryString("keyword").Replace("'", "");
 }
Exemple #9
0
        protected int totalcount;   //OUT数据总数

        /// <summary>
        /// 重写虚方法,此方法在Init事件执行
        /// </summary>
        protected override void InitPage()
        {
            action = HotoRequest.GetQueryString("action");
            page   = HotoRequest.GetQueryInt("page", 1);
        }
Exemple #10
0
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     msg = HotoRequest.GetQueryString("msg");
 }
Exemple #11
0
 /// <summary>
 /// 重写父类的虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     action     = HotoRequest.GetQueryString("action");
     this.Init += new EventHandler(shopping_Init); //加入Init事件
 }
Exemple #12
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;
            }
        }