SRL Archive - C#/Visual Basic Help and Tutorials

Project Help


Simtoon

2009-10-02 17:21:32

I have a project to do in vb and i don't know vb i learn vb next year in school, my teacher allowed me to do this for next year because im ahead of the class, basically i have to make a booking system for a cinema (in vb).

This is what i want to make it look like.


The link to the project explanation is here. I would really like someone to help me thanks ;).

fronty

2009-10-02 18:02:44

First: Learn VB.
Second: Write program.

Which part is the one you have problems right now?

I think it's strange that you are taught Visual Basic. Its support ended 1,5 years ago and it's slowly but surely dying. Some programs written in Visual Basic are still maintained, but direction in new software is definitely .NET.

TViYH

2009-10-02 18:09:51

I think he's talking about .NET.

The teachers still call it Visual Basic, mainly because they are Edward Cullen. Also, it says Visual Basic in the title of the program, and nothing about .NET.

Stupid teachers ^_______^

Sandstorm

2009-10-03 01:28:49

And why do you need a window to select seats? For a theater, don't you just walk in and choose your seat? Or are you talking like, play or pantomime stuff?

~Sandstorm

Neehosoft

2009-10-03 01:54:20

From: TViYH
I think he's talking about .NET.

The teachers still call it Visual Basic, mainly because they are Edward Cullen. Also, it says Visual Basic in the title of the program, and nothing about .NET.

Stupid teachers ^_______^


I still call it visual basic. I am not a teacher.

rogeruk

2009-10-03 01:59:14

Wouldnt be too hard, seems very simple.

Simtoon

2009-10-03 04:30:55

From: Sandstorm
And why do you need a window to select seats? For a theater, don't you just walk in and choose your seat? Or are you talking like, play or pantomime stuff?

~Sandstorm


Some people like to choose where they sit, then it will be printed on the ticket…

But if they dont select where to sit, then it will put a random seat.

rogeruk

2009-10-03 17:02:09

This for Visual Basic or .NET?

You have any understanding on VB?. You made any progress?

TViYH

2009-10-03 19:06:44

I made it using VB.NET, and sent the sauce to you on IRC.

How is it?

Simtoon

2009-10-04 01:28:45

From: TViYH
I made it using VB.NET, and sent the sauce to you on IRC.

How is it?


Its ok, doesnt have all the features i want but i need to get vb.net

From: rogeruk
This for Visual Basic or .NET?

You have any understanding on VB?. You made any progress?


Visual Basic. Not much, only added a the 2 combo boxers.

I cant seem to get the second combo box it work how i like it.

I do this

if Combo1.(something) = "Hulk" then
Combo2.AddItem = "Hello World"
end if

i almost tried everything in something cant get it to work

rogeruk

2009-10-04 01:51:19

[php]
Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
End Sub

Public Sub Form_Load()
Combo1.AddItem ("Hello")
End Sub
[/php]

Basically on load it will add Hello to the combo list. When you select it it will change label1 caption to Hello (because of its text).

You will have to make it load from a database and input the values into the combo box. Then load each films data

Simtoon

2009-10-04 02:33:51

This is what i have.


Private Sub Combo2_Change()
If Combo1.Text = "a1" Then
Combo2.AddItem "b2"
End If

End Sub

Private Sub Form_Load()
Combo1.AddItem "a1"
Combo1.AddItem "a2"
Combo1.AddItem "a3"

End Sub

Doesnt seem to work.

rogeruk

2009-10-04 02:44:45

From: Simtoon
This is what i have.


Private Sub Combo2_Change()
If Combo1.Text = "a1" Then
Combo2.AddItem "b2"
End If

End Sub

Private Sub Form_Load()
Combo1.AddItem "a1"
Combo1.AddItem "a2"
Combo1.AddItem "a3"

End Sub

Doesnt seem to work.


Why do it like that?

[php]Private Sub Combo1_Click()
If Combo1.Text = "a1" Then
Combo2.AddItem "b2"
End If
End Sub

Public Sub Form_Load()
Combo1.AddItem "a1"
Combo1.AddItem "a2"
Combo1.AddItem "a3"
End Sub[/php]

Try that.

Simtoon

2009-10-04 02:55:50

OMG thanks so much now to get the rest working ;)

rogeruk

2009-10-04 02:58:59

Remember you'll have to use a database. Then simply load it using ADODB that way you can easily load and read everything you will need.

Eg, If you select the film Ice Age 3, the show times 14:00, 16:30, 18:00 etc will come up.

To the honest thats the hardest part you will get.

Price / Change / Receipt will be piss easy to do and will take minutes.

Make a good design too :)

Simtoon

2009-10-04 03:02:43

From: rogeruk
Remember you'll have to use a database. Then simply load it using ADODB that way you can easily load and read everything you will need.

Eg, If you select the film Ice Age 3, the show times 14:00, 16:30, 18:00 etc will come up.

To the honest thats the hardest part you will get.

Price / Change / Receipt will be piss easy to do and will take minutes.

Make a good design too :)


I want to make it work with a database, like depending on the day it will show the correct movie times for the correct movie.

Help?

rogeruk

2009-10-04 03:07:09

http://www.vb-helper.com/howto_ado_load_combo_list.html
http://www.fontstuff.com/vba/vbatut10.htm

Plenty of tutorials, if i did it for you then you aint going to learn.

Simtoon

2009-10-04 03:11:07

How said i needed you to do it for me? I wanted to learn.

rogeruk

2009-10-04 03:13:27

Didnt say you did, just didnt wanna look like a unhelpful person by just posting links.

Ill be happy to solve any problems you encounter.

//Edit

With the seats you could simple make a seats database with a column for each movie and then 1 - 30 rows and simply 1 for seat taken 0 for free.

Simtoon

2009-10-04 03:15:44

Do you know anything about getting system time?

rogeruk

2009-10-04 03:19:02

[php]
TimeValue(Now)
[/php]

As date will return 00:25:58.

Depends what format you want it im

Simtoon

2009-10-04 03:26:32

I made it added on a label how do i make it change the time according eg. when you start it the time is 12:00 but 1 min later its 12:01 how do you make to automatically change

rogeruk

2009-10-04 03:29:13

Create a timer and set it to update however often you want

[php]Private Sub Timer1_Timer()
Label1.Caption = TimeValue(Now)
End Sub
[/php]

Set to timer interval to 100 (100ms) and it will update the label to the current time. every 100 ms

Simtoon

2009-10-04 03:36:53

Thanks Great Help.

fronty

2009-10-04 13:48:34

MSDN library can be very useful, IIRC it was included with Visual Studio 6.0.

Simtoon

2009-10-04 14:34:13

My dad has it somewhere on some cds need to find it.

rogeruk

2009-10-04 14:35:36

msdn.microsoft.com ?

Or just use the internet in general lol. Plenty of VB programming forums

Simtoon

2009-10-04 15:17:53


'Student Name(s) : Simon Ly

'Assignment Number : 1

'Declaration: I hereby certify that this assignment is entirely my own work, except where I have
'acknowledged all material and sources used in the preparation of this assignment.

'I certify that all typing/keystrokes have been done by me.

'I also certify that the material contained in this assignment has not previously been submitted
'for assessment in any formal course of study, and that I have not copied in part or whole, or
'otherwise plagiarised the work of other students and/or persons

'This program works out the seat reservations for an cinema and keeps track of avialable seats and booked seats.
Dim t As Double

Private Sub Combo1_Click()
If Combo1.Text = "a1" Then
Combo2.AddItem "b2"
End If
End Sub


Private Sub Command1_Click()
Dim a As Double
Dim c As Double
Dim s As Double


a = 15.95
c = 10.95
s = 8.5


t = (Text1 * a) + (Text2 * c) + (Text3 * s)

Label5.Caption = "$" & t

End Sub

Private Sub Command2_Click()
Dim p As Double
p = t
p = p - Text4.Text
Label7.Caption = p
End Sub

Private Sub Form_Load()
Combo1.AddItem "a1"
Combo1.AddItem "a2"
Combo1.AddItem "a3"
End Sub

Private Sub Timer1_Timer()
Label35.Caption = TimeValue(Now)
Label36.Caption = DateValue(Now)
End Sub


i havent done the selecting movie with database yet. is there anything i should change?

rogeruk

2009-10-04 15:21:33

Looks ok.

Start naming them correctly now. Its good practice to name them.

CMBmovie - Combo Box for selecting Movie
etc

fronty

2009-10-04 21:50:45

From: rogeruk
msdn.microsoft.com ?


I thought they would've taken VS6's library from official site because support has ended ages ago, but there's at least something. :O The ui of that site is still horrible. :p

NiiX

2009-10-05 12:53:06

I would recommend that you use a .ini file which downloads at startup of the program to a random dir OR the dir of the program, either way, you just update the ini, upload to an ftp and there u got an working system.

Example (don't have code with me atm) :

[Form load]

Download ini

Read ini and put the code in place, like :

Text1.Text = App.path/random path (if used random).INIFileName."MOVIES"."TIMES"


I know that might seem stupid but I have the code to make all that work, I'll check back soon and put in the actual code.

rogeruk

2009-10-05 15:37:33

INI files are a step back. I wouldnt suggest using them simple because your gonna get marked down for use of data types.

When you create a database the enduser can simple open it up and can easily alter the data.

Simtoon

2009-10-05 15:42:28

How would i display the day eg like Monday etc.
Also For seat selecting how would i do that?

rogeruk

2009-10-05 15:43:59

From: Simtoon
How would i display the day eg like Monday etc.
Also For seat selecting how would i do that?


What the current day?

I read over your course notes and it says that you have to use a seating class.

Simtoon

2009-10-06 03:03:53

From: rogeruk
What the current day?

I read over your course notes and it says that you have to use a seating class.


Yes Current Day.

So how would i do a seating class.?

rogeruk

2009-10-06 03:51:48

Maybe try

Weekday

Simtoon

2009-10-06 03:52:47

So how would i do a seating class.?

rogeruk

2009-10-06 03:55:43

The Visual Basic Project must include the use of a class called cinemaSeat. This describes each seat in the cinema which includes:
 Seat type (Adult, Child, Student or Pension)
 Seat Cost
 Seat Location (Eg: A6, C5)
 Seat Available (Stores Y for available and N for taken)
 Book seat function
 Check availability of a seat
 Display seats in cinema
 Calculate total cost
Note: the program may require more properties and/or functions for this class.
The Visual Basic Project must also include a two-dimensional array of this aforementioned class, that is, an array of cinema seats. This array
must be large enough to accommodate all seats in the cinema.
You need to create a class file to do all that.

http://msdn.microsoft.com/en-us/library/ms973814.aspx

NiiX

2009-10-10 12:22:07

From: rogeruk
INI files are a step back. I wouldnt suggest using them simple because your gonna get marked down for use of data types.

When you create a database the enduser can simple open it up and can easily alter the data.


I was thinking more of downloading to a random spot in the computer, rename to something random and THEN open it, that'll make it alot harder to find, OR at startup it downloads ini and runs, that way there only way to alter is to unplug your internet, and whats the point in that?