コード例 #1
0
        public App(ISorularRepository sorularRepository, IKullaniciRepository kullaniciRepository,
                   IHastaneRepository hastaneRepository,
                   IDoktorRepository doktorRepository,
                   IHemsireRepository hemsireRepository,
                   IOdaRepository odalarRepository,
                   IKoridorRepository koridorRepository,
                   INesneRepository nesneRepository)
        {
            // _dbPath = dbPath;

            InitializeComponent();

            //MainPage = new ProductsPage()
            //{
            //    BindingContext = new ProductsViewModel(productRepository),
            //};
            //MainPage = new SorularSayfasi()
            //{
            //    BindingContext = new SorularViewModel(sorularRepository),
            //};



            var a = new LoginPage();

            MainPage = a;

            a.BindingContext = new LoginPageViewModel(Application.Current.MainPage.Navigation, kullaniciRepository, sorularRepository,
                                                      hastaneRepository, doktorRepository, hemsireRepository, odalarRepository, koridorRepository, nesneRepository);
        }
コード例 #2
0
 public SorularController(ISorularRepository sorularRepository,
                          UserManager <OgrenciUser> userManager,
                          ILogger <SorularController> logger)
 {
     _sorularRepository = sorularRepository;
     this.userManager   = userManager;
     _logger            = logger;
 }
コード例 #3
0
        public LoginPageViewModel(INavigation _navigation, IKullaniciRepository kullaniciRepository, ISorularRepository sorularRepository,
                                  IHastaneRepository hastaneRepository,
                                  IDoktorRepository doktorRepository,
                                  IHemsireRepository hemsireRepository,
                                  IOdaRepository odalarRepository,
                                  IKoridorRepository koridorRepository,
                                  INesneRepository nesneRepository)
        {
            _kullaniciRepository = kullaniciRepository;
            _sorularRepository   = sorularRepository;
            _hastaneRepository   = hastaneRepository;
            _doktorRepository    = doktorRepository;
            _hemsireRepository   = hemsireRepository;
            _odaRepository       = odalarRepository;
            _koridorRepository   = koridorRepository;
            _nesneRepository     = nesneRepository;

            Navigation = _navigation;
            PageTitle  = "Giriþ Sayfasýna Hoþgeldiniz";
        }
コード例 #4
0
        public SorularViewModel(ISorularRepository sorularRepository, IOdaRepository odaRepository
                                , IKoridorRepository koridorRepository, INesneRepository nesneRepository)
        {
            _koridorRepository = koridorRepository;
            _odaRepository     = odaRepository;
            _nesneRepository   = nesneRepository;
            _sorularRepository = sorularRepository;

            koridors = _koridorRepository.GetKoridorAsync().GetAwaiter().GetResult();

            Koridorlarim = koridors.Select(x => x.Numara).ToArray <Int32>();

            odalars = _odaRepository.GetOdaAsync().GetAwaiter().GetResult();

            Odalarim = odalars.Select(x => x.Numara).ToArray <Int32>();

            nesnes = _nesneRepository.GetNesneAsync().GetAwaiter().GetResult();

            Nesnelerim = nesnes.Select(x => x.Adi).ToArray();
        }
コード例 #5
0
        public AnaEkranViewModel(INavigation navigation, ISorularRepository sorularRepository, IDoktorRepository doktorRepository,
                                 IHastaneRepository hastaneRepository, IHemsireRepository hemsireRepository,
                                 IOdaRepository odalarRepository, IKoridorRepository koridorRepository
                                 , INesneRepository nesneRepository, IKullaniciRepository kullaniciRepository)
        {
            _doktorRepository    = doktorRepository;
            _hastaneRepository   = hastaneRepository;
            _odalarRepository    = odalarRepository;
            _nesneRepository     = nesneRepository;
            _soruRepository      = sorularRepository;
            _kullaniciRepository = kullaniciRepository;
            Navigation           = navigation;
            Sorularim            = _soruRepository.GetSorularAsync().GetAwaiter().GetResult();
            var hastanes = _hastaneRepository.GetHastaneAsync().GetAwaiter().GetResult();

            HastaneCommand = new Command(x =>
            {
                HastaneKayit hastaneKayit = new HastaneKayit();
                Navigation.PushModalAsync(hastaneKayit).GetAwaiter();
                hastaneKayit.BindingContext = new HastaneKayitViewModel(hastaneRepository);
            });


            NesneKayitCommand = new Command(x =>
            {
                NesneKayit nesneKayit = new NesneKayit();
                Navigation.PushModalAsync(nesneKayit).GetAwaiter();
                nesneKayit.BindingContext = new NesneKayitViewModel(odalarRepository, koridorRepository, nesneRepository);
            });
            DoktorKayitCommand = new Command(x =>
            {
                DoktorKayit doktorKayit = new DoktorKayit();
                Navigation.PushModalAsync(doktorKayit).GetAwaiter();
                doktorKayit.BindingContext = new DoktorKayitViewModel(doktorRepository, hastaneRepository);
            });

            OdaKayitCommand = new Command(x =>
            {
                OdaKayit odaKayit = new OdaKayit();
                Navigation.PushModalAsync(odaKayit).GetAwaiter();
                odaKayit.BindingContext = new OdaKayitViewModel(odalarRepository, koridorRepository);
            });


            KoridorKayitCommand = new Command(x =>
            {
                KoridorKayit koridorKayit = new KoridorKayit();
                Navigation.PushModalAsync(koridorKayit).GetAwaiter();
                koridorKayit.BindingContext = new KoridorKayitViewModel(hastaneRepository, koridorRepository);
            });
            HemsireCommand = new Command(x =>
            {
                HemsireKayit hemsireKayit = new HemsireKayit();
                Navigation.PushModalAsync(hemsireKayit).GetAwaiter();
                hemsireKayit.BindingContext = new HemsireKayitViewModel(hemsireRepository, hastaneRepository);
            });
            SoruKayitCommand = new Command(x =>
            {
                SorularSayfasi sorularKayit = new SorularSayfasi();
                Navigation.PushModalAsync(sorularKayit).GetAwaiter();
                sorularKayit.BindingContext = new SorularViewModel(sorularRepository, odalarRepository, koridorRepository, nesneRepository);
            });
            KullaniciKayitCommand = new Command(x =>
            {
                KullaniciKayit kullaniciKayit = new KullaniciKayit();
                Navigation.PushModalAsync(kullaniciKayit).GetAwaiter();
                kullaniciKayit.BindingContext = new KullaniciKayitViewModel(kullaniciRepository);
            });
            AnaEkranCommand = new Command(x =>
            {
                AnaEkran anaekran = new AnaEkran();
                Navigation.PushModalAsync(new NavigationPage(anaekran)).GetAwaiter();

                //  anaekran.BindingContext = new AnaEkranViewModel(Navigation,_sorularRepository, _doktorRepository, _hastaneRepository);
            });



            GunlukCommand = new Command(x =>
            {
                //Günlük
            });

            HaftalikCommand = new Command(x =>
            {
                //Haftalik
            });
        }
コード例 #6
0
 public CevaplarModelViewModel(ISorularRepository sorularRepository, IDoktorRepository doktorRepository)
 {
     _soruRepository   = sorularRepository;
     _doktorRepository = doktorRepository;
     RefreshCommand.Execute("");
 }
        public DoktorHemsireSayfasiViewModel(INavigation navigation, ISorularRepository sorularRepository, IDoktorRepository doktorRepository,
                                             IHastaneRepository hastaneRepository, IHemsireRepository hemsireRepository,
                                             IOdaRepository odalarRepository, IKoridorRepository koridorRepository
                                             , INesneRepository nesneRepository)
        {
            _doktorRepository  = doktorRepository;
            _hastaneRepository = hastaneRepository;
            _odalarRepository  = odalarRepository;
            _nesneRepository   = nesneRepository;
            _soruRepository    = sorularRepository;
            _koridorRepository = koridorRepository;

            Navigation = navigation;

            Sorularim = _soruRepository.QuerySoruAsync(x => !SoruyaCevapVerildiMi(x.ZamanPeridoyu, x.CevaplanmaZamani)).GetAwaiter().GetResult();



            Odalars  = _odalarRepository.GetOdaAsync().GetAwaiter().GetResult();
            Koridors = _koridorRepository.GetKoridorAsync().GetAwaiter().GetResult();
            Doktors  = _doktorRepository.GetDoktorAsync().GetAwaiter().GetResult();
            Nesnes   = _nesneRepository.GetNesneAsync().GetAwaiter().GetResult();
            var hastanes = _hastaneRepository.GetHastaneAsync().GetAwaiter().GetResult();



            CevaplariGöster = new Command(x =>
            {
                Cevaplar cevapKayit = new Cevaplar();
                Navigation.PushModalAsync(cevapKayit).GetAwaiter();
                cevapKayit.BindingContext = new CevaplarModelViewModel(sorularRepository, doktorRepository);
            });


            AnaEkranCommand = new Command(x =>
            {
                AnaEkran anaekran = new AnaEkran();
                Navigation.PushModalAsync(new NavigationPage(anaekran)).GetAwaiter();

                //  anaekran.BindingContext = new AnaEkranViewModel(Navigation,_sorularRepository, _doktorRepository, _hastaneRepository);
            });



            GunlukCommand = new Command(x =>
            {
                Sorularim = _soruRepository.QuerySoruAsync(asd => asd.ZamanPeridoyu == "günlük" && !asd.CevaplandiMi).GetAwaiter().GetResult();
                //Günlük
            });

            HaftalikCommand = new Command(x =>
            {
                Sorularim = _soruRepository.QuerySoruAsync(asd => asd.ZamanPeridoyu == "haftalık" && !asd.CevaplandiMi).GetAwaiter().GetResult();
                //Haftalik
            });

            AAAA = new Command(x =>
            {
                if (_question != null)
                {
                    //_question.Cevap = Cevap;
                    _question.CevaplandiMi = true;
                    if (_question.ZamanPeridoyu == "haftalik")
                    {
                        _question.CevaplanmaZamani = DateTime.Now.StartOfWeek(DayOfWeek.Monday);
                    }
                    else
                    {
                        _question.CevaplanmaZamani = DateTime.Now;
                        //   _question.CevapDate = DateTime.Now.;
                    }
                    _soruRepository.UpdateSoruAsync(_question);
                }
            });
        }