eld ;: TStringField ;: TStringField; _opl: TFloatField ;: TDataSource ;: TDataSource ;: TDataSource ;: TDataSource ;: TDataSource ;: TDataSource; _naim_fackult: TStringField; _naim_fackult: TStringField ;: TQuery ; DBLogin (Database: TDatabase; LoginParams: TStrings); QDogovorCalcFields (DataSet: TDataSet); QStoimostStoimostValidate (Sender: TField); QFackultetAfterPost (DataSet: TDataSet); QGruppaAfterPost (DataSet: TDataSet); QStudentAfterPost (DataSet: TDataSet); QDogovorAfterPost (DataSet:TDataSet); QDogovorBeforeDelete (DataSet: TDataSet); QDogovorBeforeEdit (DataSet: TDataSet); QDogovorBeforeInsert (DataSet: TDataSet); qrChange (Sender: TField); QDogovorAfterOpen (DataSet: TDataSet); QDogovorBeforePost (DataSet: TDataSet); DogovorRefresh; QOplataBeforePost ( DataSet: TDataSet); QOplataBeforeDelete (DataSet: TDataSet); QOplataBeforeEdit (DataSet: TDataSet); QOplataAfterPost (DataSet: TDataSet); QStoimostAfterPost (DataSet: TDataSet); QStoimostBeforeDelete (DataSet: TDataSet); QStoimostBeforeEdit (DataSet: TDataSet); QStoimostBeforePost (DataSet:TDataSet); QOplataAfterOpen (DataSet: TDataSet); QStoimostAfterOpen (DataSet: TDataSet); AppException (Sender: TObject; E: Exception);
{Private declarations}
public
{Public declarations}; _ kod: string ;: TDM; _con: boolean=true; UConnect, uMain, Ulib;
{$ R * .dfm} TDM.DBLogin (Database: TDatabase; LoginParams: TStrings); _ con:=true;:=TFrmConnect.Create (application); FrmConnect.ShowModal=mrOk then begin. Values ??[ USER NAME ]:=FrmConnect.EdUser.Text; .Values ??[ PASSWORD ]: =FrmConnect.EdPsw.Text; else_con:=false; .Free ;; not f_con then abort; TDM.QDogovorCalcFields (DataSet: TDataSet);
{DataSet.FieldByName ( Oplacheno ). AsFloat:=
((DataSet.FieldByName ( Procent_opl ). AsFloat) *
(DataSet.FieldByName ( Obsch_stoim ). AsFloat))/100}; TDM.QStoimostStoimostValidate (Sender: TField); Sender.Value lt; 0 then begin ( Вартість не може бути негативною! Raquo;);
Sender.Value:=Null ;;; TDM.QFackultetAfterPost (DataSet: TDataSet);s_kod:string;_kod:=DM.QFackultet.FieldByName(laquo;krat_naim_fackultraquo;).AsString;DM.QFackultet do begin ;;
Open;:=laquo;krat_naim_fackult=raquo;laquo;raquo;+s_kod+laquo;raquo;laquo;raquo;;
FindFirst ;;;; TDM.QGruppaAfterPost (DataSet: TDataSet); _ kod: string; _kod:=DM.QGruppa.FieldByName ( Kod_gr ). AsString; DM.QGruppa do begin ;; ;:= Kod_gr= + s_kod ;;;; TDM.QStudentAfterPost (DataSet: TDataSet); _ kod: string; _kod:=DM.QStudent.FieldByName ( Kod_stud ). AsString; DM.QStudent do begin;;;:=laquo;Kod_stud=raquo;laquo;raquo;+s_kod+laquo;raquo;laquo;raquo;;;;;TDM.QDogovorAfterPost(DataSet: TDataSet); _ kod: string; _kod:=DM.QDogovor.FieldByName ( Id_dogov ). AsString; DM.QDogovor do begin ;;;:= Id_dogov= + s_kod ;;;; TDM.QDogovorBeforeDelete ( DataSet: TDataSet); not CreateDeleteSql ( Dogovor raquo ;, laquo;Id_dogovraquo;,.FieldByName(laquo;Id_dogovraquo;).AsString)then;;TDM.QDogovorBeforeEdit(DataSet: TDataSet); (DataSet); _ kod:=DataSet.FieldByName ( Id_dogov ). AsString ;; TDM.QDogovorBeforeInsert (DataSet: TDataSet); (DataSet); _ kod:=- 1 raquo ;;; TDM.qrChange (Sender: TField) ;. Tag:=1 ;; TDM.QDogovorAfterOpen (DataSet: TDataSet) ;: word; i:=0 to DataSet.FieldCount - 1 do beginnot (DataSet.Fields [ i] .Lookup or DataSet.Fields [i] .Calculated) then.Fields [i] .OnChange:=qrChange; UpperCase (DataSet.Fields [i] .FieldName)= DATE_DOGOV then.Fields [i] .EditMask:=! 99.99.0000; 1; _ raquo ;;; TDM.QDogovorBeforePost (DataSet: TDataSet); (DataSet, Dogovor , Id_dogov raquo ;, s_kod);;TDM.DogovorRefresh;_id:string;_id:=QDogovor.FieldByName(laquo;Id_dogovraquo;).AsString;.Close;.Open;.Filter:= Id_dogov= + s_id; .FindFirst ;; TDM.QOplataBeforePost (DataSet: TDataSet); DataSet.State in [dsInsert] then.FieldByName(laquo;Id_dogovraquo;).AsString:=.FieldByName(laquo;Id_dogovraquo;).AsString;(DataSet,laquo;Oplataraquo;,laquo;Id_oplraquo;,s_kod);;TDM.QOplataBeforeDelete(DataSet: TDataSet); not CreateDeleteSql(laquo;Oplataraquo;,laquo;Id_oplraquo;,DataSet.FieldByName(laquo;Id_oplraquo;).AsString) then; .Refresh ;; TDM.QOplataBeforeEdit (DataSet: TDataSet); (DataSet); _ kod:=DataSet.FieldByName ( Id_opl ). AsString ;; TDM.QOplataAfterPost (DataSet: TDataSet) ;;; TDM.QStoimostAfterPost ( DataSet: TDataSet) ;;; TDM.QStoimostBeforeDelete (DataSet: TDataSet); not CreateDeleteSql(laquo;Stoimostraquo;,laquo;Id_oplraquo;,DataSet.FieldByName(laquo;Id_stoimraquo;).AsString) then ;;; TDM.QStoimostBeforeEdit (DataSet: TDataSet); (DataSet); _ kod:=DataSet.FieldByName ( Id_stoim ). AsString ;; TDM.QStoimostBeforePost (DataSet: TDataSet); DataSet.State in [dsInsert] then.FieldByName(laquo;Id_dogovraquo;).AsString:=.FieldByName(laquo;Id_dogovraquo;).AsString;(DataSet,laquo;Stoimostraquo;,l...