210 |
Equipment PostgresLayer::GetEquipment(CString wantBarcode) |
Equipment PostgresLayer::GetEquipment(CString wantBarcode) |
211 |
{ |
{ |
212 |
|
|
213 |
CString barcode,name,description,placement,status; |
CString barcode,name,description,placement,status,statusid; |
214 |
|
|
215 |
CString SQL; |
CString SQL; |
216 |
|
|
218 |
|
|
219 |
Equipment e; |
Equipment e; |
220 |
|
|
221 |
SQL.Format((CString)"SELECT Stregkode,Navn,Udstyr.Beskrivelse,Placering,Status.Beskrivelse FROM Udstyr " + |
SQL.Format((CString)"SELECT Stregkode,Navn,Udstyr.Beskrivelse,Placering,Status.Beskrivelse,Udstyr.Status FROM Udstyr " + |
222 |
"INNER JOIN Status ON Udstyr.Status = Status.StatusID Where (Stregkode = '%s')", wantBarcode); |
"INNER JOIN Status ON Udstyr.Status = Status.StatusID Where (Stregkode = '%s')", wantBarcode); |
223 |
CRecordset rs(&db); |
CRecordset rs(&db); |
224 |
rs.Open(AFX_DB_USE_DEFAULT_TYPE, SQL); |
rs.Open(AFX_DB_USE_DEFAULT_TYPE, SQL); |
229 |
rs.GetFieldValue(2,description); |
rs.GetFieldValue(2,description); |
230 |
rs.GetFieldValue(3,placement); |
rs.GetFieldValue(3,placement); |
231 |
rs.GetFieldValue(4,status); |
rs.GetFieldValue(4,status); |
232 |
|
rs.GetFieldValue(5,statusid); |
233 |
|
|
234 |
e.barcode = barcode; |
e.barcode = barcode; |
235 |
e.name = name; |
e.name = name; |
236 |
e.description = description; |
e.description = description; |
237 |
e.placement = placement; |
e.placement = placement; |
238 |
e.status = status; |
e.status = status; |
239 |
|
e.statusid = atoi( statusid ); |
240 |
|
|
241 |
rs.Close(); |
rs.Close(); |
242 |
|
|