本文整理汇总了Python中DBManager.DBManager.getCanchaPrecio方法的典型用法代码示例。如果您正苦于以下问题:Python DBManager.getCanchaPrecio方法的具体用法?Python DBManager.getCanchaPrecio怎么用?Python DBManager.getCanchaPrecio使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager.DBManager
的用法示例。
在下文中一共展示了DBManager.getCanchaPrecio方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ReservaForm
# 需要导入模块: from DBManager import DBManager [as 别名]
# 或者: from DBManager.DBManager import getCanchaPrecio [as 别名]
class ReservaForm( wx.Dialog ):
def __init__( self, parent, id, title, data ):
wx.Dialog.__init__( self, parent, id, title )
self.SetSize( wx.Size(200,200) )
self.DBM = DBManager()
self.data = data
font_labels = wx.Font(13, wx.NORMAL, wx.NORMAL, wx.BOLD)
vbox = wx.BoxSizer( wx.VERTICAL )
label = wx.StaticText( self, label="Reserva")
font = wx.Font(16, wx.NORMAL, wx.NORMAL, wx.BOLD)
label.SetFont( font )
vbox.Add(label, 0, wx.EXPAND, 20)
line = wx.StaticLine(self, -1, wx.Point(10, 30), wx.Size(380, -1))
vbox.Add(line)
hbox1 = wx.BoxSizer( wx.HORIZONTAL )
label1 = wx.StaticText( self, label="Cancha:")
label2 = wx.StaticText( self, label= str( data[0] ) )
hbox1.Add(label1)
hbox1.Add(label2)
vbox.Add(hbox1, flag=wx.EXPAND)
hbox2 = wx.BoxSizer( wx.HORIZONTAL )
label3 = wx.StaticText( self, label="Horario:")
label4 = wx.StaticText( self, label="%s:00 hs" % str( data[1] ) )
hbox2.Add(label3)
hbox2.Add(label4)
vbox.Add(hbox2, flag=wx.EXPAND)
self.precio = self.DBM.getCanchaPrecio( data[0] )
hbox3 = wx.BoxSizer( wx.HORIZONTAL )
label5 = wx.StaticText( self, label="Precio:")
self.preci = wx.TextCtrl( self, -1, "$%.2f" % self.precio)
hbox3.Add(label5)
hbox3.Add(self.preci)
vbox.Add(hbox3, flag=wx.EXPAND)
hbox4 = wx.BoxSizer( wx.HORIZONTAL )
label6 = wx.StaticText( self, label="Cliente:")
self.text2 = wx.TextCtrl(self, -1, "")
hbox4.Add(label6)
hbox4.Add(self.text2)
vbox.Add(hbox4, flag=wx.EXPAND)
hbox5 = wx.BoxSizer( wx.HORIZONTAL )
button1 = wx.Button( self, label="Reservar")
button2 = wx.Button( self, label="Cancelar")
hbox5.Add(button1)
hbox5.Add(button2)
vbox.Add(hbox5, flag=wx.CENTER)
label1.SetFont( font_labels )
label2.SetFont( font_labels )
label3.SetFont( font_labels )
label4.SetFont( font_labels )
label5.SetFont( font_labels )
label6.SetFont( font_labels )
self.preci.SetFont( font_labels )
button1.Bind(wx.EVT_BUTTON, self.processReserva)
button2.Bind(wx.EVT_BUTTON, self.__destroy)
self.SetSizer( vbox )
self.Show( True )
self.Centre()
def processReserva( self, evt ):
error = (False, '')
precio = 0
if self.text2.GetValue() == "":
error = (True, 'El cliente no puede ser vacio')
self.precio = self.preci.GetValue()
self.precio = float(self.precio.split('$')[1])
result = {'old_data' : self.data,
'precio' : self.precio,
'cliente' : self.text2.GetValue(),
'msg' : error}
self.Destroy()
Publisher().sendMessage(("reserva_form"), result)
def __destroy( self, evt ):
self.Destroy()