private void btnNextPersonel_Click(object sender, EventArgs e)
        {
            foreach (UserLogin item in _userBLL.GetUserALL())
            {
                _identity.Add(item.IdentityNumber);
            }

            if (_identity.Contains(long.Parse(txtIıdentityNO.Text)))
            {
                MessageBox.Show(" Sistemde zaten kaydınız vardır! Eğer parolanızı hatırlamıyorsanız lütfen parola hatırlatma ekranını kullanınız!");
                grpbxCommi.Enabled         = false;
                grpbxPersonDetail1.Enabled = true;
            }
            else
            {
                if (txtIıdentityNO.TextLength == 11)
                {
                    if ((txtFirstName.Text != "" && txtFirstName.TextLength >= 2) && (txtLastName.Text != "" && txtLastName.TextLength >= 2) && cmbGender.SelectedIndex > -1)
                    {
                        grpbxPersonDetail1.Enabled = false;
                        grpbxCommi.Enabled         = true;
                    }
                    else
                    {
                        MessageBox.Show("Lütfen Zorunlu Alanları Doldurunuz!");
                    }
                }
                else
                {
                    MessageBox.Show("Lütfen T.C. Numaranız'ı Kontrol Ediniz!");
                }
            }
        }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            foreach (UserLogin item in _userBLL.GetUserALL())
            {
                if (long.Parse(txtBxIdentitiyNumber.Text.ToString()) == item.IdentityNumber)
                {
                    _UserID = item.UserID;
                    _identity.Add(item.IdentityNumber);
                    _password.Add(item.Password);
                }
            }


            _apointmentForm._userID        = _UserID;
            _appointStatusListForm._userID = _UserID;


            if (_identity.Contains((long.Parse(txtBxIdentitiyNumber.Text))) && (_password.Contains(txtBxPassword.Text)))
            {
                if (txtBxIdentitiyNumber.Text == "" && txtBxPassword.Text == "")
                {
                    MessageBox.Show("Lütfen gerekli alanları boş bırakmayınız!");
                }


                if (lblSecurityAnswer.Text == txtBxSecurityNumber.Text)
                {
                    _apointmentForm.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Lütfen Güvenlik Kodunu Kontrol Ediniz!");
                    txtBxSecurityNumber.Text = "";
                    _rand                  = new Random();
                    _randomNumber          = _rand.Next(10000, 99999);
                    lblSecurityAnswer.Text = _randomNumber.ToString();
                }
            }
            else
            {
                MessageBox.Show("TC Kimlik Numarası veya Şifre Yanlış! Lütfen Bilgilerinizi Kontrol Ediniz.");
                txtBxIdentitiyNumber.Text = "";
                txtBxPassword.Text        = "";
                txtBxSecurityNumber.Text  = "";
                _rand                  = new Random();
                _randomNumber          = _rand.Next(10000, 99999);
                lblSecurityAnswer.Text = _randomNumber.ToString();
            }
        }
Beispiel #3
0
        public void MailGonder()
        {
            foreach (UserLogin item in _userBLL.GetUserALL())
            {
                _mail     = item.Email;
                _identity = item.IdentityNumber;
                _password = item.Password;
            }

            if ((long.Parse(txtIdentity.Text) == _identity) && (txtBxEMail.Text == _mail))
            {
                if (txtIdentity.Text == "" && txtBxEMail.Text == "")
                {
                    MessageBox.Show("Lütfen gerekli alanları boş bırakmayınız");
                }
            }

            try
            {
                SmtpClient  client = new SmtpClient("smtp.gmail.com", 587);
                MailMessage mesaj  = new MailMessage();
                mesaj.To.Add(txtBxEMail.Text);
                mesaj.From    = new MailAddress("*****@*****.**");
                mesaj.Subject = "MHRS Şifremi Unuttum";
                mesaj.Body    = string.Format("MHRS sistemine ait Kullanıcı şifreniz :{0}", _password);
                NetworkCredential guvenlik = new NetworkCredential("*****@*****.**", "yiwit4757691");
                client.Credentials = guvenlik;
                client.EnableSsl   = true;
                client.Send(mesaj);
                MessageBox.Show("Şifreniz Başarıyla E-Mail Adresinize Gönderilmiştir.", "Şifremi Unuttum");
            }
            catch
            {
                MessageBox.Show("Mail Gönderme Başarısız.", "Mail Gönderme");
            }
        }