Ejemplo n.º 1
0
        public void TbsGiris(IWebDriver driver, Entities.Kullanici kullanici)
        {
basadon:
            try
            {
                driver.Navigate().Refresh();
                driver.Url = "https://tbs.tarbil.gov.tr/Authentication.aspx";
                driver.FindElement(By.Id("username")).SendKeys(kullanici.Tc);
                driver.FindElement(By.Id("password")).SendKeys(kullanici.tbsSifre);
                driver.FindElement(By.Id("btnSubmit")).Click();
            }
            catch (Exception)
            {
                goto basadon;
            }
        }
Ejemplo n.º 2
0
        public Ciftci IsletmeBilgileriGetir(Ciftci ciftci, Entities.Kullanici kullanici)
        {
            Ciftci c = new Ciftci();

            if (!string.IsNullOrEmpty(ciftci.tc))
            {
                DialogResult soru          = MessageBox.Show("Bilgileri forma kaydetmek ister misiniz?", "Soru", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                bool         formAcilsinmi = soru == DialogResult.Yes ? true : false;
                driverNvi = new ChromeDriver();
                c         = selenium.IsletmeBilgileri(driverNvi, ciftci, kullanici, formAcilsinmi);
                driverNvi.Quit();
            }
            else
            {
                MessageBox.Show("Tc numarası giriniz.");
            }
            return(c);
        }
Ejemplo n.º 3
0
        public Ciftci IsletmeBilgileri(IWebDriver driver, Ciftci c, Entities.Kullanici kullanici, bool formAcılsınmı)
        {
            //parolayı parola database içinden değil de kullanıcı database içerisinden alıyoruz.
            //because of that those cods are canceled.
            //string[] gelenler = listeyebak("tbs");
            //string kullaniciadi = gelenler[0];
            //string parola = gelenler[1];
            TbsGiris(driver, kullanici);
            driver.Url = "http://tbsapp1.tarim.gov.tr/Modules/TBSSystem/PersonSearch.aspx";
            IWebElement TcNo = driver.FindElement(By.Id("ctl00_ctl00_bodyCPH_ContentPlaceHolder1_edtIdNo"));

            TcNo.Click();
            TcNo.SendKeys(c.tc);
            IWebElement Click = driver.FindElement(By.Name("ctl00$ctl00$bodyCPH$ContentPlaceHolder1$btnMernis"));

            Click.Click();
TcKontrol:
            IWebElement Isim = driver.FindElement(By.Id("bodyCPH_ContentPlaceHolder1_edtName"));

            if (Isim.Text == "")
            {
                goto TcKontrol;
            }
            IWebElement Soyisim     = driver.FindElement(By.Id("bodyCPH_ContentPlaceHolder1_edtSurname"));
            IWebElement Mahalle     = driver.FindElement(By.Id("bodyCPH_ContentPlaceHolder1_lblCiltAdi"));
            IWebElement Cinsiyet    = driver.FindElement(By.Id("bodyCPH_ContentPlaceHolder1_txtGender"));
            IWebElement BabaAdi     = driver.FindElement(By.Id("bodyCPH_ContentPlaceHolder1_edtFatherName"));
            IWebElement AnneAdi     = driver.FindElement(By.Id("bodyCPH_ContentPlaceHolder1_edtMotherName"));
            IWebElement DogumTarihi = driver.FindElement(By.Id("bodyCPH_ContentPlaceHolder1_edtBirthdate"));
            IWebElement DogumYeri   = driver.FindElement(By.Id("bodyCPH_ContentPlaceHolder1_edtDogumYeri"));
            IWebElement MedeniDurum = driver.FindElement(By.Id("bodyCPH_ContentPlaceHolder1_txtMaritalStatus"));
            IWebElement Il          = driver.FindElement(By.Id("bodyCPH_ContentPlaceHolder1_lblIl"));
            IWebElement Ilce        = driver.FindElement(By.Id("bodyCPH_ContentPlaceHolder1_lblIlce"));
            Ciftci      ciftci      = new Ciftci();

            if (!string.IsNullOrEmpty(Isim.Text) && !string.IsNullOrEmpty(Soyisim.Text))
            {
                string _isim, _soyisim, _mahalle, _cinsiyet, _babaAdi, _anneAdi, _dogumTarihi, _dogumYeri, _medeniDurumu, _il, _ilce;
                _isim          = Isim.Text;
                _soyisim       = Soyisim.Text;
                _mahalle       = Mahalle.Text;
                _cinsiyet      = Cinsiyet.Text;
                _babaAdi       = BabaAdi.Text;
                _anneAdi       = AnneAdi.Text;
                _dogumTarihi   = DogumTarihi.Text;
                _dogumYeri     = DogumYeri.Text;
                _medeniDurumu  = MedeniDurum.Text;
                _il            = Il.Text;
                _ilce          = Ilce.Text;
                ciftci.isim    = _isim;
                ciftci.soyisim = _soyisim;
                ciftci.mahalle = _mahalle;
                if (formAcılsınmı)
                {
                    KayitFormuDoldur(c, _isim, _soyisim, _mahalle, _cinsiyet, _babaAdi, _anneAdi, _dogumTarihi, _il, _ilce);
                    BilgiPaylasimDoldur(_isim, _soyisim, _mahalle);
                    ZiraiDilekceDoldur(_isim, _soyisim, _mahalle, c.tc);
                }
            }
            else
            {
                bekle();
            }
            return(ciftci);
        }