-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem_posicion.cpp
63 lines (51 loc) · 1.31 KB
/
item_posicion.cpp
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "item_posicion.h"
item_posicion::item_posicion()
{
}
item_posicion::item_posicion(QString idI, QString idP, QString idV, int f, int c, int n)
{
idItem_Posicion=idI;
idProducto=idP;
idVitrina=idV;
fila=f;
columna=c;
nivel=n;
}
bool item_posicion::agregar()
{
QSqlQuery query;
query.prepare("INSERT INTO item_posicion(idproducto,idvitrina,fila,columna,nivel) VALUES(?,?,?,?,?)");
query.bindValue(0,idProducto);
query.bindValue(1,idVitrina);
query.bindValue(2,fila);
query.bindValue(3,columna);
query.bindValue(4,nivel);
if(query.exec())
return true;
else
return false;
}
bool item_posicion::actualizar()
{
QSqlQuery query;
query.prepare("UPDATE item_posicion SET idproducto=?,idvitrina=?,fila=?,columna=?,nivel=? WHERE iditem_posicion=?");
query.bindValue(0,idProducto);
query.bindValue(1,idVitrina);
query.bindValue(2,fila);
query.bindValue(3,columna);
query.bindValue(4,nivel);
query.bindValue(5,idItem_Posicion);
if(query.exec())
return true;
else
return false;
}
bool item_posicion::eliminar()
{
QSqlQuery query;
query.prepare("DELETE FROM item_posicion WHERE iditem_posicion='"+idItem_Posicion+"'");
if(query.exec())
return true;
else
return false;
}