//Function that updates the employee based on employee input data public void Update(EmployeeInputData employeeInputData) { this.CardIdNumber = employeeInputData.CardIdNumber; this.EmployeeId = employeeInputData.EmployeeId; this.Name = employeeInputData.Name; this.Email = employeeInputData.Email; this.MobileNumber = employeeInputData.MobileNumber; var cardId = employeeInputData.CardIdNumber; //Takes last 4 digits of cardID var pin = this.GetPinNumberFromCardId(cardId); this.PinNumber = pin; }
//Constructor used to create an Employee instance from EmployeeInputData that we recieve from client side public Employee(EmployeeInputData employeeInputData) { Update(employeeInputData); this.Credit = 0; }