Browse Source

implement the function isValidPhoneNumber() in the getNewEmployeeCredentials() function.

remotes/origin/feature/employees-infos-access
fdai7207 2 years ago
parent
commit
1e047c30b0
  1. 8
      src/createEmployeeAccount.c

8
src/createEmployeeAccount.c

@ -179,13 +179,19 @@ void getNewEmployeeCredentials()
printf("\n\nplease enter your Phone number\n"); printf("\n\nplease enter your Phone number\n");
scanf(" %[^\n]s",data->phoneNumber); scanf(" %[^\n]s",data->phoneNumber);
if(isValidPhoneNumber(data->phoneNumber))
{
createNewEmployee(employeeId,employeePassword) ? createNewEmployee(employeeId,employeePassword) ?
printf("\n\n Account created successfully !\n\n") : printf("\n\n Account created successfully !\n\n") :
printf("\n\n Could not create the Account please contact an employee of clearance 1 !\n\n"); printf("\n\n Could not create the Account please contact an employee of clearance 1 !\n\n");
storeEmployeeData(data->firstName,data->lastName,data->address,data->phoneNumber); storeEmployeeData(data->firstName,data->lastName,data->address,data->phoneNumber);
} }
else else
{
printf("\nInvalid phone number!\n");
}
}
else
{ {
printf("the given name contains unwanted characters(spaces, symbols,numbers)"); printf("the given name contains unwanted characters(spaces, symbols,numbers)");
} }

Loading…
Cancel
Save