Автоматизация продажи и учета лекарственных средств

If table1.State in [dsInsert,dsEdit]then

table1.post;

end;

procedure TForm3.BitBtn1Click(Sender: TObject);

begin

Form1.show;

Form3.hide;

end;

procedure TForm3.BitBtn2Click(Sender: TObject);

begin

Form2.show;

Form3.hide;

end;

procedure TForm3.OnActivate(Sender: TObject);

begin

DBGrid2.Columns.Items[3].PickList.Clear;

with Form1.Tabl

e1 do begin

first;

While not eof do Begin

DBGrid2.columns.Items[3].Picklist.add(FieldbyName('Kod_lek').value);

next;

end;

end;

DBGrid2.Columns.Items[1].PickList.Clear;

with Form2.Table2 do begin

first;

While not eof do Begin

DBGrid2.columns.Items[1].Picklist.add(FieldbyName('Nom_naklad').value);

next;

end;

end;

DBGrid2.Columns.Items[2].PickList.Clear;

with Form2.Table1 do begin

first;

While not eof do Begin

DBGrid2.columns.Items[2].Picklist.add(FieldbyName('Kod_pred').value);

next;

end;

end;

DBGrid1.Columns.Items[1].PickList.Clear;

with Form1.Table1 do begin

first;

While not eof do Begin

DBGrid1.columns.Items[1].Picklist.add(FieldbyName('Kod_lek').value);

next;

end;

end;

end;

end.

unit Unit4;

interface

uses

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

StdCtrls, Db, DBTables, Grids, DBGrids, ExtCtrls;

type

TForm4 = class(TForm)

GroupBox1: TGroupBox;

DBGrid1: TDBGrid;

DataSource1: TDataSource;

Button1: TButton;

Query1: TQuery;

Edit1: TEdit;

Button3: TButton;

RadioGroup1: TRadioGroup;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

procedure Query1FilterRecord(DataSet: TDataSet; var Accept: Boolean);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form4: TForm4;

pole :shortstring;

implementation

{$R *.DFM}

procedure TForm4.Button1Click(Sender: TObject);

begin

Query1.Filtered:=false;

Query1.Active:=true;

end;

procedure TForm4.Button2Click(Sender: TObject);

begin

Query1.Active:=false;

end;

procedure TForm4.Button3Click(Sender: TObject);

begin

Query1.Filtered:=false;

Case Radiogroup1.itemindex of

0:pole:='Name_lek';

1:pole:='Kolvo_p_lek'

end;

Query1.Filtered:=true;

end;

procedure TForm4.Query1FilterRecord(DataSet: TDataSet;

var Accept: Boolean);

begin

Accept:=Dataset[pole]=edit1.text;

end;

end.

unit Unit5;

interface

uses

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

StdCtrls, ExtCtrls, Buttons;

type

TForm5 = class(TForm)

Image1: TImage;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

BitBtn1: TBitBtn;

Label6: TLabel;

procedure Button1Click(Sender: TObject);

procedure BitBtn1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form5: TForm5;

implementation

{$R *.DFM}

procedure TForm5.Button1Click(Sender: TObject);

begin

Form5.close;

end;

procedure TForm5.BitBtn1Click(Sender: TObject);

begin

Form5.Close;

end;

end.

Страница:  1  2  3  4  5  6  7 


Другие рефераты на тему «Программирование, компьютеры и кибернетика»:

Поиск рефератов

Последние рефераты раздела

Copyright © 2010-2024 - www.refsru.com - рефераты, курсовые и дипломные работы