p align="justify"> Форма Студент
Stud ;, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ,, Menus, ExtCtrls, DBCtrls, Grids, DBGrids, StdCtrls, DB, ADODB;=class (TForm): TMainMenu;:TMenuItem ;: TDBGrid ;: TDBNavigator ;: TGroupBox ;: TGroupBox ;: TGroupBox ;: TDBLookupComboBox ;: TDBLookupComboBox ;: TEdit ;: TButton ;: TButton ;: TButton ;: TButton ;: TButton ;: TButton ;: TButton ;: TDataSource ;: TADOQuery ;: TADOQuery ;: TADOQuery; N1Click (Sender: TObject); FormClose (Sender: TObject; var Action: TCloseAction); Button1Click (Sender: TObject); Button2Click (Sender: TObject); Button3Click (Sender: TObject); Button4Click (Sender: TObject); Button7Click (Sender: TObject); Button6Click (Sender: TObject); Button5Click (Sender: TObject);
{Private declarations}
{Public declarations} ;: TForm2; Main, Data, Viborka, perevod;
{$ R * .dfm} TForm2.N1Click (Sender: TObject) ;. Close; .Show ;; TForm2.FormClose (Sender: TObject; var Action: TCloseAction) ;. Show ;; TForm2.Button1Click (Sender: TObject) ;. Close; .SQL.Clear; .SQL.Add ( Select Student.Famailiya,Student.Imya,Student.Otchestvo,Student.Data_r,Gruppa.Nazvanie,Student.Pol,Student.Kursraquo;);.SQL.Add(laquo; FROM Student INNER JOIN Gruppa ON Student.Id_gruppi=Gruppa.Id_gruppi ) ;. SQL.Add ( WHERE Student.Famailiya likeraquo;+#39+Edit1.Text+#39);.Open;.Show;.DBGrid1.Columns.Items[0].Width:=80;.DBGrid1.Columns.Items[1].Width:=80;.DBGrid1.Columns.Items[2].Width:=80;.DBGrid1.Columns.Items[3].Width:=80;.DBGrid1.Columns.Items[4].Width:=80;.DBGrid1.Columns.Items[5].Width:=80;.DBGrid1.Columns.Items[6].Width:=80;;TForm2.Button2Click(Sender: TObject) ;. Close; .SQL.Clear; .SQL.Add ( Select Student.Famailiya,Student.Imya,Student.Otchestvo,Student.Data_r,Gruppa.Nazvanie,Student.Pol,Student.Kursraquo;);.SQL.Add(laquo; FROM Student INNER JOIN Gruppa ON Student.Id_gruppi=Gruppa.Id_gruppi ) ;. SQL.Add ( WHERE Gruppa.Nazvanie likeraquo;+#39+DBLookupComboBox2.Text+#39);.Open;.Show;.DBGrid1.Columns.Items[0].Width:=80;.DBGrid1.Columns.Items[1].Width:=80;.DBGrid1.Columns.Items[2].Width:=80;.DBGrid1.Columns.Items[3].Width:=80;.DBGrid1.Columns.Items[4].Width:=80;.DBGrid1.Columns.Items[5].Width:=80;.DBGrid1.Columns.Items[6].Width:=80;;TForm2.Button3Click(Sender: TObject) ;. Close; .SQL.Clear; .SQL.Add ( Select Student.Famailiya,Student.Imya,Student.Otchestvo,Student.Data_r,Gruppa.Nazvanie,Student.Pol,Student.Kursraquo;);.SQL.Add(laquo; FROM Student INNER JOIN Gruppa ON Student.Id_gruppi=Gruppa.Id_gruppi ) ;. SQL.Add ( WHERE Gruppa.id_spec=raquo;+FloatToStr(DBLookupComboBox1.KeyValue));.Open;.Show;.DBGrid1.Columns.Items[0].Width:=80;.DBGrid1.Columns.Items[1].Width:=80;.DBGrid1.Columns.Items[2].Width:=80;.DBGrid1.Columns.Items[3].Width:=80;.DBGrid1.Columns.Items[4].Width:=80;.DBGrid1.Columns.Items[5].Width:=80;.DBGrid1.Columns.Items[6].Width:=80;;TForm2.Button4Click(Sender: TObject);(DBGrid1.DataSource.DataSet.FieldByName(laquo;Formaraquo;).AsString=laquo;очнаяraquo;) then (DBGrid1.DataSource.DataSet.FieldByName ( Kurs ). AsInteger lt; 5) then.Close; .SQL.Clear; .SQL.Add ( Update Student Set Kurs=Kurs + 1 Where Student.id_student= raquo ; + DBGrid1.DataSource.DataSet.FieldByName ( id_student ). AsString); 2.ExecSQL;
DataModule1.Student.Close; .Student.Open;
else
Application.MessageBox ( Неможливо перевести студента на курс старше (очна форма до 5 курсу) , Помилка , MB_OK);
if (DBGrid1.DataSource.DataSet.FieldByName(laquo;Formaraquo;).AsString=laquo;очно-заочнаяraquo;) then (DBGrid1.DataSource.DataSet.FieldByName ( Kurs ). AsInteger lt; 6) then.Close; .SQL.Clear; .SQL.Add ( Update Student Set Kurs=Kurs + 1 Where Student.id_student=raquo;+DBGrid1.DataSource.DataSet.FieldByName(laquo;id_studentraquo;).AsString);.ExecSQL;.Student.Close;.Student.Open;.MessageBox(laquo;Невозможно перевести студента на курс старше (очно-заочна форма до 6 курсу) , Помилка , MB_OK) ;; TForm2.Button7Click (Sender: TObject) ;. Close; .SQL.Clear; .SQL.Add ( DELETE FROM Ocenka WHERE id_student=raquo;+DBGrid1.DataSource.DataSet.FieldByName(laquo;id_studentraquo;).AsString);.ExecSQL;.Close;.SQL.Clear;.SQL.Add(laquo; DELETE FROM Student WHERE id_student=raquo;+DBGrid1.DataSource.DataSet.FieldByName(laquo;id_studentraquo;).AsString);.ExecSQL;.Student.Close;.Student.Open;;TForm2.Button8Click(Sender: TObject);.Variables[laquo;FIOraquo;]:=QuotedStr(DBGrid1.DataSource.DataSet.FieldByName(laquo;Famailiyaraquo;).AsString
+ + DBGrid1.DataSource.DataSet.FieldByName ( Imya ). AsString
+ + DBGrid1.DataSource.DataSet.FieldByName ( Otchestvo ). AsString
+ raquo;+DBGrid1.DataSource.DataSet.FieldByName(laquo;Data_rraquo;).AsString);.Variables[laquo;Kursraquo;]:=QuotedStr(DBGrid1.DataSource.DataSet.FieldByName...