Скачиваний:
10
Добавлен:
17.06.2023
Размер:
1.58 Mб
Скачать

{$R *.dfm}

uses Unit4, Unit1;

procedure TfmDisRed.Button1Click(Sender: TObject); var a,r,ek,s:string;

begin

If ComboBox2.ItemIndex=0 then ek:='true' else ek:='false'; If ComboBox1.ItemIndex=0 then r:='true' else r:='false'; a:=fmDisciplini.ADODataSet1.FieldValues['D_N']; fmDisciplini.ADOQuery1.SQL.Clear;

if ((Edit1.Text='') or (Edit2.Text='')or (Edit3.Text='') or (Edit4.Text='') or (Edit5.Text=''))then

ShowMessage('Введены не все необходимые данные') else

if Edit2.Text='0' then ShowMessage('Номер семестра не может быть нулевым')

else begin

fmDisciplini.ADOQuery1.SQL.Add('update Disciplini set D_Disciplina='''+Edit1.Text+''', D_N_semestra='''+Edit2.Text+''', D_Lekcii='''+Edit3.Text+

''', D_Laboratornii='''+Edit4.Text+''', D_Practica='''+Edit5.Text+''', D_RZ='+r+', D_Ikzamen='+ek+' where D_N='+a+'');

fmDisciplini.ADOQuery1.ExecSQL;

fmDisciplini.ADODataSet1.Active:=false;

fmDisciplini.ADODataSet1.Active:=True;

close;

end;

end;

procedure TfmDisRed.Button2Click(Sender: TObject); begin

Close;

end;

procedure TfmDisRed.FormShow(Sender: TObject); var d,n,lk,p,lab:string;

begin d:=fmDisciplini.ADODataSet1.FieldValues['D_Disciplina']; Edit1.Text:=d; n:=fmDisciplini.ADODataSet1.FieldValues['D_N_semestra']; Edit2.Text:=n; lk:=fmDisciplini.ADODataSet1.FieldValues['D_Lekcii']; Edit3.Text:=lk; lab:=fmDisciplini.ADODataSet1.FieldValues['D_Laboratornii']; Edit4.Text:=lab;

p:=fmDisciplini.ADODataSet1.FieldValues['D_Practica']; Edit5.Text:=p;

end;

procedure TfmDisRed.Edit2KeyPress(Sender: TObject; var Key: Char);

begin

if not (key in ['0'..'9',#8]) then key:=#0; end;

procedure TfmDisRed.Edit3KeyPress(Sender: TObject; var Key: Char);

begin

if not (key in ['0'..'9',#8]) then key:=#0; end;

procedure TfmDisRed.Edit4KeyPress(Sender: TObject; var Key: Char);

begin

if not (key in ['0'..'9',#8]) then key:=#0; end;

procedure TfmDisRed.Edit5KeyPress(Sender: TObject; var Key: Char);

begin

if not (key in ['0'..'9',#8]) then key:=#0; end;

procedure TfmDisRed.ComboBox1KeyPress(Sender: TObject; var Key: Char);

begin case key of

'0'..'9' :key:=#0; end;

end;

procedure TfmDisRed.ComboBox2KeyPress(Sender: TObject; var Key: Char);

begin case key of

'0'..'9' :key:=#0; end;

end;

end.

unit Unit14; interface uses

Windows, Messages, SysUtils, Variants, Classes, Graphics,

Controls, Forms,

Dialogs, DBCtrls, Unit9, StdCtrls, Unit8, DB, ADODB;

procedure TfmUdPrep.Button2Click(Sender: TObject); begin

close;

end;

end.

unit Unit25; interface uses

Windows, Messages, SysUtils, Variants, Classes, Graphics,

Controls, Forms,

Dialogs, StdCtrls; type

TfmUdGR = class(TForm)

Button1: TButton;

Button2: TButton;

Label1: TLabel;

Label2: TLabel; fmPrepUd: TLabel;

procedure Button2Click(Sender: TObject); procedure Button1Click(Sender: TObject); private

{Private declarations } public

{Public declarations } end;

var

fmUdGR: TfmUdGR; implementation uses Unit9, Unit3; {$R *.dfm}

procedure TfmUdGR.Button2Click(Sender: TObject); begin

Close;

end;

procedure TfmUdGR.Button1Click(Sender: TObject); var

a:string; begin

a:=fmGruppi.ADODataSet2.FieldValues['G_N']; fmGruppi.ADOQuery1.SQL.Clear; fmGruppi.ADOQuery1.SQL.Add('delete * from Gruppi where G_N='+a+'');

fmGruppi.ADOQuery1.ExecSQL;

fmGrPrep.ADOQuery1.SQL.Clear;

fmGrPrep.ADOQuery1.SQL.Add('delete * from Svodnai where S_N='+a+'');

fmGrPrep.ADOQuery1.ExecSQL;

fmGrPrep.ADODataSet1.Active:=false;

fmGrPrep.ADODataSet1.Active:=True;

fmGruppi.ADODataSet2.Active:=false;

fmGruppi.ADODataSet2.Active:=True;

close;

end;

end.

unit Unit26; interface uses

Windows, Messages, SysUtils, Variants, Classes, Graphics,

Controls, Forms,

Dialogs, StdCtrls, Buttons; type

TfmGP = class(TForm)

Label1: TLabel;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

procedure BitBtn1Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); private

{Private declarations } public

{Public declarations } end;

var

fmGP: TfmGP; implementation

uses Unit9, Unit2;

{$R *.dfm}

procedure TfmGP.BitBtn1Click(Sender: TObject);

var

a:string;

begin

a:=fmGrPrep.ADODataSet1.FieldValues['S_N'];

fmGrPrep.ADOQuery1.SQL.Clear;

fmGrPrep.ADOQuery1.SQL.Add('delete * from Svodnai where S_N='+a+'');

fmGrPrep.ADOQuery1.ExecSQL;

fmGrPrep.ADODataSet1.Active:=false;

fmGrPrep.ADODataSet1.Active:=True;

close;

end;

procedure TfmGP.BitBtn2Click(Sender: TObject);

begin

close;

end;

end.

Соседние файлы в папке Курсовые работы