protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Dersler);
            ListView      myListView = (ListView)FindViewById(Resource.Id.listView1);
            int           sinif      = Intent.GetIntExtra("extraSinif", 1);
            int           bolum      = Intent.GetIntExtra("extraBolum", 1);
            int           k_id       = Intent.GetIntExtra("extraKullaniciId", 1);
            List <String> dersListe  = new List <String>();

            WebService.Service1 servis = new WebService.Service1();
            idListe.AddRange(servis.DersIdCek(bolum, sinif));
            listeIntCevir(idListe);
            dersListe.AddRange(servis.DersAdiCek(bolum, sinif));
            ArrayAdapter <String> adapter = new ArrayAdapter <String>(this, +
                                                                      Android.Resource.Layout.SimpleListItem1, dersListe);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            myListView.SetAdapter(adapter);

            myListView.ChoiceMode = ChoiceMode.Single;
            myListView.Clickable  = true;
            myListView.ItemClick += (object sender, Android.Widget.AdapterView.ItemClickEventArgs e) =>
            {
                string selectedFromList = myListView.GetItemIdAtPosition(e.Position).ToString();
                int    selectedvalue    = Convert.ToInt32(selectedFromList);
                selectedvalue = idIntListe[selectedvalue];
                var intent = new Intent(this, typeof(YorumlarActivity));
                intent.PutExtra("selectedvalue", selectedvalue);
                intent.PutExtra("extraKullaniciId", k_id);
                StartActivity(intent);
            };
        }
示例#2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);
            Button   btnGiris = (Button)FindViewById(Resource.Id.btnGiris);
            Button   btnKayit = (Button)FindViewById(Resource.Id.btnkayit);
            TextView ad       = (EditText)FindViewById(Resource.Id.k_adi_girdi);
            TextView sifre    = (EditText)FindViewById(Resource.Id.k_sifre_girdi);

            btnGiris.Click += delegate
            {
                String ad_email = ad.Text;
                String sfr      = sifre.Text;

                String text = ad_email + " " + sfr;
                Toast.MakeText(this, text, ToastLength.Short).Show();
                WebService.Service1 servis = new WebService.Service1();
                String cevap = servis.GirisKontrol(ad_email, sfr);
                if (!cevap.Equals("Kullanıcı girişi başarısız!"))
                {
                    int    kullanici_id = servis.KullaniciIdGetir();
                    int    bolum        = Convert.ToInt32(cevap);
                    Intent intent       = new Intent(this, typeof(SiniflarActivity));
                    intent.PutExtra("extraBolum", bolum);
                    intent.PutExtra("extraKullaniciId", kullanici_id);
                    StartActivity(intent);
                }
                else
                {
                    Toast.MakeText(this, "Kullanıcı bilgileri hatalı " +
                                   "kontrol ediniz...", ToastLength.Long).Show();
                }
            };


            btnKayit.Click += delegate
            {
                StartActivity(new Intent(this, typeof(KullaniciEkleActivity)));
            };
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Yorumlar);
            WebService.Service1 servis = new WebService.Service1();

            ListView      list          = (ListView)FindViewById(Resource.Id.listView1);
            TextView      text          = (TextView)FindViewById(Resource.Id.editText1);
            TextView      rsm_yolu      = (TextView)FindViewById(Resource.Id.editText2);
            Button        btn           = (Button)FindViewById(Resource.Id.button1);
            int           k_id          = Intent.GetIntExtra("extraKullaniciId", 1);
            int           selected_ders = Intent.GetIntExtra("selectedvalue", 1);
            List <String> listeYorum    = new List <String>();

            listeYorum.AddRange(servis.YorumlariGetir(selected_ders));
            ArrayAdapter <String> adapter = new ArrayAdapter <String>(this,
                                                                      Android.Resource.Layout.SimpleListItem1, listeYorum);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            list.SetAdapter(adapter);
            list.Clickable = false;
            btn.Click     += delegate
            {
                String  yorum      = text.Text;
                String  resim_yolu = rsm_yolu.Text;
                Boolean cevap      = servis.YorumEkle(yorum, resim_yolu, k_id, selected_ders);
                if (cevap == true)
                {
                    Toast.MakeText(this, "Yorum baþarýyla eklendi...", ToastLength.Short).Show();
                    text.Text = "";
                }
                else
                {
                    Toast.MakeText(this, "Yorum ekleme baþarýsýz...", ToastLength.Short).Show();
                }
            };
        }
示例#4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.KullaniciEkle);
            // Create your application here
            //web servis baðlantýsý için refenrans oluþturulu
            List <String> liste = new List <string>();

            EditText   ad       = (EditText)FindViewById(Resource.Id.ad_giris);
            EditText   soyisim  = (EditText)FindViewById(Resource.Id.soyad_giris);
            EditText   email    = (EditText)FindViewById(Resource.Id.e_mail_giris);
            RadioGroup cins     = (RadioGroup)FindViewById(Resource.Id.rd_group_cinsiyet);
            RadioGroup unvan    = (RadioGroup)FindViewById(Resource.Id.rd_unvan_group);
            Spinner    bolum    = (Spinner)FindViewById(Resource.Id.spin_bolum);
            EditText   sifre    = (EditText)FindViewById(Resource.Id.sifre_giris);
            EditText   resim    = (EditText)FindViewById(Resource.Id.resim_yolu);
            Button     btnKayit = (Button)FindViewById(Resource.Id.btnKayit);

            WebService.Service1 servis = new WebService.Service1();
            try
            {
                liste.AddRange(servis.BolumCek());
                ArrayAdapter <String> adapter_state = new ArrayAdapter <String>(this, Android.Resource.Layout.SimpleSpinnerItem, liste);
                adapter_state.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
                bolum.Adapter = adapter_state;
            }
            catch (Exception e) { Console.WriteLine(e.ToString()); }

            btnKayit.Click += delegate
            {
                String isim     = ad.Text;
                String soyad    = soyisim.Text;
                String mail     = email.Text;
                int    cinsiyet = cins.CheckedRadioButtonId;
                if (cinsiyet == 2131099659)
                {
                    cinsiyet = 1;
                }
                else
                {
                    cinsiyet = 2;
                }
                int unv = unvan.CheckedRadioButtonId;
                if (unv == 2131099662)
                {
                    unv = 1;
                }
                else
                {
                    unv = 2;
                }
                int     spn   = (int)bolum.SelectedItemId + 1;
                String  sfr   = sifre.Text;
                String  rsm   = resim.Text;
                Boolean cevap = servis.KullaniciKayit(isim, soyad, mail,
                                                      cinsiyet, unv, spn, sfr, rsm);
                if (cevap.Equals(true))
                {
                    Toast.MakeText(this, "Baþarýyla kaydýnýz" +
                                   " yapýldý.", ToastLength.Short);
                    Toast.MakeText(this, "Þimdi giriþ sayfasýna" +
                                   " yönlendiriliyorsunuz...", ToastLength.Short);
                    StartActivity(new Intent(this, typeof(MainActivity)));
                }
                else
                {
                    Toast.MakeText(this, "Kayýt iþlemi sýrasýnda beklenmeyen bir " +
                                   "hata oluþtu lütfen tekrar deneyiniz.", ToastLength.Short);
                }
            };
        }