using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using BookShopOnline.Bll;
using BookShopOnline.Model;

public partial class UserCenter_Login:Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void SubmitClick(object sender, EventArgs e)
    {
        User userLogined= new UserBll().CheckUserLogin(UserLogin1._UserName.Text, UserLogin1._UserPwd.Text, Role.RegisterUser);

        if (userLogined!=null)
        {
            UserState.SetUserLogined(userLogined);

            string backUrl = PageHelper.GetUrlParmValue(UrlParmName.BackUrl);

            if (string.IsNullOrEmpty(backUrl))
                Response.Redirect("~/Default.aspx");
            else
                Response.Redirect(backUrl);
        }
        else
        {
            UserLogin1._Msg.Text = "用户名或密码错误！请重试。";
            UserLogin1._UserPwd.Focus();
        }
    }
}
