📄 userloginbl.cs
字号:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BRISDataAccess.Entity;
using BRISDataAccess.DataAccess;
namespace BEISBusinessLogic.BusinessLogic
{
public class UserLoginBL
{
LoginStore loginStore = new LoginStore();
EmployeesStore employeesStore = new EmployeesStore();
//define a method, Check user longon by means of importing patameter (loginName,passWord, out ticket,out employeeID)
public bool CheckLogon(string loginName, string passWord, out string ticket, out int employeeID)
{
EmployeesCollection employeesList = employeesStore.GetEmployessInfo(loginName, passWord);
if (employeesList.Count != 0)
{
ticket = System.Guid.NewGuid().ToString();
employeeID = employeesList[0].EmployeeID;
UserEntity userEntity = new UserEntity();
userEntity.UserID = employeeID;
userEntity.UserGuid = ticket;
UserCollection userList=loginStore.GetUsersInfo(employeeID);
if (userList.Count == 0)
{
loginStore.InsertUser(userEntity);
}
else
{
loginStore.UpdataUsersGuid(ticket, employeeID);
}
return true;
}
else
{
ticket = "";
employeeID = -1;
return false;
}
}
public string userLonginSecurity(int operatorID, string ticket)
{
string expMsg = "";
UserCollection userLonginList = loginStore.GetUserLonginInfo(operatorID, ticket);
if (userLonginList.Count == 0)
{
expMsg = "你无权限使用";
return expMsg;
}
return expMsg;
}
//define a method ,Detele UsersLogin infomation by means of importing parameter ( employeeID )
public void DeleteLogin(Nullable<int> employeeID,string ticket)
{
loginStore.DeleteUsersInfo(employeeID,ticket);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -