Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 4 - Invoicing in Delphi: Show Me the Money
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  
Dedicated Servers  
Actuate Whitepapers 
VeriSign Whitepapers 
IBM® developerWorks 
Sun Developer Network 
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

Invoicing in Delphi: Show Me the Money
By: Chris Neeman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2007-07-09

    Table of Contents:
  • Invoicing in Delphi: Show Me the Money
  • Building the Database
  • Building the Application Interface
  • Finished Code
  • Rest of the Code and the 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Invoicing in Delphi: Show Me the Money - Finished Code


    (Page 4 of 5 )

    Below is the listing for the entire main unit:

    unit invmain;

    interface

    uses

      Windows, Messages, SysUtils, Variants, Classes, Graphics,
      Controls, Forms,
    Dialogs, Buttons, StdCtrls, RpDefine, RpCon,
      RpConDS, DB, ADODB, Grids, 
    DBGrids, RpRave, Menus, ExtCtrls,
      ToolWin, ComCtrls,math, INIFiles,
    RpRender, RpRenderPDF,
      RpRenderRTF, RpRenderHTML;

    type 
      TForm1 = class(TForm) 
        MainMenu1: TMainMenu; 
        PopupMenu1: TPopupMenu; 
        File1: TMenuItem; 
        Windows1: TMenuItem; 
        Clients1: TMenuItem; 
        ools1: TMenuItem; 
        Settings1: TMenuItem; 
        ViewAllClients1: TMenuItem; 
        About1: TMenuItem; 
        Exit1: TMenuItem; 
        Panel1: TPanel; 
        btndelete: TBitBtn; 
        Statistics1: TMenuItem; 
        btnAddInv: TBitBtn; 
        srchpnl: TPanel; 
        rb1: TRadioButton; 
        rb2: TRadioButton; 
        edsearch: TEdit; 
        btnsearch: TBitBtn; 
        BitBtn1: TBitBtn; 
        Label1: TLabel; 
        Label2: TLabel; 
        StaticText2: TStaticText; 
        StaticText3: TStaticText; 
        db1: TDBGrid; 
        ado1: TADOTable; 
        d1: TDataSource; 
        ado1invno: TAutoIncField; 
        ado1invname: TWideStringField; 
        ado1invdate: TDateTimeField; 
        ado1notes: TMemoField; 
        ado1status: TWideStringField; 
        ado1amount: TBCDField; 
        ado1total: TBCDField; 
        procedure File1Click(Sender: TObject); 
        procedure CreateNewInvoice1Click(Sender: TObject); 
        procedure BitBtn2Click(Sender: TObject); 
        procedure db1DblClick(Sender: TObject); 
        procedure Exit1Click(Sender: TObject); 
        procedure FormCreate(Sender: TObject); 
        procedure db1CellClick(Column: TColumn); 
        procedure FormShow(Sender: TObject); 
        procedure btndeleteClick(Sender: TObject); 
        procedure btnAddInvClick(Sender: TObject); 
        procedure Statistics1Click(Sender: TObject); 
        procedure btnsearchClick(Sender: TObject); 
        procedure Settings1Click(Sender: TObject); 
        procedure ViewAllClients1Click(Sender: TObject); 
        procedure About1Click(Sender: TObject); 
        procedure BitBtn1Click(Sender: TObject); 
        procedure ado1AfterPost(DataSet: TDataSet); 
        procedure ado1AfterScroll(DataSet: TDataSet); 
       { procedure ado1AfterPost(DataSet: TDataSet); 
        procedure ado1AfterScroll(DataSet: TDataSet); }

      private 
        { Private declarations }

      public 
        { Public declarations } 
         vat:real; 
         con,rav:string; 
         num:integer; 
      end;

    var 
      Form1: TForm1;

    implementation

    {$R *.dfm}

    uses newinv,viewchange, stats, settings, viewclients, about;
    procedure TForm1.File1Click(Sender: TObject);
    begin
     
    close;
    end;

    procedure TForm1.CreateNewInvoice1Click(Sender: TObject);
    begin
     
    form2.Show;
    end;

    procedure TForm1.BitBtn2Click(Sender: TObject);
    begin
     
    close;
    end;

    procedure TForm1.db1DblClick(Sender: TObject);
    begin
     
    //num:=db1.Fields[0].AsInteger;
     
    num:=ado1.RecNo;
     
    ado1.recno:=num;
     
    with TForm5.Create(Application) do
     
    begin 
     
      ShowModal; 
     
      Free;
     
    end;

      //form5.show;
    end;

    procedure TForm1.Exit1Click(Sender: TObject);
    begin
     
    close;
    end;

    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','');
     
    showmessage(rav); 
      finally 
       settings.Free; 
      end; 
      {if (ip= 'Empty') or (port<1) then begin 
        messagedlg('Your connection details are not set. Click ok to continue.', mtInformation,[mbOk], 0); 
         } 
    end;

    procedure TForm1.db1CellClick(Column: TColumn);
    begin
      //a:='clicked';
    end;

    procedure TForm1.FormShow(Sender: TObject);

    var
     
    i:integer;

    begin
     
    //set ado properties
     
    ado1.ConnectionString:=con;
     
    ado1.TableName:='invoices';
     
    ado1.Active:=true;
     
    label1.caption:=inttostr(ado1.RecordCount); 
      i:=ado1.RecordCount;
     
    label2.Caption:=inttostr(i);
    end;

    procedure TForm1.btndeleteClick(Sender: TObject);
    begin
     
    if ado1.RecordCount > 0 then
     
    begin
       
    ado1.Delete;
     
    end
     
    else
       
    showmessage('No invoices to delete');
    end;

    procedure TForm1.btnAddInvClick(Sender: TObject);
    begin
     
    ado1.Active:=false;
     
    //form1.ado1.TableName:='';
     
    form2.show;
    end;

    More Delphi-Kylix Articles
    More By Chris Neeman


     

    DELPHI-KYLIX ARTICLES

    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...
    - Using the Client Dataset in Two-Tiered Clien...
    - Using the Client Dataset in File-Based Archi...
    - Demystifying the Client Dataset
    - Working with INI Files in Delphi
    - Creating Data Link (UDL) Files in Delphi
    - Looking at the Details for an Invoicing Appl...
    - Invoicing in Delphi: Show Me the Money
    - Saving Images and Binary Files to a Database...
    - Saving Files to a Database using Delphi: Sav...
    - Creating CF Applications and Integrating a S...
    - Using Try and Finally to Help Prevent Memory...
    - The Implementation of an FTP Server
    - FTP Server: The Theory







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway