コード例 #1
0
ファイル: Window1.xaml.cs プロジェクト: sumit10/BMS
 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");
     }
 }
コード例 #2
0
ファイル: comreg.xaml.cs プロジェクト: sumit10/BMS
 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);
         }
 }
コード例 #3
0
ファイル: dashboard.xaml.cs プロジェクト: sumit10/BMS
 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");
     }
 }