业务层类不能调用
小弟学生,在用.net学做一个简单三层结构的系统,还没有入门,一开始登陆都搞不定,希望各位高手指教。具体代码如下,
Login页的代码
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Evaluation.BusinessLogicLayer;
namespace Evaluation.Web
{
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnLogin_Click(object sender, EventArgs e)
{
string LoginAccount = txtUserName.Text; //用户登录名
string password = txtPwd.Text; //密码
Admin admin = new Admin();
admin.LoadData(LoginAccount);
Session.Add("Aid", admin.Aid);
if (admin.Exist) //如果用户存在
{
if (admin.Apwd == password) //如果密码正确,转入管理员页面
{
Response.Redirect("Admin.aspx");
}
else //如果密码错误,给出提示,光标停留在密码框中
{
Response.Write("<Script Language=JavaScript>alert(\"密码错误,请重新输入密码!\")</Script>");
}
}
else //如果用户不存在
{
Response.Write("<Script Language=JavaScript>alert(\"对不起,用户不存在!\")</Script>");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Login.aspx");
}
}
}
管理员admin的类定义如下:
using System;
using System.Collections;
using System.Data;
using Evaluation.DataAccessLayer;
using Evaluation.DataAccessHelper;
namespace Evaluation.BusinessLogicLayer
{
/// <summary>
/// admin 的摘要说明
/// </summary>
public class Admin
{
#region 私有成员
private int _Aid;
private string _Aaccount;
private string _Apwd;
private string _Aname;
private bool _Exist;
#endregion
#region 属性
public int Aid
{
set
{
this._Aid = value;
}
get
{
return this._Aid;
}
}
public string Aaccount
{
set
{
this._Aaccount = value;
}
get
{
return this._Aaccount;
}
}
public string Apwd
{
set
{
this._Apwd = value;
}
get
{
return this._Apwd;
}
}
public string Aname
{
set
{
this._Aname = value;
}
get
{