214 |
Equipment MySQLLayer::GetEquipment(CString wantBarcode) |
Equipment MySQLLayer::GetEquipment(CString wantBarcode) |
215 |
{ |
{ |
216 |
|
|
217 |
CString barcode,name,description,placement,status; |
CString barcode,name,description,placement,status,statusid; |
218 |
|
|
219 |
CString SQL; |
CString SQL; |
220 |
|
|
222 |
|
|
223 |
Equipment e; |
Equipment e; |
224 |
|
|
225 |
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 " + |
226 |
"INNER JOIN Status ON Udstyr.Status = Status.StatusID Where (Stregkode = '%s')", wantBarcode); |
"INNER JOIN Status ON Udstyr.Status = Status.StatusID Where (Stregkode = '%s')", wantBarcode); |
227 |
CRecordset rs(&db); |
CRecordset rs(&db); |
228 |
rs.Open(AFX_DB_USE_DEFAULT_TYPE, SQL); |
rs.Open(AFX_DB_USE_DEFAULT_TYPE, SQL); |
233 |
rs.GetFieldValue(2,description); |
rs.GetFieldValue(2,description); |
234 |
rs.GetFieldValue(3,placement); |
rs.GetFieldValue(3,placement); |
235 |
rs.GetFieldValue(4,status); |
rs.GetFieldValue(4,status); |
236 |
|
rs.GetFieldValue(5,statusid); |
237 |
|
|
238 |
e.barcode = barcode; |
e.barcode = barcode; |
239 |
e.name = name; |
e.name = name; |
240 |
e.description = description; |
e.description = description; |
241 |
e.placement = placement; |
e.placement = placement; |
242 |
e.status = status; |
e.status = status; |
243 |
|
e.statusid = atoi( statusid ); |
244 |
|
|
245 |
rs.Close(); |
rs.Close(); |
246 |
|
|