private void btntesoreria_Click(object sender, EventArgs e)
        {
            this.Hide();
            login2 l2 = new login2();

            l2.Show();
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            OleDbConnection olecon = new OleDbConnection();

            olecon.ConnectionString =
                "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database1.accdb;";

            OleDbCommand olecmd =
                new OleDbCommand("SELECT * FROM UserTbl WHERE username=@user AND psw=@psw", olecon);

            olecmd.Parameters.Add("@user", OleDbType.VarChar);
            olecmd.Parameters["@user"].Value = textBox1.Text;
            olecmd.Parameters.Add("@psw", OleDbType.VarChar);
            olecmd.Parameters["@psw"].Value = textBox2.Text;

            try
            {
                olecon.Open();

                OleDbDataReader oledr = olecmd.ExecuteReader();

                if (oledr.Read())
                {
                    textBox1.Text = "";
                    textBox2.Text = "";
                    login2 f3 = new login2();
                    f3.ShowDialog();
                }
                else
                {
                    MessageBox.Show("ユーザIDまたパスワードが間違えています!もう一度入力してください...", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            finally
            {
                olecon.Close();
            }
        }
        private void btnpatrimonio_Click(object sender, EventArgs e)
        {
            login2 l2 = new login2();

            l2.Show();
        }
        private void btnlogistica_Click(object sender, EventArgs e)
        {
            login2 l2 = new login2();

            l2.Show();
        }