public IActionResult Create(Director payload) { if (!UserIsInRole(UserTypeEnum.Admin)) { return(Unauthorized("You are not in role to permit this action")); } _service.Insert(payload); return(Ok()); }
public async Task <IActionResult> Insert(DirectorInsertDto directorInsertDto) { directorInsertDto.CreatedByUserName = "******"; directorInsertDto.ModifiedByUserName = "******"; directorInsertDto.PicturePath = await ImageExtensions.ImageUpload( directorInsertDto.FirstName + directorInsertDto.LastName, "directors", directorInsertDto.Picture, _env); var insertedDirector = await _directorService.Insert(directorInsertDto); if (insertedDirector.ResultStatus == ResultStatus.Success) { return(Json(0)); } return(Json(1)); }