예제 #1
0
def enter_email():
    """Takes user entry and saves the email address
    
    Returns:
        string -- returns the email address or an empty string
    """
    try:
        invalid_Emailcharacters = [
            "!", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", ",",
            "<", ">", "/", "?", ";", ":", "[", "]", "{", "}"
        ]
        checkEmail = False
        while not checkEmail:
            email = input("Please enter the employee email: ")
            #Checks to see if input was entered
            if checkfor_null(email):
                if str(email):
                    if not check_for_value(email, invalid_Emailcharacters):
                        print("Invalid entry....")
                        checkEmail = False
                    else:
                        checkEmail = True
                else:
                    checkEmail = False
                    break
            return email
    except:
        print("Invalid Entry")
        return ""
예제 #2
0
def enter_employeeID():
    """Takes user entry to enter the Employee ID
    
    Returns:
        String -- Returns either an empty string or the employeeID
    """
    try:
        checkID = False
        while not checkID:
            employeeID = input("Please enter the employeeID: ")
            #Check for Null values
            if checkfor_null(employeeID) == True:
                count = len(employeeID)
            else:
                checkID = False
                break
            #Check count
            if int(employeeID):
                if count >=8:
                    print("Invalid entry....")
                    checkID = False 
                    break
                else: checkID = True
            return employeeID
    except:
        print("Invalid Entry!")
        return ""
예제 #3
0
def enter_address():
    """Takes user entry and saves the address
    
    Returns:
        string -- Returns the Address or an empty string
    """
    try:
        invalid_addressCharacters = [
            "!", "\"", "'", "@", "$", "%", "^", "&", "*", "_", "=", "+", "<",
            ">", "?", ";", ":", "[", "]", "{", "}", ")", "."
        ]
        checkAddress = False
        while not checkAddress:
            #Entered address
            address = input("Please enter the Employee Address: ")
            #checks to see if address was entered
            if not checkfor_null(address):
                address = "None Provided"
            #Checks to see if address is alphnum
            if not address.isalnum:
                checkAddress = False
                break
            if not check_for_value(address, invalid_addressCharacters):
                print("Invalid entry....")
                checkEmail = False
            return address
    except:
        print("Invalid Entry")
        return ""
예제 #4
0
def enter_LastName():
    """Takes users input and validates the lastname entered and stores the value
    
    Returns:
        [string] -- [stores the lastname value]
    """
    invalid_Namecharacters = [
        "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", ",",
        "<", ">", "/", "?", ";", ":", "[", "]", "{", "}"
    ]
    try:
        checkLastName = False
        while not checkLastName:
            #Enter Lastname
            employeeLastName = input("Please enter the Employee Last Name: ")
            #Checks for Null Values
            if checkfor_null(employeeLastName):
                count = len(employeeLastName)
                #Checks for string
            if str(employeeLastName):
                if not check_for_value(employeeLastName,
                                       invalid_Namecharacters):
                    checkLasName = False
                    employeeLastName = employeeLastName.capitalize()
                else:
                    checkLastName = True
            return employeeLastName
    except:
        print("Invalid Entry")
        return ""
예제 #5
0
def enter_FirstName():
    """Takes user entry for the First Name and validates the entry
    
    Returns:
        [string] -- method returns the First Name or an empty string
    """
    try:
        invalid_Namecharacters = [
            "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+",
            ",", "<", ">", "/", "?", ";", ":", "[", "]", "{", "}"
        ]
        checkFirstName = False
        while not checkFirstName:

            #Enter in EmployeeID
            employeeFirstName = input("Please enter the employee First Name: ")

            #Checks for Null Values
            if not checkfor_null(employeeFirstName) == True:
                checkFirstName = False
                break

            count = len(employeeFirstName)

            #Check to see if its a string
            if str(employeeFirstName):
                if not check_for_value(employeeFirstName,
                                       invalid_Namecharacters):
                    checkFirstName = False
                    employeeFirstName = employeeFirstName.capitalize()
                else:
                    checkFirstName = True
            else:
                checkFirstName = False
                break
            return employeeFirstName
    except:
        print("Invalid Entry")
        return ""