Browse Source

implemented the storeEmployeeData() function in the getnewEmployeeCredentials() function in order for the new employee to enter his personal data.

remotes/origin/feature/employees-infos-access
fdai7207 2 years ago
parent
commit
b5a764b566
  1. 35
      src/createEmployeeAccount.c
  2. 5
      src/employeesCredentialsList.txt
  3. 4
      src/employeesData.txt

35
src/createEmployeeAccount.c

@ -137,28 +137,35 @@ void getNewEmployeeCredentials()
passwordVerfication[strlen(employeePassword)] = '\0';
if(verifyPassword(passwordVerfication,employeePassword))
if(verifyPassword(passwordVerfication,employeePassword) && isValidPassword(employeePassword,minPasswordLength) && isValidEmployeeID(employeeId,maxLength))
{
printf("\n\nplease enter your first name\n");
if(isValidEmployeeID(employeeId,maxLength) && isValidPassword(employeePassword,minPasswordLength))
{
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");
}
scanf("%s",data->firstName);
else if(isValidEmployeeID(employeeId,maxLength) && !isValidPassword(employeePassword,minPasswordLength))
{
printf("Error : the entered password should be at least 5 characters long and should contain at least 1 digit, 1 alphabet and 1 symbol!");
}
printf("\n\nplease enter your last name\n");
else
{
printf("Error : the entered ID should contain a maximum of 20 letters");
}
scanf("%s",data->lastName);
printf("\n\nplease enter your adress\n");
scanf("%s",data->adress);
printf("\n\nplease enter your Phone number\n");
scanf("%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->adress,data->phoneNumber);
}
else
{
printf("the Verification password and the entered password dont match");
printf("\n\nError! one of these conditions is not met in your input\n\n");
printf("\n-the entered password should be at least 5 characters long and should contain at least 1 digit, 1 alphabet and 1 symbol!\n");
printf("\n-the entered ID should contain a maximum of 20 letters!\n");
printf("\n-the verification password should match with the entered password.\n");
}
}

5
src/employeesCredentialsList.txt

@ -9,8 +9,3 @@ Julius Insertcatfdai7057
Mohamed MDfdai6618
Shivam Schivam007fdlt3781

4
src/employeesData.txt

@ -32,7 +32,3 @@ Name : Shivam
Last name : Chaudhary
Adress : Fulda,leipzigerstrasse,6
Phone number : +4918756871384
Loading…
Cancel
Save