public ResponseDto AddAddress(AddAddressRequest request)
        {
            ResponseDto response = new ResponseDto();
            Consumer    consumer = null;

            response.has_resource = 0;
            try
            {
                using (UserDao dao = new UserDao())
                {
                    consumer = GetAuthUser(dao, request.user_id, request.auth_token, true);
                    if (consumer == null)
                    {
                        MakeNouserResponse(response);
                        return(response);
                    }
                    ConsumerAddress address = new ConsumerAddress();
                    address.ConsID = request.user_id;
                    UsersHelper.CopyToEntity(address, request);
                    address.CreatedDate = DateTime.Now;
                    address.UpdatedDate = address.CreatedDate;
                    address.StatusID    = 1;
                    if (consumer.ConsumerAddresses.Count == 0)
                    {
                        address.IsDefault = true;
                    }
                    else
                    {
                        address.IsDefault = Convert.ToBoolean(request.is_default);
                        if (Convert.ToBoolean(request.is_default))
                        {
                            foreach (var item in consumer.ConsumerAddresses)
                            {
                                item.IsDefault = false;
                            }
                            dao.Update(consumer);
                        }
                    }
                    dao.AddAddress(address);
                    response.code    = 0;
                    response.message = MessagesSource.GetMessage("addr.added");
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
            }
            return(response);
        }