Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 5 - 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 - Client Management Code


    (Page 5 of 6 )

    unit viewclients;

    interface

    uses

      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

      Dialogs, Grids, DBGrids, StdCtrls, DB, ADODB, Buttons, ExtCtrls, DBCtrls;

    type

      TForm6 = class(TForm)

        DBGrid1: TDBGrid;

        adoc: TADOTable;

        DataSource1: TDataSource;

        Panel1: TPanel;

        mem: TMemo;

        edname: TEdit;

        edcontact: TEdit;

        edfax: TEdit;

        edemail: TEdit;

        edphone: TEdit;

        StaticText1: TStaticText;

        StaticText2: TStaticText;

        StaticText3: TStaticText;

        StaticText4: TStaticText;

        StaticText5: TStaticText;

        StaticText6: TStaticText;

        btnAddC: TBitBtn;

        RadioButton1: TRadioButton;

        BitBtn1: TBitBtn;

        btnExit: TBitBtn;

        Panel2: TPanel;

        DBMemo1: TDBMemo;

        StaticText7: TStaticText;

        procedure Button1Click(Sender: TObject);

        procedure btnAddCClick(Sender: TObject);

        procedure btnExitClick(Sender: TObject);

        procedure RadioButton1Click(Sender: TObject);

        procedure FormActivate(Sender: TObject);

        procedure BitBtn1Click(Sender: TObject);

        procedure FormCreate(Sender: TObject);

      private

        { Private declarations }

      public

        { Public declarations }

       

      end;

    var

      Form6: TForm6;

    implementation

    {$R *.dfm}

    uses invmain;

    procedure activatewidgets;

    begin

    form6.edname.Enabled:=true;

    form6.edemail.Enabled:=true;

    form6.edphone.Enabled:=true;

    form6.edfax.Enabled:=true;

    form6.edcontact.Enabled:=true;

    form6.btnaddc.Enabled:=true;

    form6.mem.Enabled:=true;

    end;

    procedure de_activatewidgets;

    begin

    form6.edname.Enabled:=false;

    form6.edemail.Enabled:=false;

    form6.edphone.Enabled:=false;

    form6.edfax.Enabled:=false;

    form6.edcontact.Enabled:=false;

    form6.btnaddc.Enabled:=false;

    form6.mem.Enabled:=false;

    //empty the widgets

    form6.edname.Clear;

    form6.edemail.Clear;

    form6.edphone.Clear;

    form6.edfax.Clear;

    form6.edcontact.Clear;

    form6.mem.Clear;

    form6.RadioButton1.Checked:=false;

    end;

    procedure TForm6.Button1Click(Sender: TObject);

    begin

    close;

    end;

    procedure TForm6.btnAddCClick(Sender: TObject);

    begin

    with adoc do

    begin

    try

    Screen.Cursor := crHourGlass;

    Insert;

    FieldByName('name').Text := edname.Text;

    FieldByName('address').AsString :=mem.Lines.Text;

    FieldByName('email').text := edemail.text;

    FieldByName('phone').text :=edphone.Text;

    FieldByName('fax').text :=edfax.Text;

    FieldByName('contact').text := edcontact.Text;

    post;

    except on E : Exception do

    showmessage(e.Message);

    end;

    end;

    messagedlg(edname.text + ' has been added.',mtInformation,

          [mbOk], 0);

    Screen.Cursor := crDefault;

    de_activatewidgets;

    end;

    procedure TForm6.btnExitClick(Sender: TObject);

    begin

    close;

    end;

    procedure TForm6.RadioButton1Click(Sender: TObject);

    begin

    activatewidgets;

    end;

    procedure TForm6.FormActivate(Sender: TObject);

    begin

    de_activatewidgets;

    end;

    procedure TForm6.BitBtn1Click(Sender: TObject);

    begin

    if adoc.RecNo > 0 then

    adoc.Delete;

    adoc.Refresh;

    end;

    procedure TForm6.FormCreate(Sender: TObject);

    begin

    adoc.ConnectionString:=form1.con;

    adoc.Active:=true;

    dbgrid1.Hint:='Click to make changes to the client details. '+#13#10+' Any changes you make will automatically be updated.';

    end;

    end.

    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-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek