62,046
社区成员
发帖
与我相关
我的任务
分享
//统一的接口
public interface IUser<T>
{
//插入注册用户信息
int insertUser(T u);
//删除用户
int deleteUser(T u);
//用户登陆
int userLogin(T u);
//用户注销
void userLoginOut();
//获取用户联系方式
T getUserInfor(string UserName, string Pwd);
}
实现:
Admin.cs:
public class Admin:IUser<AdminInfo>
{
#region IUser<AdminInfo> 成员
public int insertUser(AdminInfo u)
{
throw new Exception("The method or operation is not implemented.");
}
public int deleteUser(AdminInfo u)
{
throw new Exception("The method or operation is not implemented.");
}
public int userLogin(AdminInfo u)
{
throw new Exception("The method or operation is not implemented.");
}
public void userLoginOut()
{
throw new Exception("The method or operation is not implemented.");
}
public AdminInfo getUserInfor(string UserName, string Pwd)
{
throw new Exception("The method or operation is not implemented.");
}
#endregion
User.cs:
public class User : IUser<UserInfo>
{
#region IUser<UserInfo> 成员
public int insertUser(UserInfo u)
{
throw new Exception("The method or operation is not implemented.");
}
public int deleteUser(UserInfo u)
{
throw new Exception("The method or operation is not implemented.");
}
public int userLogin(UserInfo u)
{
throw new Exception("The method or operation is not implemented.");
}
public void userLoginOut()
{
throw new Exception("The method or operation is not implemented.");
}
public UserInfo getUserInfor(string UserName, string Pwd)
{
throw new Exception("The method or operation is not implemented.");
}
#endregion
}