示例#1
0
 def POST(self):
     form = self.form()
     if not form.validates():
         return render.signup(form)
     if model.exist(form.d.Name) == 0:
         model.new_client(form.d.Name, form.d.password, form.d.Email, form.d.Credit_Card_No, form.d.Phone_No, form.d.SEX)
     raise web.seeother('/')
示例#2
0
 def POST(self):
     form = self.form()
     if not form.validates():
         return render.visit(form)
     if model.exist(form.d.Name)==1 and model.existHs(form.d.HouseID):
         ag=model.get_agencyID(form.d.HouseID)
         hs=model.get_house(form.d.HouseID)
         model.new_visit(form.d.Name, form.d.Visit_Date, form.d.HouseID, hs.locationHouse, ag.Agency_idAgency)
     raise web.seeother('/visit')
示例#3
0
 def POST(self, hsID):
     form = Book.form()
     if not form.validates():
         return render.house(form)
     if model.existHs(form.d.idHouse)==1 and model.exist(form.d.Name)==1 and model.hs_booked(form.d.Name, form.d.idHouse)==1:
         model.order_update(form.d.Name, form.d.idHouse, form.d.Duration)
         raise web.seeother('/bookhouse/succeed')
     else:
         raise web.seeother('/bookhouse/fail')
示例#4
0
 def POST(self):
     form = self.form()
     if not form.validates():
         return render.house(form)
     if model.existHs(form.d.idHouse)==1 and model.exist(form.d.Name)==1 and model.hs_booked(form.d.Name, form.d.idHouse)==0:
         houseinfo = model.get_house(form.d.idHouse)
         cost = houseinfo.price * int(form.d.Duration)
         model.house_book(form.d.Name, form.d.idHouse, form.d.Duration, cost)
         raise web.seeother('/bookhouse/succeed')
     else:
         raise web.seeother('/bookhouse/fail')
示例#5
0
 def POST(self, name, date):
     form = Visit.form()
     client = model.get_visitor(name)
     if not form.validates():
         return render.editvisitor(client, form)
     if model.exist(form.d.Name)==1:
         ag=model.get_agencyID(form.d.HouseID)
         print ag
         hs=model.get_house(form.d.HouseID)
         print hs
         model.del_visitor(name,date)
         model.new_visit(form.d.Name, form.d.Visit_Date, form.d.HouseID, hs.locationHouse, ag.Agency_idAgency)
     raise web.seeother('/visit')