From b5a764b566af457ecf361f6b80b5a2efbc7c3d52 Mon Sep 17 00:00:00 2001 From: fdai7207 Date: Mon, 6 Feb 2023 19:17:07 +0100 Subject: [PATCH] implemented the storeEmployeeData() function in the getnewEmployeeCredentials() function in order for the new employee to enter his personal data. --- src/createEmployeeAccount.c | 35 +++++++++++++++++++------------- src/employeesCredentialsList.txt | 5 ----- src/employeesData.txt | 4 ---- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/createEmployeeAccount.c b/src/createEmployeeAccount.c index 07877db..791a92a 100644 --- a/src/createEmployeeAccount.c +++ b/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"); + + scanf("%s",data->firstName); + + printf("\n\nplease enter your last name\n"); + + 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); - 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"); - } - 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!"); - } - - else - { - printf("Error : the entered ID should contain a maximum of 20 letters"); - } + 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"); } } diff --git a/src/employeesCredentialsList.txt b/src/employeesCredentialsList.txt index d44964d..ed5a12d 100644 --- a/src/employeesCredentialsList.txt +++ b/src/employeesCredentialsList.txt @@ -9,8 +9,3 @@ Julius Insertcatfdai7057 Mohamed MDfdai6618 Shivam Schivam007fdlt3781 - - - - - diff --git a/src/employeesData.txt b/src/employeesData.txt index 55e1cc0..16f8e9a 100644 --- a/src/employeesData.txt +++ b/src/employeesData.txt @@ -32,7 +32,3 @@ Name : Shivam Last name : Chaudhary Adress : Fulda,leipzigerstrasse,6 Phone number : +4918756871384 - - - -