protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.randevuOnayla_layout);

            txtIl           = FindViewById <TextView>(Resource.Id.txtRandOnayIl);
            txtIlce         = FindViewById <TextView>(Resource.Id.txtRandOnayIlce);
            txtHastane      = FindViewById <TextView>(Resource.Id.txtRandOnayHastane);
            txtBolum        = FindViewById <TextView>(Resource.Id.txtRandOnayBolum);
            txtDoktor       = FindViewById <TextView>(Resource.Id.txtRandOnayDoktor);
            txtTarih        = FindViewById <TextView>(Resource.Id.txtRandOnayTarih);
            btnRandevuOnay  = FindViewById <Button>(Resource.Id.btnRandevuOnay);
            btnRandevuIptal = FindViewById <Button>(Resource.Id.btnRandevuIptal);

            btnRandevuOnay.Click  += BtnRandevuOnay_Click;
            btnRandevuIptal.Click += BtnRandevuIptal_Click;

            hastane       = hastaneService.Getir(Intent.GetIntExtra("hastaneId", 0));
            bolum         = bolumService.Getir(Intent.GetIntExtra("bolumId", 0));
            doktor        = doktorService.Getir(Intent.GetIntExtra("doktorId", 0));
            hasta         = hastaService.Getir(Intent.GetStringExtra("hastaTc"));
            randevuTarihi = Convert.ToDateTime(Intent.GetStringExtra("randevuTarihi"));

            txtIl.Text      = "İl: " + hastane.Il;
            txtIlce.Text    = "İlçe: " + hastane.Ilce;
            txtHastane.Text = "Hastane: " + hastane.Ad;
            txtBolum.Text   = "Bölüm: " + bolum.Ad;
            txtDoktor.Text  = "Doktor: " + doktor.Ad + " " + doktor.Soyad;
            txtTarih.Text   = "Tarih: " + randevuTarihi.ToLongDateString() + " " + randevuTarihi.ToShortTimeString();
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.hastaneGuncelle_layout);


            spinnerHastaneGuncelleIller   = FindViewById <Spinner>(Resource.Id.spinnerHastaneGuncelleIller);
            spinnerHastaneGuncelleIlceler = FindViewById <Spinner>(Resource.Id.spinnerHastaneGuncelleIlceler);
            txtGuncelleHastaneAd          = FindViewById <EditText>(Resource.Id.txtGuncelleHastaneAd);
            btnHastaneGuncelle            = FindViewById <Button>(Resource.Id.btnHastaneGuncelle);

            ArrayAdapter adapterIl = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, iller);

            adapterIl.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinnerHastaneGuncelleIller.Adapter = adapterIl;

            spinnerHastaneGuncelleIller.ItemSelected += SpinnerHastaneGuncelleIller_ItemSelected;
            btnHastaneGuncelle.Click += BtnHastaneGuncelle_Click;

            hastane = hastaneService.Getir(Intent.GetIntExtra("guncelleHastaneId", 0));

            txtGuncelleHastaneAd.Text = hastane.Ad;

            if (hastane.Il == "Manisa")
            {
                spinnerHastaneGuncelleIller.SetSelection(0);

                for (int i = 0; i < manisaIlceler.Length; i++)
                {
                    if (manisaIlceler[i] == hastane.Ilce)
                    {
                        seciliIlceIndex = i;
                    }
                }
            }
            else if (hastane.Il == "İstanbul")
            {
                spinnerHastaneGuncelleIller.SetSelection(1);

                for (int i = 0; i < istanbulIlceler.Length; i++)
                {
                    if (istanbulIlceler[i] == hastane.Ilce)
                    {
                        seciliIlceIndex = i;
                    }
                }
            }
            else if (hastane.Il == "İzmir")
            {
                spinnerHastaneGuncelleIller.SetSelection(2);

                for (int i = 0; i < izmiriIlceler.Length; i++)
                {
                    if (izmiriIlceler[i] == hastane.Ilce)
                    {
                        seciliIlceIndex = i;
                    }
                }
            }
            else if (hastane.Il == "Ankara")
            {
                spinnerHastaneGuncelleIller.SetSelection(3);

                for (int i = 0; i < ankaraIlceler.Length; i++)
                {
                    if (ankaraIlceler[i] == hastane.Ilce)
                    {
                        seciliIlceIndex = i;
                    }
                }
            }
            else if (hastane.Il == "Denizli")
            {
                spinnerHastaneGuncelleIller.SetSelection(4);

                for (int i = 0; i < denizliIlceler.Length; i++)
                {
                    if (denizliIlceler[i] == hastane.Ilce)
                    {
                        seciliIlceIndex = i;
                    }
                }
            }
        }