CheckListRow edit
This commit is contained in:
@@ -221,5 +221,49 @@ namespace WorkFlowCheck.API.Controllers
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpGet("GetCheckListRow/{id}")]
|
||||
public async Task<ApiResponseDTO<CheckListRowDTO>> GetCheckListRow(int id)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<CheckListRowDTO>()
|
||||
{
|
||||
IsSuccess = true,
|
||||
};
|
||||
var checkListRowDTO = await _checkListService.GetCheckListRowAsync(id);
|
||||
|
||||
if (checkListRowDTO != null)
|
||||
{
|
||||
|
||||
retVal.IsSuccess = true;
|
||||
retVal.Data = checkListRowDTO;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
retVal.Errors.Add("No data!");
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
public async Task<ApiResponseDTO<CheckListRowDTO>> UpdateCheckListRow([FromBody] CheckListRowDTO CheckListRowDTO)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<CheckListRowDTO>()
|
||||
{
|
||||
IsSuccess = true
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
var result = await _checkListService.UpdateCheckListRowAsync(CheckListRowDTO);
|
||||
retVal.Data = result;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user