Beispiel #1
0
        public ActionResult registerpage(Person person)
        {
            PersonBLL personBLL = new PersonBLL();
            int       result    = personBLL.AddPerson(person);

            if (result > 0)
            {
                ViewBag.Result = "Tebrikler.Kaydınız Başarıyla Gerçekleşti.";
                ViewBag.Status = "success";
            }
            else
            {
                ViewBag.Result = "Bu mail adresi kullanılıyor.";
                ViewBag.Status = "danger";
            }

            return(View());
        }
 private void Button_Login(object sender, RoutedEventArgs e)
 {
     if (firstName.Text != "" && lastName.Text != "" && login.Text != "")
     {
         if (_userBLL.CheckUserIdentity(login.Text))
         {
             if (pwd.Password.ToString() == pwd2.Password.ToString() && pwd.Password.ToString() != "")
             {
                 try
                 {
                     _userBLL.AddUser(firstName.Text, lastName.Text, login.Text, pwd.Password.ToString());
                     _personBLL.AddPerson(login.Text);
                     _userBLL.LoginWrite(login.Text);
                     HomePage main = new HomePage()
                     {
                         WindowStartupLocation = WindowStartupLocation.CenterScreen
                     };
                     main.Show();
                     this.Close();
                 }
                 catch
                 {
                     MessageBox.Show("Error!");
                 }
             }
             else
             {
                 MessageBox.Show("Invalid password!");
             }
         }
         else
         {
             MessageBox.Show("This login already used!");
         }
     }
     else
     {
         MessageBox.Show("Empty fields!");
     }
 }