コード例 #1
0
        private void FormProfil_Load(object sender, EventArgs e)
        {
            kULLANICIBindingSource.DataSource = from kullanici in database.KULLANICIs
                                                where FormGiris.tc == kullanici.TC.ToString()
                                                select kullanici;

            KULLANICI yetkili = database.KULLANICIs.First(k => k.TC.ToString() == FormGiris.tc);


            if (yetkili.Personel_Turu.ToString() == "Yetkili")
            {
                tCTextBox.ReadOnly            = false;
                cinsiyetTextBox.ReadOnly      = false;
                kullanıcı_AdiTextBox.ReadOnly = false;
                personelTuruComboBox.Enabled  = true;
            }
        }
コード例 #2
0
        private void silButton_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Kaydı silmek istediğinizden emin misiniz?", "Mesaj", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                try
                {
                    KULLANICI kullanici = database.KULLANICIs.First(k => k.Ad == adSoyad[0] && k.Soyad == adSoyad[1]);

                    database.KULLANICIs.DeleteOnSubmit(kullanici);
                    database.SubmitChanges();

                    MessageBox.Show("Silme Tamamlandı", "Bildirim", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    RefreshMemur();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Silme Gerçekleştirilemedi", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
コード例 #3
0
        private void kaydolButton_Click(object sender, EventArgs e)
        {
            try
            {
                if ((String.IsNullOrEmpty(adresTextBox1.Text) || String.IsNullOrEmpty(adTextBox1.Text) ||
                     String.IsNullOrEmpty(soyadTextBox1.Text) || String.IsNullOrEmpty(kullanıcı_SifresiTextBox.Text) ||
                     String.IsNullOrEmpty(emailTextBox.Text) || String.IsNullOrEmpty(telefonTextBox1.Text) ||
                     String.IsNullOrEmpty(tCTextBox1.Text) || String.IsNullOrEmpty(kullanıcı_AdiTextBox.Text)) ||
                    personelTuruComboBox.SelectedIndex == -1 || (bayanRadioButton.Checked == false && bayRadioButton.Checked == false))
                {
                    MessageBox.Show("Bilgileriniz eksik. Lütfen tam giriniz !", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    throw new Exception();
                }

                if ((personelTuruComboBox.SelectedItem.ToString() == "Yetkili" && yetkiliSifresiTextBox.Text == "yetkili123") ||
                    (personelTuruComboBox.SelectedItem.ToString() == "Memur"))
                {
                    KULLANICI a = new KULLANICI
                    {
                        TC                = tCTextBox1.Text,
                        Ad                = adTextBox1.Text,
                        Soyad             = soyadTextBox1.Text,
                        Email             = emailTextBox.Text,
                        Kullanıcı_Adi     = kullanıcı_AdiTextBox.Text,
                        Kullanıcı_Sifresi = kullanıcı_SifresiTextBox.Text,
                        Adres             = adresTextBox1.Text,
                        D_Tarihi          = d_TarihiDateTimePicker.Value,
                        Cinsiyet          = bayRadioButton.Checked ? "bay" : "bayan",
                        Personel_Turu     = personelTuruComboBox.SelectedItem.ToString(),
                        Telefon           = telefonTextBox1.Text
                    };
                    if (telefonTextBox1.TextLength != 10)
                    {
                        MessageBox.Show("Telefon numaranızın başına 0 koymadan 10 haneli olarak girin!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        throw new Exception();
                    }
                    if (tCTextBox1.TextLength != 11)
                    {
                        MessageBox.Show("T.C. numarası 11 hane olmak zorunda!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        throw new Exception();
                    }
                    if (kullanıcı_SifresiTextBox.TextLength < 6)
                    {
                        MessageBox.Show("Güvenlik için şifre minimum 6 karakter olmak zorunda!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        throw new Exception();
                    }

                    database.KULLANICIs.InsertOnSubmit(a);
                    database.SubmitChanges();
                    MessageBox.Show("Kayıt Tamamlandı", "Mesaj", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    throw new Exception();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Kayıt Tamamlanamadı!", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }


            this.Close();
        }
コード例 #4
0
 partial void DeleteKULLANICI(KULLANICI instance);
コード例 #5
0
 partial void UpdateKULLANICI(KULLANICI instance);
コード例 #6
0
 partial void InsertKULLANICI(KULLANICI instance);