Delphi-Kylix
  Home arrow Delphi-Kylix arrow Looking at the Details for an Invoicing Ap...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Looking at the Details for an Invoicing Application in Delphi
By: Chris Neeman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2007-07-16

    Table of Contents:
  • Looking at the Details for an Invoicing Application in Delphi
  • Settings Unit
  • New Invoice Form and Code
  • Invoice Management Code and Output
  • Client Management Code
  • Final output and Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Looking at the Details for an Invoicing Application in Delphi


    (Page 1 of 6 )

    In the previous article we discussed the requirements and purpose of the invoicing application that we are creating. We also listed the main application code. In this part of the article we are going to look at how to connect the database that we created earlier to the application code. We will also look at some of the code in detail.
    A downloadable .rar file is available for this article.

    How the application works

    The invoice application works by storing and retrieving its information in the database that we created earlier.  When the application is first started, it loads certain application-specific settings from an ini file. See the code below:

    procedure TForm1.FormCreate(Sender: TObject);

    var

    settings : TINIFile;

    begin

    settings := TINIFile.Create(ExtractFilePath(Application.EXEName) + 'settings.ini');

      try

    con:=settings.ReadString('Settings', 'con','');

      //showmessage(con);

    vat:=settings.ReadFloat('Settings', 'vat',8.5);

      //  showmessage(floattostr(vat));

    rav:=settings.ReadString('Settings', 'rav','');

       finally

       settings.Free;

       end;

        end;

    The code shows the oncreate event of the first form in the application. This code loads the following information:

    • con – This string contains the path to the database and will be used throughout the application to connect to the database tables.
    • vat - This is the VAT rate that the application will use when it calculates the totals.
    • rav – This variable stores the path to the rave report file that contains the output designs of the invoice.

    This method of storing and retrieving data increases the application’s portability. You can change these values in the ini file by clicking on the settings menu item, which will bring up a window for you to set new values. The next page has a screen shot of what that form looks like and also the code listing for the settings unit.

    More Delphi-Kylix Articles
    More By Chris Neeman


     

    DELPHI-KYLIX ARTICLES

    - Loading an XML Document into the DOM
    - Delphi Wrapper Classes and XML
    - Delphi and the DOM
    - Delphi and XML
    - Internet Access: Client Service
    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek