Need help with cinema system

hhesketh20

New member
Joined
May 14, 2007
Messages
2
Programming Experience
Beginner
Hi I am having trouble with a cinema system I am creating in VB.NET. I have a form called frmSales which has three data grids on it which are linked to a Cinema.mdb database using SQL. The first data grid (Film) displays the FilmNumber(Unique Key) and FullTitle of the Film, the second datagrid (Date) displays the days the film is on for and the third data grid (Session) displays SessionNo(Unique Key), Time, Cinema and SeatNumbers. I have two buttons on this form called Sales and the other called Return.

What I need help with is the code for the buttons so that when the user has selected the three datagrids and depending on whether Cinema 1 or Cinema 2 was selected in datagrid Session then when either the Sales or Return button is pressed they will be taken to the corresponding Cinema form (In this case either frmCinema1 or frmCinema2).

Any help would be appreciated.

Cheers,
hhesketh20
 
:cool: hey thats what I wanna achieve, if only I could. I was thinking of ways for copying data from a column (Cinema) in a datagridview called Session and copying it's data to a Sales button and a Returns button. When the user clicked either button, depending on what Cinema was selected from the Session datagridview the corresponding Cinema form would open.

An example could be if a user choose the number "1" from the Cinema column and clicked either the returns or sales button the form called "frmCinema1" would open.

The only solution for the sales button or the returns button, I could come up with would look something like this:

Dim SelRow As String = SessionView.SelectedRows(0).Cells("Cinema").Value

If SelRow = 1 Then
frmCinema1.Show()
End If

If SelRow = 2 Then
frmCinema2.Show()
End If

.......................... (means that the "if statements are carried on depending on how many statement there are).

There must be another way of achieving the same result but not using "if statements". If someone would be up for the challenge I would really like to know how you would do it :D

Cheers,
Kry9t;) n1te
 
Any solution offered would be based on a similar premise, either using IF statements or a Dictionary
 
Back
Top