public void Load int idorder db command CommandText select mp idmodel

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
public void Load(int idorder)
{
db.command.CommandText = @"select mp.idmodel,
idmodelpic,
mp.comment,
mp.typ,
mp.deleted,
mp.picture,
mp.marking,
mp.markingshpross,
oi.idorderitem,
oi.numpos orderitem_numpos,
oi.constrnum orderitem_constrnum,
mp.modelpart
from view_modelpic mp, model m, orderitem oi
where mp.idmodel = m.idmodel and
mp.deleted is null and oi.idmodel=m.idmodel and m.idorder = " + idorder + @"
union all
select null idmodel,
-row_number() over (order by idorderitem) idmodelpic,
null comment,
1 typ,
oi.deleted,
dbo.ZipUnPack(pt.picture) picture,
null marking,
null markingshpross,
idorderitem,
numpos orderitem_numpos,
constrnum orderitem_constrnum,
null modelpart
from orderitem oi inner join
productiontype pt on oi.idproductiontype = pt.idproductiontype
where oi.typ = 3
and oi.deleted is null
and pt.picture is not null
and oi.idorder = " + idorder;
db.adapter.Fill(this);
}