Exemplo n.º 1
0
 private void Btn_Unsubscribe(object sender, RoutedEventArgs e)
 {
     if (txtbx_user.Text == "" || passwordBox1.Password == "")
     {
         System.Windows.MessageBox.Show("Please enter username and password");
     }
     else
     {
         DBLoginConnect LoginDB = new DBLoginConnect();
         int upexists = LoginDB.UandP_Exists(txtbx_user.Text, passwordBox1.Password);
         if (upexists == 1)
         {
             LoginDB.Delete(txtbx_user.Text, passwordBox1.Password);
             System.Windows.MessageBox.Show("User Successfully Unsubscribed");
         }
         else if (upexists == 0)
         {
             System.Windows.MessageBox.Show("User does not exist!!");
         }
         else if (upexists > 1)
         {
             System.Windows.MessageBox.Show("Multiple user exist!!");
         }
         else if (upexists == -1)
         {
             System.Windows.MessageBox.Show("Connection Failed");
         }
     }
     
 }
Exemplo n.º 2
0
        private void Btn_Signin_Click(object sender, RoutedEventArgs e)
        {

            if (txtbx_user.Text=="" || passwordBox1.Password=="")
            {
                System.Windows.MessageBox.Show("Please enter username and password");
            }
            else
            {
                DBLoginConnect LoginDB = new DBLoginConnect();
                int upexists = LoginDB.UandP_Exists(txtbx_user.Text, passwordBox1.Password);
                if (upexists == 1)
                {
                    //globaldata gb = new globaldata();
                    //gb.current_user = txtbx_user.Text;
                    globaldata.current_user=txtbx_user.Text;
                    this.Hide();
                    ActivitySelection actvxml = new ActivitySelection();
                    actvxml.Show();
                }
                else
                {
                    System.Windows.MessageBox.Show("User does not exist!!");
                }
            }
            
        }