C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 14th, 2004, 08:38 PM
Konni04 Konni04 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 1 Konni04 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Displaying tickets between two dates ?

Hi there,

I'm building a small program wich handles ticket sales for a lowbudget airliner(project for school)

I'm trying to display all trips inbetween two dates. so far I've come with this code. But, of course its not working :P

any ideas .


cheers.
Konni.

Code:
void __fastcall TfrmMain::btnShowPeriodClick(TObject *Sender)
{
 
	lsvLists->Items->Clear();
	lsvLists->Column[0]->Caption = "Flightnumber";
	lsvLists->Column[1]->Caption = "To";
	lsvLists->Column[2]->Caption = "From";
	lsvLists->Column[3]->Caption = "Date";
 
	Flight flight;
 
	if (((int)dtpDate1 >= (TDateTime)flight.getDayDeparture()) && ((int)dtpDate2 <= (TDateTime)flight.getDayDeparture()))
	{
	 TListItem* Item;
		Item=lsvLists->Items->Add();
		Item->Caption = flight.getFlightNumber();
		Item->SubItems->Add(flight.getArrivalPlace());
		Item->SubItems->Add(flight.getDeparturePlace());
		Item->SubItems->Add((TDateTime)flight.getDayDeparture());
	 }
} 

Reply With Quote
  #2  
Old December 15th, 2004, 01:34 PM
marmo marmo is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 37 marmo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 15 m 20 sec
Reputation Power: 5
Is there a specific area your having trouble with? It looks like you already have a flight class created. You can stick them in a list, vector, array, tree whichever. You may want to do some operator overloading for the >> and << operators to make it easier to input and output flights. If you are using an stl List or Vector you might need to overload the == operator so you can use find() algothim to get specific flights.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Displaying tickets between two dates ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT