www.pudn.com > Source.rar > Unit22.pas, change:2007-02-04,size:2651b


unit Unit22; 
 
interface 
 
uses 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, Buttons, Grids, DBGrids, StdCtrls, Mask, DBCtrls, ComCtrls, 
  Menus, ExtCtrls,DB; 
 
type 
  TSai_Stock = class(TForm) 
    DBGrid1: TDBGrid; 
    Panel1: TPanel; 
    DBText4: TDBText; 
    Label2: TLabel; 
    Label4: TLabel; 
    Panel2: TPanel; 
    Image1: TImage; 
    Panel9: TPanel; 
    DBText6: TDBText; 
    Panel10: TPanel; 
    PopupMenu1: TPopupMenu; 
    Supprimer1: TMenuItem; 
    N1: TMenuItem; 
    BitBtn1: TBitBtn; 
    BitBtn2: TBitBtn; 
    BitBtn4: TBitBtn; 
    DBEdit1: TDBEdit; 
    Titre1: TLabel; 
    procedure BitBtn1Click(Sender: TObject); 
    procedure BitBtn2Click(Sender: TObject); 
    procedure DBGrid1EditButtonClick(Sender: TObject); 
    procedure Supprimer1Click(Sender: TObject); 
    procedure BitBtn4Click(Sender: TObject); 
    procedure FormActivate(Sender: TObject); 
    procedure FormClose(Sender: TObject; var Action: TCloseAction); 
    procedure DBGrid1KeyPress(Sender: TObject; var Key: Char); 
  private 
    { Private declarations } 
  public 
    { Public declarations } 
  end; 
 
var 
  Sai_Stock: TSai_Stock; 
 
implementation 
 
uses Unit3, Unit24, Unit25, Unit9, Unit29, Unit55 , Unit83, Unit74; 
 
{$R *.dfm} 
 
procedure TSai_Stock.BitBtn1Click(Sender: TObject); 
begin 
data.L_Stock.First; 
while Not data.L_Stock.Eof Do 
  Begin 
  data.L_Stock.Edit; 
  data.L_StockDate.Value:=data.T_StockDate.Value; 
  data.L_Stock.Post; 
  data.l_stock.Next; 
  end; 
data.T_Stock.Post; 
close; 
end; 
 
procedure TSai_Stock.BitBtn2Click(Sender: TObject); 
begin 
data.T_Stock.Cancel; 
close; 
end; 
 
procedure TSai_Stock.DBGrid1EditButtonClick(Sender: TObject); 
begin 
  if list_Articles.ShowModal=mrOk Then 
     begin 
     data.L_Stock.Edit; 
     data.L_StockReference.Value:=list_Articles.Recher; 
     end; 
end; 
 
 
procedure TSai_Stock.Supprimer1Click(Sender: TObject); 
begin 
if data.L_Stock.RecordCount<>0 then 
       Data.L_Stock.Delete; 
 
end; 
 
procedure TSai_Stock.BitBtn4Click(Sender: TObject); 
begin 
imprime_Stock.ShowModal; 
end; 
 
procedure TSai_Stock.FormActivate(Sender: TObject); 
begin 
CASE choix_Stock.Choix.ItemIndex OF 
0: Titre1.Caption:= 'Entrées'; 
1: Titre1.Caption:= 'Sortie'; 
2: Titre1.Caption:= 'INVENTAIRE'; 
end; 
end; 
 
procedure TSai_Stock.FormClose(Sender: TObject; var Action: TCloseAction); 
begin 
if data.T_Stock.State in [dsedit,dsinsert] Then 
  Data.T_StockAfterCancel(Data.T_Ventes); 
 
end; 
 
procedure TSai_Stock.DBGrid1KeyPress(Sender: TObject; var Key: Char); 
begin 
if key='.' then key:=','; 
end; 
 
end.