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