Exemplo n.º 1
0
        public HttpResponseMessage UpdateAccGroup(HttpRequestMessage reqObject)
        {
            int result = 0;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _IdentificationType = JsonConvert.DeserializeObject <IdentificationType>(_requestedDataObject.BusinessData);
            }

            if (_IdentificationType == null || string.IsNullOrWhiteSpace(_IdentificationType.IdentificationId))
            {
                _serviceResponse = _IDataManipulation.ResopnseWhenDataNotFound("Identification Not Found...");
                _response        = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
                return(_response);
            }

            result = _IIdentificationTypeService.UpdateIdentificationType(_IdentificationType);
            if (result == 1)
            {
                _serviceResponse = _IDataManipulation.ResopnseWhenDataFound(result, "information has been updated successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.ResopnseWhenDataNotFound("Identification Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
Exemplo n.º 2
0
        public async Task <IResponseDTO> UpdateIdentificationType([FromRoute] int id, [FromBody] CreateUpdateIdentificationTypeDto options)
        {
            var validationResult = _identificationTypeService.ValidateIdentificationType(options, id);

            if (!validationResult.IsPassed)
            {
                return(validationResult);
            }

            _response = await _identificationTypeService.UpdateIdentificationType(id, options, LoggedInUserId);

            return(_response);
        }