Ejemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            this.Hide();
            dashbord ds = new dashbord(cust_id);

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

            d.ShowDialog();
        }
Ejemplo n.º 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();
            }
        }