Пример #1
0
def aleatoria():
    print("Empezando")
    equipos = {"Gema", "Cori", "Luis", "Raquel", "Ale"}
    dias = [7.1, 7.2, 8.1, 8.2, 8.3]

    for i in range(100):
        random.shuffle(dias)

    mensaje = ""
    for equipo, dia in zip(equipos, dias):
        mensaje = mensaje + equipo + " Le toca el dia: " + str(dia) + "\n"

    print(mensaje)
    #change email
    email = ""
    Email.SendEmail(email, mensaje)
Пример #2
0
def intercambio():
    emails = Names.getEmails()
    names = destination = Names.getNames()
    #print(names)
    print("Randomizing destination")
    destination = Names.RandomizeDest(destination)
    print("Destination Randomized")

    IntercambioList = []
    for name, destiny in zip(names, destination):
        exchange = name + " Tu intercambio es:  " + destiny
        IntercambioList.append(exchange)

    for correo, mensaje in zip(emails, IntercambioList):
        #Email.SendEmail(emails[1],IntercambioList[1])
        Email.SendEmail(correo, mensaje)

    print("DONE")
Пример #3
0
    def Send(self,entries):
        "haalt de text op"
        # TODO iban valideren

        values = Input.Input.get(Input.Input,entries)

        for item in values:
            if not item:
                self.ShowMessage("One or more field \nare incomplete")
                return

        name = self.CreateEmptyIfNone(values[0])
        lastname = self.CreateEmptyIfNone(values[1])
        emailAddress = self.CreateEmptyIfNone(values[2])
        accountnumber = self.CreateEmptyIfNone(values[3])
        recordguid = Database.ParseRecordGuid(self._licenseGuid)
        licenseplate = self.GetLicensePlate(recordguid)

        exists = Database.Query("SELECT RecordGuid FROM Customer WHERE ref_Car = ?",recordguid)

        if any(exists):
            Database.Insert("UPDATE Customer set [Name] = ?, [Lastname] = ?, [Email] = ?, [Account_number] = ? where ref_Car =  ?" , name, lastname, emailAddress, accountnumber, recordguid)
        else:
            Database.Insert("INSERT INTO Customer (Name,Lastname,Email,Account_number,ref_Car) VALUES (?,?,?,?,?)",
                name, lastname, emailAddress, accountnumber, recordguid)
        # self.controller.show_frame("StartPageDutch")
        items = Database.Query("SELECT RecordGuid FROM Park_times WHERE Arrival IS NOT NULL AND Departure IS NOT NULL AND Is_send = 0")

        if not any(items):
            return

        #     factudingesen
        self.ShowMessage("An e-mail will be send!")
        billing = Billing.Billing()
        payment = billing.parkedTime(recordguid)
        print(payment)
        document = Document.EmailDocument()
        documentName = document.CreateDocument(name, licenseplate, payment[1], 3.0, payment[0])
        #TODO Document toevoegen (werkt nog niet helemaal)
        email = Email.SendEmail()
        email.SetSubject("Automatic invoice")
        email.AppendEmail(emailAddress)
        email.SetMessage("In the attachments you will find your invoice")
        email.Send(documentName)