예제 #1
0
        public async Task <PersonCaseStatusDto> PostCaseStatus(PersonCaseStatusDto model)
        {
            var url    = CRMApiUri + "/PersonCaseStatus";
            var result = await PostRequestToApi(url, model);

            return(result);
        }
예제 #2
0
        public async Task <PersonCaseStatusDto> PutCaseStatus(int id, PersonCaseStatusDto model)
        {
            var url    = CRMApiUri + "/PersonCaseStatus/" + id;
            var result = await PutRequestToApi(url, model);

            return(result);
        }
예제 #3
0
        public async Task <BaseEntity> SaveAndReturnEntityAsync(PersonCaseStatusDto entityDto)
        {
            var entity = _mapper.Map <PersonCaseStatus>(entityDto);
            var result = await _repository.SaveAndReturnEntityAsync(entity);

            return(result);
        }
예제 #4
0
        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)));
        }
예제 #5
0
        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)));
        }
예제 #6
0
        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 }));
        }
예제 #7
0
 public async Task <PersonCaseStatusDto> PutCaseStatus(int id, PersonCaseStatusDto model)
 {
     return(await _caseStatusApiClient.PutCaseStatus(id, model));
 }
예제 #8
0
 public async Task <PersonCaseStatusDto> PostCaseStatus(PersonCaseStatusDto model)
 {
     return(await _caseStatusApiClient.PostCaseStatus(model));
 }
예제 #9
0
        public async Task <int> SaveAsync(PersonCaseStatusDto entityDto)
        {
            var result = await SaveAndReturnEntityAsync(entityDto);

            return(result.Id);
        }