void okuyucukayit() { if (nesne.TcKontrol(tctextbox.Text) == true) { if (nesne.OkuyucuTcKontrol(tctextbox.Text) == true) { if (nesne.emailkontrol(epostatxt.Text) == true) { nesne.OkuyucuKayit(tctextbox.Text, adsoyadtextbox.Text, numaratextbox.Text, dogumdtp.Value, dogumyericmb.Text, iletisimtextbox.Text, epostatxt.Text, cinsiyetcmb.Text); MessageBox.Show("Kayıt tamamlanmıştır.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); } else { MessageBox.Show("Lütfen doğru mail formatı giriniz!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error); epostatxt.Text = ""; } } else { MessageBox.Show("Aynı Tc Kimlik Numarası ile başka bir öğrenci kaydı bulunmaktadır! ", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error); epostatxt.Text = ""; } } else { MessageBox.Show("Sistemde kayıtlı bir öğrenci bulunmamaktadır.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); tctextbox.Text = ""; } }
private void btngonder_Click(object sender, EventArgs e) { if (txtkullanici.Text == "" || txtmail.Text == "") { MessageBox.Show("Gerekli alanları doldurunuz!", "Mesaj", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { dbEnginee nesne = new dbEnginee(); if (nesne.emailkontrol(txtmail.Text) == true) { DataTable dtemail = nesne.SifreBul(txtkullanici.Text, txtmail.Text); if (dtemail.Rows.Count == 0) { MessageBox.Show("Sistemdeki kullanıcı adınız ve epostanız eşleşmiyor!", "Mesaj", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { sifreunuttum.Sifre = dtemail.Rows[0]["Sifre"].ToString(); ////şifre gönderme try { int _port = 587; string _host = "smtp.live.com"; string _clientUserName = "******"; string _fromMail = "*****@*****.**"; string _clientUserPassword = "******"; bool _enableSsl = true; MailMessage mailMessage = new MailMessage(); mailMessage.To.Add(txtmail.Text); mailMessage.IsBodyHtml = true; mailMessage.Body = @"Şifreniz:" + Sifre; mailMessage.Subject = @"Şifre Hatırlatma"; mailMessage.From = new MailAddress(_fromMail); SmtpClient smtp = new SmtpClient(_host, _port); smtp.Credentials = new System.Net.NetworkCredential(_clientUserName, _clientUserPassword); smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.EnableSsl = _enableSsl; smtp.Send(mailMessage); MessageBox.Show("Mail başarıyla gönderildi.", "MAIL", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception hata) { MessageBox.Show(hata.Message); } } } else { MessageBox.Show("Lütfen geçerli bir mail adresi giriniz", "Geçersiz Mail", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
void KullaniciKayit() { if (nesne.emailkontrol(txteposta.Text) == true) { nesne.KullaniciKayitGuncelle(txtKullanıcıAdı.Text, txtAdSoyad.Text, cmbyetki.Text, txteposta.Text); nesne.KullaniciKayitGuncelle2(txtKullanıcıAdı.Text, txtAdSoyad.Text); MessageBox.Show("Kullanıcı bilgileri güncellenmiştir.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); } else { MessageBox.Show("Lütfen doğru mail formatı giriniz!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error); txteposta.Text = ""; } }
void KullaniciKayit() { if (nesne.KullaniciKontrol(txtkullaniciadi.Text) == true) { if (nesne.emailkontrol(txtEposta.Text) == true) { nesne.KullaniciKayit(txtkullaniciadi.Text, txtsifre.Text, txtadsoyad.Text, cmbyetki.Text, txtEposta.Text); MessageBox.Show("Kayıt tamamlanmıştır.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); } else { MessageBox.Show("Lütfen doğru mail formatı giriniz!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error); txtEposta.Text = ""; } } else { MessageBox.Show("Kullanıcı adı daha önceden alınmıştır.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txtkullaniciadi.Text = ""; } }