Курсовая работа: База данных "Пассажирские железнодорожные перевозки"
kupe.Text:=StringReplace(Query2.Fields[2].AsString,' ',#13#10,[rfReplaceAll]);
StringGrid1.RowCount:=plackart.Count+kupe.Count+1;
for i:=0 to plackart.Count-1 do
begin
StringGrid1.Cells[0,StrToInt(plackart[i])]:=plackart[i]+' плацкарт';
for j:=1 to 55 do StringGrid1.Cells[j,i]:='';
end;
for i:=0 to kupe.Count-1 do
begin
StringGrid1.Cells[0,StrToInt(kupe[i])]:=kupe[i]+' купе';
// for j:=1 to 55 do StringGrid1.Cells[j,i]:='';
for j:=37 to 55 do StringGrid1.Cells[j,StrToInt(kupe[i])]:='X';
end;
plackart.Destroy;
kupe.Destroy;
with Query2 do
begin
SQLString:='select * from tickets where no_reisa="'+DBGrid1.Fields[0].Text+'"and startdate="'+FormatDateTime('dd.mm',RzDateTimeEdit1.Date)+'"';
SQL.Clear;
SQL.Add(SQLString);
Open;
end;
Query2.First;
while not Query2.Eof do
begin
v:= Query2.Fields[8].AsInteger;
p:= Query2.Fields[9].AsInteger;
StringGrid1.Cells[p,v]:='*';
pnaz:= Query2.FieldValues['EndPoint'];