using CollaborativePlatformMain.DFEntity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CollaborativePlatformMain.Util
{
///
///
/// 文件名(File Name): LoginUtil.cs
///
/// 描述(Description): 登陆工具类
///
/// 数据表(Tables): nothing
///
/// 作者(Author): Ou Rui Song
///
/// 日期(Create Date): 2024年4月20日15:23:47
///
/// 修改记录(Revision History):
/// R1:
/// 修改作者:
/// 修改日期:
/// 修改理由:
///
///
public class LoginUtil
{
///
/// 用户名和密码
///
public static List UserInfos = new List() { new UserInformationEntity("1", "1") };
///
/// 验证登陆
///
///
///
///
public static bool VerifyLoginMethod(string userName, string pwd)
{
bool success = false;
foreach (var userInfo in UserInfos)
{
if (userInfo.UserName.Equals(userName) && userInfo.UserPwd.Equals(pwd))
{
success = true;
break;
}
}
return success;
}
///
/// 注册
///
///
public static bool RegisterMethod(string userName, string pwd)
{
try
{
UserInfos.Add(new UserInformationEntity(userName, pwd));
}
catch (Exception e)
{
return false;
}
return true;
}
}
}