using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using LZBS.Model;
using LZBS.BLL;
using LZBS.Common;

namespace LZBS.Web.Admin
{
    public partial class Login : System.Web.UI.Page
    {
        M_SysLog mLog = new M_SysLog();
        B_SysLog bLog = new B_SysLog();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            M_User model = new M_User();
            B_User bll = new B_User();
            model.UserID = txtUserID.Text.Trim();
            model.Password = txtPwd.Text.Trim();
            if (bll.CheckUser(model) == true)
            {
                //账号和密码正确
                Session["UserID"] = txtUserID.Text.Trim();
                mLog.UserIP = ClientInfo.GetUserIP();
                mLog.URL = Request.Url.AbsoluteUri.ToString();
                mLog.Account = Session["UserID"].ToString();
                mLog.UserType = 0;
                mLog.OPInfo = "登录";
                bLog.AddLog(mLog);
                Response.Redirect("Index.aspx", true);
            }
            else
            {
                MyMessageBox.MessageBox("对不起，你的账号或密码输入错误", this.Page);
            }
        }
    }
}
