private void lblGirisYapKayitOl_Click(object sender, EventArgs e) { if (kulllaniciAdi == "") { GirisYap = new FormGirisYap(); GirisYap.Show(); this.Hide(); } }
private void btnKayit_Click(object sender, EventArgs e) { if (txtAd.Text == "" || txtKullaniciAdi.Text == "" || txtSifre.Text == "" || txtSoyad.Text == "" || chckKabul.Checked == false) { if (txtAd.Text == "" || txtSoyad.Text == "") { lblAdSoyad.ForeColor = Color.Red; } else { lblAdSoyad.ForeColor = Color.White; } if (txtKullaniciAdi.Text == "") { lblKullaniciAdi.ForeColor = Color.Red; } else { lblKullaniciAdi.ForeColor = Color.White; } if (txtSifre.Text == "") { lblSifre.ForeColor = Color.Red; } else { lblSifre.ForeColor = Color.White; } if (chckKabul.Checked == false) { lblKabul.ForeColor = Color.Red; } else { lblKabul.ForeColor = Color.White; } } else { bool isTrue = false; foreach (var item in Entities.tblKullanici) { if (item.KullaniciAdi.Equals(txtKullaniciAdi.Text)) { isTrue = false; break; } else { isTrue = true; } } if (!isTrue) { MessageBox.Show("Bu kullanıcı adı ile üye olan kullanıcı mevcuttur!", "Kayıt Ol", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { tblKullanici Kullanici = new tblKullanici() { KullaniciAdi = txtKullaniciAdi.Text, Sifre = txtSifre.Text, YetkiliID = false }; tblPersonel Personel = new tblPersonel() { PersonelAdi = txtAd.Text, PersonelSoyadi = txtSoyad.Text }; Entities.tblPersonel.Add(Personel); Entities.tblKullanici.Add(Kullanici); Entities.SaveChanges(); GirisYap = new FormGirisYap(); GirisYap.Show(); this.Hide(); } } }
private void lblUyeMisin_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { GirisYap = new FormGirisYap(); GirisYap.Show(); this.Hide(); }