39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using RIZO.Client.Entity;
|
|
using RIZO.Client.IBLL;
|
|
using RIZO.Client.IDAL;
|
|
|
|
namespace RIZO.Client.BLL
|
|
{
|
|
public class UserBLL : IUserBLL
|
|
{
|
|
IUserDal _userDal;
|
|
public UserBLL(IUserDal userDal)
|
|
{
|
|
_userDal = userDal;
|
|
}
|
|
public async Task<List<UserEntity>> GetAll()
|
|
{
|
|
string usersStr = await _userDal.GetAll();
|
|
return Newtonsoft.Json.JsonConvert.DeserializeObject<List<UserEntity>>(usersStr);
|
|
}
|
|
|
|
public async Task<List<RoleEntity>> GetRolesByUserId(int userId)
|
|
{
|
|
var rolesStr = await _userDal.GetRolesByUserId(userId);
|
|
return Newtonsoft.Json.JsonConvert.DeserializeObject<List<RoleEntity>>(rolesStr);
|
|
}
|
|
|
|
public Task ResetPassword(string userId)
|
|
{
|
|
return _userDal.ResetPassword(userId);
|
|
}
|
|
|
|
public Task SaveUser(UserEntity userEntity)
|
|
{
|
|
return _userDal.SaveUser(Newtonsoft.Json.JsonConvert.SerializeObject(userEntity));
|
|
}
|
|
}
|
|
}
|