Esempio n. 1
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     Model.loginmodel login = new Model.loginmodel();
     if (login.login(txt_cname.Text, password.Password))
     {
         dashboard NewWindow = new dashboard();
         NewWindow.Show();
         this.Close();
     }
     else
     {
         password.Password = "";
         System.Windows.MessageBox.Show("Invalid user name or password");
     }
 }
Esempio n. 2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     //   remove_error();
         loginmodel lm = new loginmodel(txtname.Text, pbpassword.Password, txtaddress.Text, txtphone.Text);
         error = lm.checkvalid();
         if (lm.insert())
         {
             Window1 NewWindow = new Window1();
             NewWindow.Show();
             this.Hide();
             System.Windows.MessageBox.Show("Account created");
         }
         else
         {
           //  lm.showerror(error,t);
         }
 }
Esempio n. 3
0
 private void changepassword(object sender, System.Windows.RoutedEventArgs e)
 {
     if (pd_oldpass.Password.Trim().ToString() == "" || pd_newpass.Password.Trim().ToString() == "" || pb_comform.Password.Trim().ToString() == "")
     {
         MessageBox.Show("Please fill all field");
         return;
     }
     if (pd_newpass.Password.Trim().ToString() != pb_comform.Password.Trim().ToString())
     {
         MessageBox.Show("New Password and confirm password does not match");
         return;
     }
     loginmodel l = new loginmodel();
     if (l.update(1,pd_oldpass.Password.Trim().ToString(),pd_newpass.Password.Trim().ToString()))
     {
         MessageBox.Show("Password Changed Sucessfully");
     }
 }