Exemple #1
0
        public Response <Customer> UpdateCustomer(AddCustomerRequest request)
        {
            Response <Customer> response = new Response <Customer>();

            if (request == null || request.Customer == null)
            {
                ArgumentNullException ex = new ArgumentNullException("OperateCustomer request");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }
            try
            {
                CustomerAccessor CustomerAccessor = new CustomerAccessor();
                response.Result = CustomerAccessor.UpdateCustomers(request.Customer);
                if (response.Result.ID > 0)
                {
                    response.IsSuccess = true;
                }
                else
                {
                    response.IsSuccess = false;
                    response.ErrorCode = ErrorCode.Technical;
                }
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.Exception = ex;
                response.ErrorCode = ErrorCode.Technical;
                throw;
            }
            return(response);
        }