public async Task <TaskNotificationTypeDto> PutTaskNotificationType(int id, TaskNotificationTypeDto model) { var url = CRMApiUri + "/TaskNotificationType/" + id; var result = await PutRequestToApi(url, model); return(result); }
public async Task <BaseEntity> SaveAndReturnEntityAsync(TaskNotificationTypeDto entityDto) { var entity = _mapper.Map <TaskNotificationType>(entityDto); var result = await _repository.SaveAndReturnEntityAsync(entity); return(result); }
public async Task <TaskNotificationTypeDto> PostTaskNotificationType(TaskNotificationTypeDto model) { var url = CRMApiUri + "/TaskNotificationType"; var result = await PostRequestToApi(url, model); return(result); }
public async Task <IActionResult> Put(int id, [FromBody] TaskNotificationTypeDto taskNotificationType) { if (id == 0 || taskNotificationType.Id == 0) { return(StatusCode(StatusCodes.Status400BadRequest, "Id needs to be greater than 0.")); } return(await SaveAndReturnEntityAsync(async() => await _taskNotificationTypeService.SaveAndReturnEntityAsync(taskNotificationType))); }
public async Task <IActionResult> Post([FromBody] TaskNotificationTypeDto taskNotificationType) { if (taskNotificationType.Id != 0) { return(StatusCode(StatusCodes.Status400BadRequest, "Identity insert is not permitted.")); } return(await SaveAndReturnEntityAsync(async() => await _taskNotificationTypeService.SaveAndReturnEntityAsync(taskNotificationType))); }
public IActionResult Save(TaskNotificationTypeDto model) { UpdateAuditInformation(model); if (!ModelState.IsValid) { GetStateSettings(ViewState.Write); return(PartialView("Edit", model)); } model = model.Id > 0 ? _lookupFacadeApiClient.PutTaskNotificationType(model.Id, model).Result : _lookupFacadeApiClient.PostTaskNotificationType(model).Result; if (!string.IsNullOrWhiteSpace(model.ErrorMessage)) { return(PartialView("Edit", model)); } return(Json(new { message = model.SuccessMessage })); }
public async Task <int> SaveAsync(TaskNotificationTypeDto entityDto) { var result = await SaveAndReturnEntityAsync(entityDto); return(result.Id); }
public async Task <TaskNotificationTypeDto> PutTaskNotificationType(int id, TaskNotificationTypeDto model) { return(await _taskNotificationTypeApiClient.PutTaskNotificationType(id, model)); }
public async Task <TaskNotificationTypeDto> PostTaskNotificationType(TaskNotificationTypeDto model) { return(await _taskNotificationTypeApiClient.PostTaskNotificationType(model)); }