Автоматизация продажи и учета лекарственных средств
Form4.show;
end;
procedure TForm1.Table1FilterRecord(DataSet: TDataSet;
var Accept: Boolean);
begin
Accept:=Dataset['Name_lek'] = Edit1.text;
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
Table1.Filtered:=CheckBox1.Checked;
Table1.Filtered:=true;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnHint :=
ShowHint;
end;
procedure TForm1.ShowHint(Sender: TObject);
begin
StatusBar1.Panels[0].text := Application.Hint;
end;
procedure TForm1.N4Click(Sender: TObject);
begin
Form5.show;
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
Table1.Filtered:=False;
end;
end.
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Grids, DBGrids, Db, DBTables, StdCtrls, ExtCtrls, ComCtrls, Buttons,
Mask, DBCtrls;
type
TForm2 = class(TForm)
GroupBox1: TGroupBox;
DataSource1: TDataSource;
Table1: TTable;
DBGrid1: TDBGrid;
GroupBox2: TGroupBox;
DBGrid2: TDBGrid;
DataSource2: TDataSource;
Table2: TTable;
GroupBox3: TGroupBox;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Label1: TLabel;
Label2: TLabel;
GroupBox4: TGroupBox;
Panel1: TPanel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button9: TButton;
StatusBar1: TStatusBar;
GroupBox5: TGroupBox;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
DBEdit4: TDBEdit;
DBEdit5: TDBEdit;
DBEdit6: TDBEdit;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure OnActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1, Unit3;
{$R *.DFM}
procedure TForm2.Button1Click(Sender: TObject);
begin
If table1.State = dsBrowse then
table1.insert;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
If table1.State = dsBrowse then
table1.edit;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
If table1.State = dsBrowse then
If Messagedlg('',mtconfirmation,[mbYes,mbNo],0)=mrYes then
table1.delete;
end;
procedure TForm2.Button4Click(Sender: TObject);
begin
If table1.State in [dsInsert,dsEdit]then
table1.post;
end;
procedure TForm2.Button9Click(Sender: TObject);
begin
If table1.State in [dsInsert,dsEdit]then
table1.Cancel;
end;
procedure TForm2.Button5Click(Sender: TObject);
begin
If table2.State = dsBrowse then
table2.insert;
end;
procedure TForm2.Button6Click(Sender: TObject);
begin
If table2.State = dsBrowse then
If Messagedlg('',mtconfirmation,[mbYes,mbNo],0)=mrYes then
table2.delete;
end;
procedure TForm2.Button8Click(Sender: TObject);
begin
If table2.State = dsBrowse then
table2.edit;
end;
procedure TForm2.Button7Click(Sender: TObject);
begin
If table2.State in [dsInsert,dsEdit]then
table2.post;
end;
procedure TForm2.BitBtn1Click(Sender: TObject);
begin
Form1.show;
Form2.hide;
end;
procedure TForm2.BitBtn2Click(Sender: TObject);
begin
Form3.show;
Form2.hide;
end;
procedure TForm2.OnActivate(Sender: TObject);
begin
DBGrid2.Columns.Items[1].PickList.Clear;
with Table1 do begin
first;
While not eof do Begin
DBGrid2.columns.Items[1].Picklist.add(FieldByName('Kod_pred').value);
next;
end;
end;
end;
end.
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Db, DBTables, Grids, DBGrids, ComCtrls, Buttons,
Mask, DBCtrls;
type
TForm3 = class(TForm)
GroupBox1: TGroupBox;
DBGrid1: TDBGrid;
DataSource1: TDataSource;
Table1: TTable;
Label1: TLabel;
Label2: TLabel;
GroupBox2: TGroupBox;
Panel1: TPanel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
GroupBox3: TGroupBox;
DBGrid2: TDBGrid;
DataSource2: TDataSource;
Table2: TTable;
GroupBox4: TGroupBox;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
StatusBar1: TStatusBar;
GroupBox5: TGroupBox;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
DBEdit4: TDBEdit;
DBEdit5: TDBEdit;
DBEdit6: TDBEdit;
DBEdit7: TDBEdit;
DBEdit8: TDBEdit;
DBEdit9: TDBEdit;
DBEdit10: TDBEdit;
DBEdit11: TDBEdit;
procedure Button1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure OnActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
uses Unit1, Unit2;
{$R *.DFM}
procedure TForm3.Button1Click(Sender: TObject);
begin
If table2.State = dsBrowse then
table2.insert;
end;
procedure TForm3.Button4Click(Sender: TObject);
begin
If table2.State in [dsInsert,dsEdit]then
table2.post;
end;
procedure TForm3.Button3Click(Sender: TObject);
begin
If table2.State = dsBrowse then
table2.edit;
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
If table2.State = dsBrowse then
If Messagedlg('',mtconfirmation,[mbYes,mbNo],0)=mrYes then
table2.delete;
end;
procedure TForm3.Button5Click(Sender: TObject);
begin
If table1.State = dsBrowse then
table1.insert;
end;
procedure TForm3.Button6Click(Sender: TObject);
begin
If table1.State = dsBrowse then
If Messagedlg('',mtconfirmation,[mbYes,mbNo],0)=mrYes then
table1.delete;
end;
procedure TForm3.Button7Click(Sender: TObject);
begin
If table1.State = dsBrowse then
table1.edit;
end;
procedure TForm3.Button8Click(Sender: TObject);
begin
Другие рефераты на тему «Программирование, компьютеры и кибернетика»:
Поиск рефератов
Последние рефераты раздела
- Основные этапы объектно-ориентированного проектирования
- Основные структуры языка Java
- Основные принципы разработки графического пользовательского интерфейса
- Основы дискретной математики
- Программное обеспечение системы принятия решений адаптивного робота
- Программное обеспечение
- Проблемы сохранности информации в процессе предпринимательской деятельности