Hibajavítás hegyek
This commit is contained in:
@@ -21,14 +21,16 @@ namespace WorkFlowCheck.Web.Services.Interfaces
|
||||
Task<UserRoleDTO> GetUserRole(int id);
|
||||
Task<List<UserRoleDTO>> GetAllUserRoles();
|
||||
Task<ApiResponseDTO<UserRoleDTO>> UpdateUserRole(UserRoleDTO userRoleDTO);
|
||||
|
||||
Task<bool> DeleteUserRole(int id);
|
||||
|
||||
Task<RoleCheckListTemplateHeaderDTO> GetRoleCheckListTemplateHeader(int id);
|
||||
Task<List<RoleCheckListTemplateHeaderDTO>> GetAllRoleCheckListTemplates();
|
||||
Task<ApiResponseDTO<RoleCheckListTemplateHeaderDTO>> UpdateRoleCheckListTemplateHeader(RoleCheckListTemplateHeaderDTO roleCheckListTemplateHeaderDTO);
|
||||
Task<bool> DeleteRoleCheckListTemplateHeader(int id);
|
||||
|
||||
Task<RoleCheckPointDTO> GetRoleCheckPoint(int id);
|
||||
Task<List<RoleCheckPointDTO>> GetAllRoleCheckPoints();
|
||||
Task<ApiResponseDTO<RoleCheckPointDTO>> UpdateRoleCheckPoint(RoleCheckPointDTO roleCheckPointDTO);
|
||||
Task<bool> DeleteRoleCheckPoint(int id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,12 @@ namespace WorkFlowCheck.Web.Services
|
||||
{
|
||||
try
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/user/updateUser";
|
||||
if (userDTO.Id != null)
|
||||
{
|
||||
userDTO.Password = "xXyY3456!!!;;"; // Ez csak amiatt kell, hogy ne szálljon el a JSON
|
||||
}
|
||||
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/user/UpdateUser";
|
||||
|
||||
using (HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync(endpoint, userDTO))
|
||||
{
|
||||
@@ -131,7 +136,7 @@ namespace WorkFlowCheck.Web.Services
|
||||
{
|
||||
UserName = username,
|
||||
Password = password,
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -161,7 +166,7 @@ namespace WorkFlowCheck.Web.Services
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/Authenticate2F2";
|
||||
|
||||
var userSimpleDTO = new User2FADTO()
|
||||
@@ -188,7 +193,7 @@ namespace WorkFlowCheck.Web.Services
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
|
||||
return new ApiResponseDTO<UserDTO>
|
||||
{
|
||||
IsSuccess = false
|
||||
@@ -206,7 +211,7 @@ namespace WorkFlowCheck.Web.Services
|
||||
{
|
||||
UserName = username,
|
||||
OldPassword = oldpassword,
|
||||
NewPassword1 = newpassword,
|
||||
NewPassword1 = newpassword,
|
||||
NewPassword2 = newpassword,
|
||||
Code = code,
|
||||
Token2FA = token2FA
|
||||
@@ -421,6 +426,27 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
public async Task<bool> DeleteUserRole(int id)
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/DeleteUserRole/{id}";
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<RoleCheckListTemplateHeaderDTO> GetRoleCheckListTemplateHeader(int id)
|
||||
{
|
||||
@@ -492,6 +518,27 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
public async Task<bool> DeleteRoleCheckListTemplateHeader(int id)
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/DeleteRoleCheckListTemplateHeader/{id}";
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<RoleCheckPointDTO> GetRoleCheckPoint(int id)
|
||||
{
|
||||
@@ -563,7 +610,28 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
public async Task<bool> DeleteRoleCheckPoint(int id)
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/DeleteRoleCheckPoint/{id}";
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user