/// <summary> /// 判断登陆是否成功 /// </summary> /// <param name="name">用户名</param> /// <param name="pwd">用户密码</param> /// <param name="msg">返回提示信息</param> /// <param name="user">返回用户信息</param> /// <returns></returns> public bool IsLogIn(string name, string pwd, out int msg, out User user) { bool r = false; user = new UserDAL().GetUserByUName(name); if (user != null) { if (user.UPwd == pwd) { msg = 1; r = true; } else { msg = 3; } } else { msg = 2; } return r; }
/// <summary> /// 判断登陆是否成功 /// </summary> /// <param name="name">用户名</param> /// <param name="pwd">用户密码</param> /// <param name="msg">返回提示信息</param> /// <param name="user">返回用户信息</param> /// <returns></returns> public bool IsLogIn(string name, string pwd, out string msg, out User user) { bool r = false; user = new UserDAL().GetUserByUName(name); if (user != null) { if (user.UPwd == pwd) { msg = "登陆成功!"; r = true; } else { msg = "密码输入有误!"; } } else { msg = "用户名输入有误!"; } return r; }