unit umain;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,ShellAPI,
  Dialogs, ImgList, StdCtrls, ComCtrls, AdvGlowButton, AdvToolBar, dxCore,
  dxButton, DB, IBCustomDataSet, IBQuery;

type
  TfRMMAIN = class(TForm)
    AdvToolBarPager1: TAdvToolBarPager;
    AdvToolBarPager11: TAdvPage;
    dxButton1: TdxButton;
    dxButton26: TdxButton;
    AdvToolBarPager12: TAdvPage;
    dxButton3: TdxButton;
    dxButton14: TdxButton;
    dxButton15: TdxButton;
    dxButton16: TdxButton;
    AdvToolBarPager13: TAdvPage;
    dxButton4: TdxButton;
    dxButton20: TdxButton;
    dxButton21: TdxButton;
    dxButton23: TdxButton;
    dxButton24: TdxButton;
    AdvPage2: TAdvPage;
    dxButton2: TdxButton;
    Label2: TLabel;
    societeactive: TLabel;
    AdvQuickAccessToolBar1: TAdvQuickAccessToolBar;
    AdvGlowButton1: TAdvGlowButton;
    AdvGlowButton2: TAdvGlowButton;
    AdvGlowButton3: TAdvGlowButton;
    AdvGlowButton4: TAdvGlowButton;
    dxButton52: TdxButton;
    GroupBox1: TGroupBox;
    RichEdit1: TRichEdit;
    dxButton28: TdxButton;
    dxButton29: TdxButton;
    ImageList1: TImageList;
    ExecuterSql: TIBQuery;
    dxButton6: TdxButton;
    procedure dxButton28Click(Sender: TObject);
    procedure dxButton52Click(Sender: TObject);
    procedure AdvGlowButton4Click(Sender: TObject);
    procedure AdvGlowButton1Click(Sender: TObject);
    procedure AdvGlowButton2Click(Sender: TObject);
    procedure dxButton4Click(Sender: TObject);
    procedure dxButton20Click(Sender: TObject);
    procedure dxButton21Click(Sender: TObject);
    procedure dxButton1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure dxButton6Click(Sender: TObject);
    procedure dxButton3Click(Sender: TObject);
    procedure dxButton14Click(Sender: TObject);
    procedure dxButton15Click(Sender: TObject);
    procedure dxButton16Click(Sender: TObject);
    procedure dxButton24Click(Sender: TObject);
    procedure dxButton2Click(Sender: TObject);
    procedure dxButton23Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    Societe,exercice,nomsociete,adresse,activite,matricule,cle,categorie,etablissement,codepostal,ville,numerorue,TVA,libelle,libelle1:STRING;
    indice,indice1,indicesociete:integer;
  end;

var
  fRMMAIN: TfRMMAIN;

implementation

uses udataprix, Usocietes, udevise, uetatterritoire, Uparamsociete,
  uinfogroupe, uoperations, uvalidation, ugeneration, Uinitialisation;

{$R *.dfm}

procedure TfRMMAIN.dxButton28Click(Sender: TObject);
begin
   EXECUTERSQL.Close;
  EXECUTERSQL.SQL.Clear;
  EXECUTERSQL.SQL.Add(' '+RichEdit1.Text +'');
  EXECUTERSQL.Open;
  Dataprix.IBTransaction1.CommitRetaining;
  showmessage('Sql Exécuté');
end;

procedure TfRMMAIN.dxButton52Click(Sender: TObject);
begin
 APPLICATION.Terminate;
end;

procedure TfRMMAIN.AdvGlowButton4Click(Sender: TObject);
begin
 ShellExecute(handle, 'open', '..\Calc.exe', '', '', SW_SHOWNORMAL);
end;

procedure TfRMMAIN.AdvGlowButton1Click(Sender: TObject);
begin
 previous;
end;

procedure TfRMMAIN.AdvGlowButton2Click(Sender: TObject);
begin
 NEXT;
end;

procedure TfRMMAIN.dxButton4Click(Sender: TObject);
begin
 indicesociete:=2; 
 Application.CreateForm(Tfrmsocietes,frmsocietes);
 frmsocietes.Show;
end;

procedure TfRMMAIN.dxButton20Click(Sender: TObject);
begin
 Application.CreateForm(TFrmdevise,Frmdevise);
 Frmdevise.Show;
end;

procedure TfRMMAIN.dxButton21Click(Sender: TObject);
begin
 Application.CreateForm(TFrmetatterritoire,Frmetatterritoire);
 Frmetatterritoire.Show;
end;

procedure TfRMMAIN.dxButton1Click(Sender: TObject);
begin
 Application.CreateForm(Tfrmparamsociete,frmparamsociete);
 Dataprix.Societe.Edit;
 frmparamsociete.Show;
end;

procedure TfRMMAIN.FormCreate(Sender: TObject);
begin
  indicesociete:=1;
end;

procedure TfRMMAIN.dxButton6Click(Sender: TObject);
begin
 Application.CreateForm(Tfrminfogroupe,frminfogroupe);
 Dataprix.Societe.Edit;
 frminfogroupe.Show;
end;

procedure TfRMMAIN.dxButton3Click(Sender: TObject);
begin
 frmmain.indice:=1;
 Application.CreateForm(TFrmoperations,Frmoperations);
 Frmoperations.Show;
end;

procedure TfRMMAIN.dxButton14Click(Sender: TObject);
begin
 frmmain.indice:=2;
 Application.CreateForm(TFrmoperations,Frmoperations);
 Frmoperations.Show;
end;

procedure TfRMMAIN.dxButton15Click(Sender: TObject);
begin
 frmmain.indice:=3;
 Application.CreateForm(TFrmoperations,Frmoperations);
 Frmoperations.Show;
end;

procedure TfRMMAIN.dxButton16Click(Sender: TObject);
begin
 frmmain.indice:=4;
 Application.CreateForm(TFrmoperations,Frmoperations);
 Frmoperations.Show;
end;

procedure TfRMMAIN.dxButton24Click(Sender: TObject);
begin
 Application.CreateForm(tfrmvalidation,frmvalidation);
 Frmvalidation.ShowModal;
 Application.Terminate;
end;

procedure TfRMMAIN.dxButton2Click(Sender: TObject);
begin
 Application.CreateForm(Tfrmgeneration,frmgeneration);
 frmgeneration.ShowModal;
end;

procedure TfRMMAIN.dxButton23Click(Sender: TObject);
begin
 Application.CreateForm(TFrminitialisation,Frminitialisation);
 Frminitialisation.ShowModal;
end;

end.
