コード例 #1
0
        public UpdateViewModel()
        {
            UpdataOrg = new RelayCommand(UpdateOrganization);
            Clean     = new RelayCommand(Clear);
            SelectOrg = new RelayCommand(SelectForUpdate);
            DelOrg    = new RelayCommand(DeleteOrg);

            updateModel = new UpdateOrgModel();
            upsateRepo  = new UpdateRepository();

            _countryRepository = new CountryRepository();                            //создаем экземпляр класса CountryRepository, который унаследован от интрефейса ICountryRepository
            List <CountryModel> countries = _countryRepository.GetCountries();       // создаем список объектов с типом CountryModel при помощи метода обязательного (Интрерфес) методом GetCountries из репы
            var countryVM = CountryMapper.CountryModelToCountryViewModel(countries); // при помощи статического метода CountryModelToCountryViewModel из класса CountryMapper приводим тип из Модели во Вью модель, чтобы наша вью модель могла работать с данными

            _sectionRepository = new SectionRepository();
            List <SectionModel> sections = _sectionRepository.GetSections();
            var sectionVM = SectionMappers.SectionModelToSectionViewModel(sections);

            Countries = countryVM;
            Section   = sectionVM;

            Person = new UpdatePersViewModel(countryVM)
            {
            };

            Organization = new UpdateOrgViewModel(countryVM, sectionVM)
            {
                CreateDateOrg = new DateTime()
            };
        }
コード例 #2
0
        public SearchWievModelOrg()
        {
            _searchRepository = new SearchRepository();

            _countryRepository = new CountryRepository();                        //создаем экземпляр класса CountryRepository, который унаследован от интрефейса ICountryRepository
            List <CountryModel> countries = _countryRepository.GetCountries();   // создаем список объектов с типом CountryModel при помощи метода обязательного (Интрерфес) методом GetCountries из репы

            Countries = CountryMapper.CountryModelToCountryViewModel(countries); // при помощи статического метода CountryModelToCountryViewModel из класса CountryMapper приводим тип из Модели во Вью модель, чтобы наша вью модель могла работать с данными

            _sectionRepository = new SectionRepository();
            List <SectionModel> sections = _sectionRepository.GetSections();

            Section = SectionMappers.SectionModelToSectionViewModel(sections);

            CreatedateOrgSTART = new DateTime(1980, 01, 01);
            CreatedateOrgFINAL = DateTime.Now;

            CheckDateOrgSTART = DateTime.Today;
            CheckDateOrgFINAL = DateTime.Today.AddDays(1);

            CheckDateOrg = DateTime.Now;

            RiscLevelLess = 83;
            RiscLevelMore = 0;

            /*  SearchCommand = new RelayCommand(Search, CanSearch);*/
        }
コード例 #3
0
        public SearchWievModelPers()
        {
            _countryRepository = new CountryRepository();                        //создаем экземпляр класса CountryRepository, который унаследован от интрефейса ICountryRepository
            List <CountryModel> countries = _countryRepository.GetCountries();   // создаем список объектов с типом CountryModel при помощи метода обязательного (Интрерфес) методом GetCountries из репы

            Countries = CountryMapper.CountryModelToCountryViewModel(countries); // при помощи статического метода CountryModelToCountryViewModel из класса CountryMapper приводим тип из Модели во Вью модель, чтобы наша вью модель могла работать с данными
        }
コード例 #4
0
        public NewOrganizationViewModel()
        {
            _newOrgrepo = new NewOrganizationRepository();

            _countryRepository = new CountryRepository();                            //создаем экземпляр класса CountryRepository, который унаследован от интрефейса ICountryRepository
            List <CountryModel> countries = _countryRepository.GetCountries();       // создаем список объектов с типом CountryModel при помощи метода обязательного (Интрерфес) методом GetCountries из репы
            var countryVM = CountryMapper.CountryModelToCountryViewModel(countries); // при помощи статического метода CountryModelToCountryViewModel из класса CountryMapper приводим тип из Модели во Вью модель, чтобы наша вью модель могла работать с данными

            _sectionRepository = new SectionRepository();
            List <SectionModel> sections = _sectionRepository.GetSections();
            var sectionVM = SectionMappers.SectionModelToSectionViewModel(sections);

            _riskListRepository = new RiskRepository();

            var risks = _riskListRepository.GetRisks();

            //ValueChanged - обработчик событий. В калькуляторе у нас есть событие, которое вызывается при смене значения в калькуляторе(при добавлении и удаоении значений)
            /// мы подписываемся на изменение ValueChanged
            RiskCalculator.ValueChanged += RiskCalculatorValueChanged;

            Person1 = new PersonViewModel(countryVM)
            {
                PrevLiquidated  = new NegativeRiskCheckBoxViewModel(risks.PrevLiquidated),
                PrevBankruptcy  = new NegativeRiskCheckBoxViewModel(risks.PrevBankruptcy),
                PrevExecuteProc = new NegativeRiskCheckBoxViewModel(risks.PrevExecuteProc),
                PrevStateDebt   = new NegativeRiskCheckBoxViewModel(risks.PrevStateDebt),
                PrevTaxDebt     = new NegativeRiskCheckBoxViewModel(risks.PrevTaxDebt),
                NegativDataPers = new NegativeRiskCheckBoxViewModel(risks.NegativData)
            };

            Organization = new OrganizationViewModel(countryVM, sectionVM)
            {
                BrokerClient     = new PositiveRiskCheckBoxViewModel(risks.BrokerClient),
                PrevBrokerClient = new PositiveRiskCheckBoxViewModel(risks.PrevBrokerClient),
                Manufacturer     = new PositiveRiskCheckBoxViewModel(risks.Manufacturer),
                Reputation       = new PositiveRiskCheckBoxViewModel(risks.Reputation),
                OwnershipOrg     = new PositiveRiskCheckBoxViewModel(risks.OwnershipOrg),

                TaxDebt = new NegativeRiskCheckBoxViewModel(risks.TaxDebt),
                DebtsEnforcementDocuments = new NegativeRiskCheckBoxViewModel(risks.DebtsEnforcementDocuments),
                FalseBusiness             = new NegativeRiskCheckBoxViewModel(risks.FalseBusiness),
                SpecialRisc              = new NegativeRiskCheckBoxViewModel(risks.SpecialRisc),
                ExecuteProc              = new NegativeRiskCheckBoxViewModel(risks.ExecuteProc),
                BankruptcyProc           = new NegativeRiskCheckBoxViewModel(risks.BankruptcyProc),
                LiquidationProc          = new NegativeRiskCheckBoxViewModel(risks.LiquidationProc),
                NegativData              = new NegativeRiskCheckBoxViewModel(risks.NegativData),
                ExchengeTradingDisorders = new NegativeRiskCheckBoxViewModel(risks.ExchengeTradingDisorders),
            };

            SaveCommand       = new RelayCommand(Save, CanSave);
            ClearCommand      = new RelayCommand(Clear);
            Risk              = RiskCalculator.Value;
            AutoFill          = new RelayCommand(FillOracleDataOrgPers);
            AutoFillViewModel = new AutoFillViewModel();

            Countries = countryVM;
        }