.


:




:

































 

 

 

 


If dm.TEMP4.Fields[0].AsString<>'' then




Begin

{11} showmessage(' ');

{12} exit;

End

Else

Begin

{17} dm.COM.CommandText:='INSERT INTO kadri (fio_st,id_nc_st,id_ug_st,id_zv_st) values ("'+TRIM(e1.Text)+'",'+id_n+','+id_ug+','+id_zv+')';

{18} dm.COM.Execute;

{19} showmessage(' ');

{21} dm.st.active:=false;

{22} dm.st.Active:=true;

{23} BitBtn1Click(Sender);

{24} end;

End

Else

Begin

{6} dm.TEMP4.Active:=false;

{7} dm.TEMP4.CommandText:='Select * FROM kadri WHERE (fio_st = "'+TRIM(e1.Text)+'") AND (id_nc_st = '+id_n+') AND (id_ug_st = '+id_ug+') AND (id_zv_st = '+id_zv+')';

{8} dm.TEMP4.Active:=true;

If dm.TEMP4.Fields[0].AsString<>'' then

Begin

If dm.TEMP4.Fields[0].AsString <>dm.st.Fields[0].AsString then

Begin

{35} showmessage(' ');

{36} exit;

{37} end;

End

Else

Begin

{42} dm.COM.CommandText:='Update kadri SET fio_st = "'+TRIM(e1.Text)+'",id_nc_st = "'+id_n+'",id_ug_st = "'+id_ug+'",id_zv_st = "'+id_zv+'" WHERE id_st = '+dm.st.Fields[0].AsString+'';

{43} dm.COM.Execute;

{44} showmessage(' ');

{46} dm.st.active:=false;

{47} dm.st.Active:=true;

{48} BitBtn1Click(Sender);

{49} end;

{50} end;

{51} end;

 


SQL- , . , , : "'++'", , '++'. Insert .

 

, , . . , . - , , . , , .. , , .

, - , . , , .

. :

 


{+Proverka}

If dm.pr.Fields[0].AsString='' then

begin

showmessage(' ');

exit;

end;

{-Proverka}

If application.MessageBox(' ?','', mb_yesno+mb_iconquestion)=idyes then

begin

{+Proverka2}

dm.TEMP4.Active:=false;

dm.TEMP4.CommandText:='Select * FROM UchPl WHERE id_pr_up = '+dm.pr.Fields[0].AsString+'';

dm.TEMP4.Active:=true;

If dm.TEMP4.Fields[0].AsString<>'' then

Begin

application.MessageBox(' ',' ', mb_ok+mb_iconstop);

exit;

end;

{-Proverka2}

dm.COM.CommandText:='DELETE Prep FROM Prep WHERE id_pr = '+dm.pr.Fields[0].AsString+'';

dm.COM.Execute;

showmessage(' ');

dm.pr.Active:=false;

dm.pr.Active:=true;

end;

end;


{+Proverka2} {-Proverka2 } . , . 2 : . 26 27 .

26

 

27

 

. DataTimePicker Win32 ( dtp). Access . . Data2, :

 


function TFMain.DATA2(data:tdatetime):string;

var d,m,g:word;

Begin

decodedate(data,g,m,d);





:


: 2016-09-03; !; : 377 |


:

:

,
==> ...

1534 - | 1510 -


© 2015-2024 lektsii.org - -

: 0.009 .