Example #1
0
 def POST(self, hsid):
     form=House.form()
     house=model.get_house(hsid)
     if not form.validates():
         return render.editindihouse(house, form)
     model.update_house(hsid, form.d.price, form.d.type, form.d.year, form.d.locationHouse, form.d.capacity)
     raise web.seeother('/houses')
Example #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')
Example #3
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')
Example #4
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')
Example #5
0
 def GET(self, hsid):
     form=House.form()
     house=model.get_house(hsid)
     form.fill(house)
     return render.editindihouse(house, form)
Example #6
0
 def POST(self, hsID):
     form = Visit.form()
     house = model.get_house(hsID)
     if not form.validates():
         return render.editHouse(house, form)
Example #7
0
 def GET(self, hsID):
     form = Book.form()
     house = model.get_house(hsID)
     form.fill(house)
     return render.editHouse(house, form)