Esempio n. 1
0
        private void btnCheck_Click(object sender, EventArgs e, String tablename, String id)
        {
            DataTable table;

            if (tablename.Equals("phongtro"))
            {
                var param = new SqlParameter("id", SqlDbType.Int);
                param.Value = id;
                SqlParameter[] listParam = { param };
                table = dbmanager.executeQuery("select * from phongtro where IDROOM = @id", listParam);
                FormPhongTro formTo = new FormPhongTro(table.Rows[0]);
                formTo.ShowDialog();
            }
            else if (tablename.Equals("khachtro"))
            {
                var param = new SqlParameter("id", SqlDbType.Int);
                param.Value = id;
                SqlParameter[] listParam = { param };
                table = dbmanager.executeQuery("select * from khachtro where CMND = @id", listParam);
                FormKhachTro formTo = new FormKhachTro(table.Rows[0]);
                formTo.ShowDialog();
            }
            else
            {
                var param = new SqlParameter("id", SqlDbType.VarChar);
                param.Value = id;
                SqlParameter[] listParam = { param };
                table = dbmanager.executeQuery("select * from hoadon where idhoadon = @id", listParam);
                FormHoaDon formTo = new FormHoaDon(table.Rows[0]);
                formTo.ShowDialog();
            }
        }
Esempio n. 2
0
        private void btnCheck_Click(object sender, EventArgs e)
        {
            var param = new SqlParameter("id", SqlDbType.Int);

            param.Value = (sender as Button).Name;
            SqlParameter[] listParam = { param };
            DataTable      table     = dbmanager.executeQuery("select * from khachtro where CMND = @id", listParam);
            FormKhachTro   khachTro  = new FormKhachTro(table.Rows[0]);

            khachTro.ShowDialog();
        }