You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
3.7 KiB
129 lines
3.7 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Data;
|
|
|
|
namespace FangYar.BLL
|
|
{
|
|
|
|
/// <summary>
|
|
/// 用户(BLL)
|
|
/// </summary>
|
|
public class BaseUserBLL
|
|
{
|
|
private static readonly FangYar.IDAL.BaseUserIDAL dal = FangYar.DALFactory.Factory.GetBaseUserDAL();
|
|
|
|
/// <summary>
|
|
/// 根据用户ID获取用户
|
|
/// </summary>
|
|
public Model.BaseUserModel GetUserByUserID(string userID)
|
|
{
|
|
return dal.GetModelByUserID(userID);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据ID获取用户
|
|
/// </summary>
|
|
public Model.BaseUserModel GetUserByID(string ID)
|
|
{
|
|
return dal.GetModelByID(ID);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 首次登陆强制修改密码
|
|
/// </summary>
|
|
public bool InitUserPwd(Model.BaseUserModel user)
|
|
{
|
|
return dal.InitUserPwd(user);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改密码
|
|
/// </summary>
|
|
public bool ChangePwd(Model.BaseUserModel user)
|
|
{
|
|
return dal.ChangePwd(user);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 用户登录
|
|
/// </summary>
|
|
public Model.BaseUserModel UserLogin(string loginID, string loginPwd)
|
|
{
|
|
return dal.UserLogin(loginID, loginPwd);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据用户ID判断用户是否可用
|
|
/// </summary>
|
|
public Model.BaseUserModel CheckLoginByUserID(string userID)
|
|
{
|
|
return dal.CheckLoginByUserID(userID);
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 添加用户
|
|
/// </summary>
|
|
public bool AddUser(Model.BaseUserModel user)
|
|
{
|
|
FangYar.Model.BaseUserModel userCompare = dal.GetModelByUserID(user.USERS_UID);
|
|
if (userCompare != null)
|
|
{
|
|
throw new Exception("已经存在此用户!");
|
|
}
|
|
return dal.Add(user);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除用户(可批量删除,删除用户同时删除对应的权限和所处的部门)
|
|
/// </summary>
|
|
public bool DeleteUser(string IDList)
|
|
{
|
|
return dal.Delete(IDList);
|
|
}
|
|
/// <summary>
|
|
/// 修改用户账号
|
|
/// </summary>
|
|
public bool EditUser(Model.BaseUserModel user)
|
|
{
|
|
return dal.Edit(user);
|
|
}
|
|
/// <summary>
|
|
/// 修改用户账号
|
|
/// </summary>
|
|
public bool EditUser(Model.BaseUserModel user, string originalName)
|
|
{
|
|
if (user.USERS_UID != originalName && dal.GetModelByUserID(user.USERS_UID) != null)
|
|
{
|
|
throw new Exception("已经存在此用户!");
|
|
}
|
|
return dal.Edit(user);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分页
|
|
/// </summary>
|
|
/// <param name="PageIndex"></param>
|
|
/// <param name="PageSize"></param>
|
|
/// <param name="strwhere"></param>
|
|
/// <param name="order"></param>
|
|
public void QueryProc(int PageIndex, int PageSize, string strwhere, string order)
|
|
{
|
|
dal.QueryProc(PageIndex, PageSize, strwhere, order);
|
|
}
|
|
/// <summary>
|
|
/// 分页
|
|
/// </summary>
|
|
/// <param name="PageIndex"></param>
|
|
/// <param name="PageSize"></param>
|
|
/// <param name="strwhere"></param>
|
|
/// <param name="order"></param>
|
|
/// <returns></returns>
|
|
public List<FangYar.Model.BaseUserModel> QueryList(int PageIndex, int PageSize, string strwhere, string order)
|
|
{
|
|
return dal.QueryList(PageIndex, PageSize, strwhere, order);
|
|
}
|
|
}
|
|
}
|
|
|