コード例 #1
0
        public void SaveClick(IEditContactEntity entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException(nameof(entity));
            }

            var validationSkype = SkypeTextChanged(entity.Skype);
            var validationPhone = PhoneTextChanged(entity.Phone);
            var validationCity  = CityTextChanged(entity.City);

            if (_currentRecieveStatus == EControllerStatus.Processing | !(validationSkype && validationPhone && validationCity))
            {
                if (!validationSkype)
                {
                    Presenter.InvalidSkypeInput();
                }

                if (!validationPhone)
                {
                    Presenter.InvalidPhoneInput();
                }

                if (!validationCity)
                {
                    Presenter.InvalidCityInput();
                }

                return;
            }

            _controller.Send(_modelCreator.GetRequestModel(entity));
        }
コード例 #2
0
 public UserInfoDTO GetRequestModel(IEditContactEntity entity)
 {
     return(new UserInfoDTO(entity ?? throw new NullReferenceException(nameof(entity))));
 }