Esempio n. 1
0
	def validar_marca(self,widget):
		self.marca_ok=False
		marca=self.entry_marca.get_text()
		if caracteres_validos(marca) and marca != "":
			self.entry_marca.set_icon_from_stock(1,gtk.STOCK_APPLY)
			self.marca_ok=True
		else:
			self.entry_marca.set_icon_from_stock(1,gtk.STOCK_DIALOG_ERROR)
Esempio n. 2
0
	def validar_descripcion(self,widget):
		self.descripcion_ok=False
		descripcion=self.entry_descripcion.get_text()
		if caracteres_validos(descripcion) and descripcion != "":
			self.entry_descripcion.set_icon_from_stock(1,gtk.STOCK_APPLY)
			self.descripcion_ok=True
		else:
			self.entry_descripcion.set_icon_from_stock(1,gtk.STOCK_DIALOG_ERROR)
Esempio n. 3
0
	def validar_descripcion(self,widget):
		self.descripcion_ok=False
		descripcion=self.entry_descripcion.get_text()
		if caracteres_validos(descripcion) and descripcion != "":
			self.entry_descripcion.set_icon_from_stock(1,gtk.STOCK_APPLY)
			self.entry_descripcion.set_property("secondary-icon-tooltip-text","")
			self.descripcion_ok=True
		else:
			self.entry_descripcion.set_icon_from_stock(1,gtk.STOCK_DIALOG_ERROR)
			self.entry_descripcion.set_property("secondary-icon-tooltip-text","Incorrecto")
Esempio n. 4
0
	def validar_marca(self,widget):
		self.marca_ok=False
		marca=self.entry_marca.get_text()
		if caracteres_validos(marca) and marca != "":
			self.entry_marca.set_icon_from_stock(1,gtk.STOCK_APPLY)
			self.entry_marca.set_property("secondary-icon-tooltip-text","")
			self.marca_ok=True
		else:
			self.entry_marca.set_icon_from_stock(1,gtk.STOCK_DIALOG_ERROR)
			self.entry_marca.set_property("secondary-icon-tooltip-text","Incorrecto")
Esempio n. 5
0
	def validar_marca(self,widget):
		self.marca_ok=False
		marca=self.entry_marca.get_text()
		esta=False
		if caracteres_validos(marca) and marca != "":
			ruta = os.getcwd()
			bbdd=bdapi.connect(ruta+'/Base_Datos/bd_marcas.db')
			cursor=bbdd.cursor()
			cursor.execute("SELECT * FROM marca")
			for tupla in cursor.fetchall():
				if tupla[1] == marca:
					esta=True
					self.ganancia = tupla[4]
			cursor.close()
			bbdd.close()
		if esta:
			self.entry_marca.set_icon_from_stock(1,gtk.STOCK_APPLY)
			self.marca_ok=True
		else:
			self.entry_marca.set_icon_from_stock(1,gtk.STOCK_DIALOG_ERROR)