コード例 #1
0
        private void buttonBack_Click(object sender, EventArgs e)
        {
            ActivityPortal cass = new ActivityPortal();

            cass.Show();
            this.Close();
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ActivityPortal dumb = new ActivityPortal();

            dumb.Show();
            this.Hide();
        }
コード例 #3
0
        private void buttonGoBack_Click(object sender, EventArgs e)
        {
            ActivityPortal caccess = new ActivityPortal();

            caccess.Show();
            this.Hide();
        }
コード例 #4
0
 private void buttonSignIn_Click(object sender, EventArgs e)
 {
     if (textBoxUserName.Text == "" || textBoxPassword.Text == "")
     {
         MessageBox.Show("Please provide UserName and Password");
         return;
     }
     try
     {
         //Create SqlConnection
         SqlConnection con = new SqlConnection(conString);
         SqlCommand    cmd = new SqlCommand("Select * from logIn where Username=@username and Password=@password", con);
         cmd.Parameters.AddWithValue("@username", textBoxUserName.Text);
         cmd.Parameters.AddWithValue("@password", textBoxPassword.Text);
         con.Open();
         SqlDataAdapter adapt = new SqlDataAdapter(cmd);
         DataSet        ds    = new DataSet();
         adapt.Fill(ds);
         con.Close();
         int count = ds.Tables[0].Rows.Count;
         //If count is equal to 1, than show frmMain form
         if (count == 1)
         {
             this.Hide();
             ActivityPortal caccess = new ActivityPortal();
             caccess.Show();
         }
         else
         {
             MessageBox.Show("Signin Failed!");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }