question

RAVI-6930 avatar image
0 Votes"
RAVI-6930 asked RAVI-6930 answered

Seat Booking need example with code

Hello


We have 3 seats available each 8 hrs and we run two shifts

first shifts = 09:00 = 17:00
second shift = 17:30 = 01:30

For Example : 1 Todays Date Is 01-AUG-2021 and user enter In Textbox1 and Textbox2 like this below

Rajesh 22
Mohan 40
Priya 23

On button click i want to save like this below in MS SQL BOOKING_TABLE

Date Booking_shift seat1 seat2 seat3
01-Aug-2021 09:00 = 17:00 Rajesh-22 Mohan-40 Priya-23


For Example : 2 Now one more user coming On 01-Aug-2021 he is giving data like this

Johar 18
Rani 22

On button click i want to save like this below in MS SQL BOOKING_TABLE

Date Booking_shift seat1 seat2 seat3
01-Aug-2021 09:00 = 17:00 Rajesh-22 Mohan-40 Priya-23
01-Aug-2021 17:30 = 01:30 Johar-18 Rani-22

For Example : 3 02-AUg-2021 no is coming next one more user coming 03-AUG-2021 he is giving data like this

Arshad 25
John 19

On button click i want to save like this below in MS SQL BOOKING_TABLE

Date Booking_shift seat1 seat2 seat3
01-Aug-2021 09:00 = 17:00 Rajesh-22 Mohan-40 Priya-23
01-Aug-2021 17:30 = 01:30 Johar-18 Rani-22
03-Aug-2021 09:00 = 17:00 Arhsad-25 John-19

how to do this in old asp.net 2.0 C#
thank you

dotnet-aspnet-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RAVI-6930,
Do you want that if today is 01-Aug-2021 and comes 7 users. The data will be saved like three in the 01-Aug-2021 09:00 = 17:00, three in the 01-Aug-2021 17:30 = 01:30 and the other one is 03-Aug-2021 09:00 = 17:00. Do you want like this? Do you need to write sql query to insert these data in the old asp.net webform?
Best regards,
Yijing Sun

0 Votes 0 ·
RAVI-6930 avatar image
0 Votes"
RAVI-6930 answered YijingSun-MSFT commented

Hello

Simple Way To Say Instert In MS SQL TABLE Like Movie Ticket Booking IF seat available it has to say already plan if not then have to move next available slot per day the movie run in theater in two times slot first shifts = 09:00 = 17:00
second shift = 17:30 = 01:30

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RAVI-6930 ,

How do you design your codes and database? As far as I think,the best way is when you come a user and he will save his booking information in the database.If three seats have booked every time, you could do a prohibition that users can't select the time.You only need to check the number of the seat in the database.

0 Votes 0 ·
RAVI-6930 avatar image
0 Votes"
RAVI-6930 answered

Thank you

Please give me one small example complete code with aspx and c# code page.. Thanks

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.