示例#1
0
        private void click()
        {
            mainmenu m = new mainmenu();

            m.adm = admin();
            SqlConnection con = new SqlConnection("Data Source =DESKTOP-7RCG43D\\SQLEXPRESS; Initial Catalog = Ministry of tourism; Integrated Security=True");

            con.Open();
            String       countt = @"select dbo.signin4(@username,@passwor)";
            SqlCommand   cmd1   = new SqlCommand(countt, con);
            SqlParameter param1 = new SqlParameter("@username", textBox2.Text);
            SqlParameter param2 = new SqlParameter("@passwor", textBox3.Text);

            cmd1.Parameters.Add(param1);
            cmd1.Parameters.Add(param2);
            int koko = (int)cmd1.ExecuteScalar();

            if (koko == 1 || m.adm == 1)
            {
                reservePlace     a = new reservePlace();
                ReserveTransport b = new ReserveTransport();
                String           i = Id(textBox2.Text);
                m.s              = i;
                a.id             = i;
                b.id             = i;
                Global.GlobalVar = i;

                m.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Username or Password is incorrect");
            }
        }
示例#2
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int             i   = e.RowIndex;
            DataGridViewRow Row = dataGridView1.Rows[i];

            s = Row.Cells[0].Value.ToString();
            reservePlace f = new reservePlace();

            f.s = Row.Cells[0].Value.ToString();
            f.Show();
            this.Hide();
        }