def sign_up(user): statement = """INSERT INTO UserAccount (UserID, FullName, Username, Password, Email, Phone, UserPrivilege, BankName, BankAccount, IdentityCardNumber, ProfileImage) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""" token = validate_user(user) value = user.user_id, user.fullname, user.username, user.password, user.email, user.phone, user.privilege, user.bank_name, user.bank_account, user.identity_card, user.image if token[0] is True: token = Post.create(statement=statement, value=value) return (token, "User Registered Successfully!") if token is True else ( False, "Unable to Registered User!")
def register_Property(value): statement = """INSERT INTO BaseProperty (PropertyUID, Price, PropertyType, YearBuilt, TenureType, Bedroom, Bathroom, ExtraRoom, Parking, Size, FloorPlan, Unit, Area, Street, District, State, Postcode, Township) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""" token = Post.create(statement=statement, value=value) return token
def owned(value): statement = """INSERT INTO BaseProperty (PropertyUID, Price, PropertyType, YearBuilt, TenureType, Bedroom, Bathroom, ExtraRoom, Parking, Size, FloorPlan, Unit, Area, Street, District, State, Postcode, Township, Contract, ContactPeriod, RentID, OwnershipID, RentPrice, SellPrice, Images, RentalStartDate, RentalEndDate, RentalPeriod, Description, LastUpdatedDate, RentContract, SellContract) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""" token = Post.create(statement=statement, value=value) return token
def request(value): statement = """INSERT INTO Request (RequestDate, RequestStatus, RequestType, RentalStartDate, RentalPeriod, UserID, PropertyID) VALUES (?, ?, ?, ?, ?, ?, ?)""" token = Post.create(statement=statement, value=value) return token
def create(value): statement = """INSERT INTO Billing (IssuedDate, BillingType, BillingAmount, PaymentDate, PropertyID) VALUES (?, ?, ?, ?, ?)""" token = Post.create(statement=statement, value=value) return token