Разработка информационно-справочной системы по учету вагонов на подъездном пути предприятия
Дипломная работа - Компьютеры, программирование
Другие дипломы по предмету Компьютеры, программирование
ible := false;
SelectQ.Fields[14].Visible := false;
SelectQ.Fields[15].Visible := false;
SelectQ.Fields[17].Visible := false;
SelectQ.Fields[19].Visible := false;
Form7.DBGrid1.Columns[0].Title.Caption :=Заказ;
Form7.DBGrid1.Columns[1].Title.Caption :=Стоимость заказа;
Form7.DBGrid1.Columns[2].Title.Caption :=№ цеха исп.;
Form7.DBGrid1.Columns[3].Title.Caption :=Бi.и.;
Form7.DBGrid1.Columns[4].Title.Caption :=№ цеха заказ.;
Form7.DBGrid1.Columns[5].Title.Caption :=Бi.з.;
Form7.DBGrid1.Columns[6].Title.Caption :=Стоим. усл.;
Form7.DBGrid1.Columns[7].Title.Caption :=Вид услуги;
Form7.DBGrid1.Columns[8].Title.Caption :=Единица измерения;
end;
if (Tbl=Stoimost) then
begin
SelectQ.Fields[0].Visible := false;
SelectQ.Fields[2].Visible := false;
SelectQ.Fields[4].Visible := false;
SelectQ.Fields[5].Visible := false;
SelectQ.Fields[6].Visible := false;
Form8.DBGrid1.Columns[0].Title.Caption :=Вид услуги;
Form8.DBGrid1.Columns[1].Title.Caption :=Единица измерения;
Form8.DBGrid1.Columns[2].Title.Caption :=Стоимость;
end;
if ((Tbl=Operation)or(Tbl=Station)or(Tbl=Ceha)or
(Tbl=Front)or(Tbl=Gruz)or(Tbl=Rod_vagona)or
(Tbl=Raion_dvizheniya)or(Tbl=Ves)or(Tbl=Vid_uslug)) then
begin
SelectQ.Fields[0].Visible := false;
Form3.DBGrid1.Columns[0].Title.Caption := Form3.Label1.Caption;
If (tbl=Ceha) then
begin
Form3.DBGrid1.Columns[1].Title.Caption := Form3.Label2.Caption;
end;
end;
end;
Procedure InsertZapros();
var
QueryString, Polya: string;
YN : Boolean;
begin
YN := false;
if ((Tbl=Operation)or(Tbl=Station)or(Tbl=Ceha)or
(Tbl=Front)or(Tbl=Gruz)or(Tbl=Rod_vagona)or
(Tbl=Raion_dvizheniya)or(Tbl=Ves)or(Tbl=Vid_uslug)) then
begin
SelectQ := DataModule2.Query1;
with DataModule2.Query1 do
begin
First;
while (not Eof) do
begin
if (ForEdit <> SelectQ[id]) then
begin
if DataModule2.Query1[pole2] = ToIns then
begin
YN:=true;
Break;
end;
end;
Next;
end;
end;
if InsEdit then
begin
If (tbl=Ceha) then
begin
QueryString := UPDATE +TBL+ SET +pole2+=+#39+ToIns+#39+,+pole3+=+#39+ToIns2+#39+ where +pole1+=+ForEdit;
end
else
begin
QueryString := UPDATE +TBL+ SET +pole2+=+#39+ToIns+#39+ where +pole1+=+ForEdit;
end;
InsEdit := false;
end
else
begin
If (tbl=Ceha) then
begin
QueryString := insert into + TBL + (+pole2+,+pole3+) values (+#39+ToIns+#39+,+#39+ToIns2+#39+);
end
else
begin
QueryString := insert into + TBL + (+pole2+) values (+#39+ToIns+#39+);
end;
end;
end;
if (Tbl=Stoimost) then
begin
SelectQ := DataModule2.QSelUs;
pole1 := id;
pole2 := key_vid_uslug;
pole3 := key_ves;
pole4 := stoimost;
pole5 := ;
pole6 := ;
pole7 := ;
pole8 := ;
pole9 := ;
pole10 := ;
pole11 := ;
pole12 := ;
pole13 := ;
with SelectQ do
begin
First;
while (not Eof) do
begin
SelectQ[ST.id])then"> if (ForEdit <> SelectQ[ST.id]) then
begin
if ((SelectQ[pole2] = ToIns)and(SelectQ[pole3] = ToIns2)) then
begin
YN:=true;
Break;
end;
end;
Next;
end;
end;
if InsEdit2 then
begin
QueryString := UPDATE +TBL+ SET +pole2+=+#39+ToIns+#39+,+pole3+=+#39+ToIns2+#39+,+pole4+=+#39+ToIns3+#39+ where +pole1+=+ForEdit;
InsEdit2 := false;
end
else
QueryString := insert into + TBL + (+pole2+,+pole3+,+pole4+) values (+#39+ToIns+#39+,+#39+ToIns2+#39+,+#39+ToIns3+#39+);
end;
if (Tbl=Vagon) then
begin
pole1 := id;
pole2 := mymonth;
pole3 := myyear;
pole4 := nomer_vagona;
pole5 := invent_nomer;
pole6 := year_izgot;
pole7 := gruzopodemnost;
pole8 := key_rod_vagona;
pole9 := iznos;
pole10 := key_raion_dvizh;
pole11 := ;
pole12 := ;
pole13 := ;
SelectQ := DataModule2.QShow;
with SelectQ do
begin
First;
while (not Eof) do
begin
SelectQ[v.id])then"> if (ForEdit <> SelectQ[v.id]) then
begin
if (SelectQ[pole5] = ToIns4) then
begin
YN:=true;
Break;
end;
end;
Next;
end;
end;
if InsEdit3 then
begin
QueryString := UPDATE +TBL+ SET +pole2+=+#39+ToIns+#39+,+pole3+=+#39+ToIns2+#39+,+pole4+=+#39+ToIns3+#39+,+pole5+=+#39+ToIns4+#39+,+pole6+=+#39+ToIns5+#39+,+pole7+=+#39+ToIns6+#39+,+pole8+=+#39+ToIns7+#39+,+pole9+=+#39+ToIns8+#39+,+pole10+=+#39+ToIns9+#39+ where +pole1+=+ForEdit;
InsEdit3 := false;
end
else
QueryString := insert into + TBL + (+pole2+, +pole3+, +pole4+, +pole5+, +pole6+, +pole7+, +pole8+, +pole9+, +pole10+) values (+#39+ToIns+#39+, +#39+ToIns2+#39+, +#39+ToIns3+#39+, +#39+ToIns4+#39+, +#39+ToIns5+#39+, +#39+ToIns6+#39+, +#39+ToIns7+#39+, +#39+ToIns8+#39+, +#39+ToIns9+#39+);
end;
if (Tbl=Operations_s_vagonom) then
begin
SelectQ := DataModule2.QOSV;
pole1 := id;
pole2 := key_station_otpr;
pole3 := key_front_otpr;
pole4 := key_station_naznach;
pole5 := key_front_naznach;
pole6 := mydate;