Beispiel #1
0
 public bool checkTCKNAvailabilty(PersonList personList, string tckn)
 {
     foreach (Person person in personList.personList)
     {
         if (person.TCKNO.Trim().Equals(tckn.Trim()))
         {
             return(false);
         }
     }
     return(true);
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            mPersonList = Utility.ReadPersons();


            if (!checkTCKNAvailabilty(mPersonList, txtboxTCKNO.Text))
            {
                MessageBox.Show("Böyle bir TCKNO kayıtlı !");
            }
            else
            {
                writer();
                refreshForm();
            }
        }
Beispiel #3
0
        private void button4_Click(object sender, EventArgs e)
        {
            PersonList persons    = Utility.ReadPersons();
            DataTable  dtCustomer = new DataTable();

            dtCustomer.Columns.Add("İsim");
            dtCustomer.Columns.Add("Soy İsim");
            dtCustomer.Columns.Add("Yaş");
            dtCustomer.Columns.Add("TCKN");
            dtCustomer.Columns.Add("Cinsiyet");
            dtCustomer.Columns.Add("E-Mail");
            foreach (Person person in persons.personList)
            {
                if (cmbTCKNOBul.SelectedItem.Equals("Hepsi"))
                {
                    grdSonuc.Enabled = true;
                    dtCustomer.Rows.Add(person.Name.Trim(),
                                        person.surname.Trim(),
                                        person.age.Trim(),
                                        person.TCKNO.Trim(),
                                        person.gender.Trim(),
                                        person.mail.Trim());
                    grdSonuc.Visible = true;
                }
                grdSonuc.DataSource = dtCustomer;
            }

            foreach (Person person in persons.personList)
            {
                if (cmbTCKNOBul.SelectedItem.Equals(person.TCKNO.Trim()))
                {
                    grdSonuc.Enabled = false;
                    grdSonuc.Rows[0].Cells[0].Value = person.Name.Trim();
                    grdSonuc.Rows[0].Cells[1].Value = person.surname.Trim();
                    grdSonuc.Rows[0].Cells[2].Value = person.age.Trim();
                    grdSonuc.Rows[0].Cells[3].Value = person.TCKNO.Trim();
                    grdSonuc.Rows[0].Cells[4].Value = person.gender.Trim();
                    grdSonuc.Rows[0].Cells[5].Value = person.mail.Trim();
                    grdSonuc.Visible = true;
                    break;
                }
            }
        }
Beispiel #4
0
        private void refreshForm()
        {
            lblBaslik.Text        = "Öğrenci Kayıt Sistemi"; lblBaslik.ForeColor = Color.Red; lblBaslik.Font = new Font("Times New Roman", 25, FontStyle.Bold);
            lblİsim.Text          = "İsim"; lblİsim.ForeColor = Color.WhiteSmoke; lblİsim.Font = new Font("Arial", 10, FontStyle.Bold);
            lblSoyİsim.Text       = "Soy İsim"; lblSoyİsim.ForeColor = Color.WhiteSmoke; lblSoyİsim.Font = new Font("Arial", 10, FontStyle.Bold);
            lblYas.Text           = "Yaş"; lblYas.ForeColor = Color.WhiteSmoke; lblYas.Font = new Font("Arial", 10, FontStyle.Bold);
            lblTCKNO.Text         = "TCKNO"; lblTCKNO.ForeColor = Color.WhiteSmoke; lblTCKNO.Font = new Font("Arial", 10, FontStyle.Bold);
            btnGonder.Text        = "Kaydet";
            btnTemizle.Text       = "Temizle";
            lblTCKNOUyarı.Text    = "*Zorunlu Alan*"; lblTCKNOUyarı.ForeColor = Color.Red; lblTCKNOUyarı.Font = new Font(lblTCKNOUyarı.Font, FontStyle.Bold);
            txtboxTCKNO.MaxLength = 11;
            checkBox1.Text        = "TCKNO Gizle"; checkBox1.ForeColor = Color.White;
            lblCinsiyet.Text      = "Cinsiyet"; lblCinsiyet.ForeColor = Color.WhiteSmoke; lblCinsiyet.Font = new Font("Arial", 10, FontStyle.Bold);
            lblMail.Text          = "E-mail"; lblMail.ForeColor = Color.WhiteSmoke; lblMail.Font = new Font("Arial", 10, FontStyle.Bold);
            lblMailUyarı.Text     = "Lütfen e-mail giriniz."; lblMailUyarı.ForeColor = Color.Red; lblMailUyarı.Font = new Font(lblMailUyarı.Font, FontStyle.Bold); lblMailUyarı.Visible = false;
            btnTCKNOBul.Text      = "Listele";
            lblTCKNOSec.Text      = "TCKNO ile Bilgi Erişimi"; lblTCKNOSec.ForeColor = Color.WhiteSmoke; lblTCKNOSec.Font = new Font("Times New Roman", 10, FontStyle.Bold);
            PersonList    persons       = Utility.ReadPersons();
            List <string> oto_tamamlama = new List <string>();

            oto_tamamlama.Add("Hepsi");
            foreach (Person person in persons.personList)
            {
                oto_tamamlama.Add(person.TCKNO);
            }
            AutoCompleteStringCollection collection = new AutoCompleteStringCollection();

            foreach (string item in oto_tamamlama)
            {
                collection.Add(item);
            }
            cmbTCKNOBul.DataSource = oto_tamamlama;
            cmbTCKNOBul.AutoCompleteCustomSource = collection;
            cmbTCKNOBul.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            cmbTCKNOBul.AutoCompleteSource       = AutoCompleteSource.CustomSource;
        }