Ejemplo n.º 1
0
        private void Check_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(_viewState.CodeFiscale))
            {
                _viewState.AddMessage(Resources.PleaseEnterCodeFiscale);

                return;
            }

            try
            {
                var response = _stubService.GetCodeFiscaleList(_viewState.SelectedLabelId);

                if (response.HasCodeFiscale(_viewState.CodeFiscale))
                {
                    var data = response.FindCodeFiscaleData(_viewState.CodeFiscale);

                    _viewState.SetRegistrationId(data.IndividualAccountOpeningResponseCode);
                    _viewState.SetSubRegistrationId(data.SubregistrationResponseCode);
                    _viewState.SetCloneState(false);

                    _viewState.AddMessage(Resources.CodeFiscaleWasFound);
                }
                else
                {
                    _viewState.AddMessage(Resources.CodeFiscaleWasNotFound);
                }
            }
            catch (Exception ex)
            {
                _viewState.AddMessage(ex.Message);
            }
        }