Browse Source

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

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

16
src/createEmployeeAccount.c

@ -179,11 +179,17 @@ 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);
createNewEmployee(employeeId,employeePassword) ?
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");
storeEmployeeData(data->firstName,data->lastName,data->address,data->phoneNumber);
if(isValidPhoneNumber(data->phoneNumber))
{
createNewEmployee(employeeId,employeePassword) ?
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");
storeEmployeeData(data->firstName,data->lastName,data->address,data->phoneNumber);
}
else
{
printf("\nInvalid phone number!\n");
}
} }
else else
{ {

Loading…
Cancel
Save