Ejemplo n.º 1
0
class Empleado:
    def __init__(self):
        self.conn = Connection('Farmacia')

    def insert_empleado(self, data):
        collection = 'empleado'
        self.conn.insert(collection, data)

    def update_empleado(self, condition, change):
        collection = 'empleado'
        self.conn.update(collection, condition, change)

    def get_empleado_condition_selection(self, condition, selection):
        collection = 'empleado'
        return self.conn.get_all(collection, condition, selection)

    def get_empleado_condition(self, condition):
        collection = 'empleado'
        return self.conn.get_one(collection, condition)

    def delete_empleado(self, condition):
        collection = 'empleado'
        self.conn.delete(collection, condition)

    def get_all_validacion(self, condition={}):
        return self.conn.get_all_validacion('empleado', condition)
Ejemplo n.º 2
0
class factura:
    def __init__(self):
        self.model = Connection('Farmacia')

    def get_all_factura(self, condition={}, select={}):
        return self.model.get_all('factura', condition, select)

    def insert_factura(self, data):
        return self.model.insert('factura', data)

    def update_factura(self, condition, change):
        return self.model.update('factura', condition, change)
Ejemplo n.º 3
0
class usuario:
    def __init__(self):
        self.model = Connection('tienda')

    def get_all_usuarios(self, condition={}, select={}):
        return self.model.get_all('usuario', condition, select)

    def insert_usuario(self, data):
        return self.model.insert('usuario', data)

    def update_usuario(self, condition, change):
        return self.model.update('usuario', condition, change)
Ejemplo n.º 4
0
class Lector:
    def __init__(self):
        self.model = Connection('biblioteca')

    def get_all_Lector(self,condition={}, select={}):
        return self.model.get_all('Lector',condition,select)

    def insert_Lector(self, data):
        return self.model.insert('Lector',data)

    def update_Lector(self, condition, change):
        return self.model.update('Lector',condition, change)

    def delete_Lector(self, condition):
        return self.model.delete('Lector', condition)
        
    def get_all_validacion(self,condition={}):
        return self.model.get_all_validacion('Lector',condition)
Ejemplo n.º 5
0
class carrito:
    def __init__(self):
        self.model = Connection('Farmacia')

    def get_all_carrito(self, condition={}, select={}):
        return self.model.get_all('carrito', condition, select)

    def get_one_carrito(self, condition, select):
        return self.model.get_one('carrito', condition, select)

    def insert_carrito(self, data):
        return self.model.insert('carrito', data)

    def update_carrito(self, condition, change):
        return self.model.update('carrito', condition, change)
#

    def delete_carrito(self, condition):
        return self.model.delete('carrito', condition)

    def delete_carrito_all(self, condition):
        return self.model.delete_many('carrito', condition)
Ejemplo n.º 6
0
class Producto:
    def __init__(self):
        self.conn = Connection('tienda')

    def insert_producto(self, data):
        collection = 'producto'
        self.conn.insert(collection, data)

    def update_producto(self, condition, change):
        collection = 'producto'
        self.conn.update(collection, condition, change)

    def get_productos(self, condition, selection):
        collection = 'producto'
        return self.conn.get_all(collection, condition, selection)

    def get_producto(self, condition):
        collection = 'producto'
        return self.conn.get_one(collection, condition)

    def delete_producto(self, condition):
        collection = 'producto'
        self.conn.delete(collection, condition)
Ejemplo n.º 7
0
class Categoria:
    def __init__(self):
        self.conn = Connection('tienda')

    def insert_categorias(self, data):
        collection = 'categoria'
        self.conn.insert(collection, data)

    def update_categoria(self, condition, change):
        collection = 'categoria'
        self.conn.update(collection, condition, change)

    def get_categorias(self, condition, selection):
        collection = 'categoria'
        return self.conn.get_all(collection, condition, selection)

    def get_categoria(self, condition):
        collection = 'categoria'
        return self.conn.get_one(collection, condition)

    def delete_categoria(self, condition):
        collection = 'categoria'
        self.conn.delete(collection, condition)