Esempio n. 1
0
        public async Task <Response <string> > UpdateAsync(CustomerDTO model)
        {
            var response = new Response <string>();

            try
            {
                var resp = _mapper.Map <Customer>(model);
                response.Data = await _CustomersDomain.UpdateAsync(resp);

                if (response.Data == "Success")
                {
                    response.IsSuccess = true;
                    response.Message   = "Se ha actualizado el Customer exitosamente.";
                }
                else
                {
                    response.IsSuccess = false;
                    response.Message   = "Ha ocurrido un error inesperado, por favor intente nuevamente";
                }
            }
            catch (Exception ex)
            {
                response.IsSuccess = false;
                response.Message   = ex.Message;
            }

            return(response);
        }
Esempio n. 2
0
        public async Task <Response <bool> > UpdateAsync(CustomerDTO customerDTO)
        {
            var response = new Response <bool>();

            try
            {
                var customer = mapper.Map <Customer>(customerDTO);
                response.Data = await customerDomain.UpdateAsync(customer);

                if (response.Data)
                {
                    response.IsSuccess = true;
                    response.Message   = "Registro exitoso";
                }
            }
            catch (Exception e)
            {
                response.Message = e.Message;
            }
            return(response);
        }
        public async Task <Response <bool> > UpdateAsync(CreditCustomerDTO creditCustomerDTO)
        {
            var response = new Response <bool>();

            try
            {
                var customer = mapper.Map <Customer>(creditCustomerDTO);
                response.Data = await domain.UpdateAsync(customer);

                if (response.Data)
                {
                    response.IsSuccess = true;
                    response.Message   = "Actualizacíón exitosa";
                }
            }
            catch (Exception ex)
            {
                response.Message = ex.Message;
            }

            return(response);
        }