예제 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            this.Hide();
            dashbord ds = new dashbord(cust_id);

            ds.ShowDialog();
        }
예제 #2
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            this.Close();
            dashbord d = new dashbord(cust_id);

            d.ShowDialog();
        }
예제 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlDataAdapter d;
            DataTable      dt;

            con.Open();
            SqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from customer where cust_id='" + textBox1.Text + "'and password='******'";
            try
            {
                cmd.ExecuteNonQuery();
            }
            catch (Exception)
            {
                MessageBox.Show("check input");
                textBox1.Clear();
                textBox2.Clear();
            }
            d  = new SqlDataAdapter(cmd.CommandText, con);
            dt = new DataTable();
            try
            {
                d.Fill(dt);
            }
            catch
            {
                textBox1.Clear();
                textBox2.Clear();
            }

            con.Close();


            if (dt.Rows.Count == 1)
            {
                MessageBox.Show("passowrd mached");
                this.Close();
                int      id = int.Parse(textBox1.Text);
                dashbord ds = new dashbord(id);
                ds.ShowDialog();
            }
            else
            {
                MessageBox.Show("incorrect password");
                textBox1.Clear();
                textBox2.Clear();
            }
        }