public ClientStatsAndRecommendationViewModel() : base()
 {
     clientInfoBL = new ClientInfoBL();
     ResetMessages();
     try {
         ClientIdNumbers = clientInfoBL.GetClientIdNumbers();
     }
     catch (Exception ex)
     {
         SetErrorMessage(ex, "loading data");
     }
 }
        public ClientInformationViewModel()
        {
            clientInfoBL = new ClientInfoBL();

            //set up buttons' functions
            _clearCommand  = new DelegateCommand(OnClear);
            _deleteCommand = new DelegateCommand(OnDelete, CanDelete);
            _saveCommand   = new DelegateCommand(OnSave, CanSave);


            ResetMessages();
            try
            {
                //fill in client types
                _clientTypes = clientInfoBL.GetClientTypes();
                if (_clientTypes == null)
                {
                    _clientTypes = new List <ClientType>();
                }
            }
            catch (Exception ex)
            {
                SetErrorMessage(ex, "loading client types");
                return;
            }

            try
            {
                //fill in client id numbers
                _clientsIdNumbers = ListToObservableCollection(clientInfoBL.GetClientIdNumbers());
                if (_clientsIdNumbers == null)
                {
                    _clientsIdNumbers = new ObservableCollection <int>();
                }
            }
            catch (Exception ex)
            {
                SetErrorMessage(ex, "loading client id numbers");
                return;
            }

            SelectedClientIdNumber = null;
        }