public static void EmployeePersonalCredentialsEntry(Models.Employee employee) { Console.WriteLine("Employee ID: " + employee.EmployeeGuid); Console.Write("Input First Name: "); employee.FirstName = Console.ReadLine(); Console.Write("Input Last Name: "); employee.LastName = Console.ReadLine(); Console.WriteLine(employee.FirstName + " " + employee.LastName); }
public static void GetUserDecision() { bool correctCommand = false; do { Console.Write("Input: "); String input = Console.ReadLine(); if (input.Equals("help") || input.Equals("h")) { Console.WriteLine("Commands are: "); Console.WriteLine("(h)elp - shows all commands"); Console.WriteLine("(r)egister - create an account"); Console.WriteLine("(l)ogin - login as an existing user"); Console.WriteLine("(q)quit - to exit the system"); } if (input.Equals("quit") || input.Equals("q")) { correctCommand = true; } if (input.Equals("register") || input.Equals("r")) { Business.Models.Employee employee = new Business.Models.Employee(); //Local object small letters but class big letters PrintGui(); EmployeePersonalCredentialsEntry(employee); EmployeeSecurityCredentialsEntry(employee); employees.Add(employee); } if (input.Equals("login") || input.Equals("l")) { PrintGui(); Console.Write("Enter Username: "******"Enter Password: "******"Invalid Login"); } } }while (!correctCommand); }
/// <summary> /// Gathers information regarding the employee's Date of Birth. /// </summary> /// <param name="employee">The employee whose date of birth we are gathering information for.</param> public static void EmployeeDOBEntry(Models.Employee employee) //Function should be capital { employee.DOB = new System.DateTime(); Console.Write("Year of birth: "); String employeeYear = Console.ReadLine(); Console.Write("Month of birth: "); String employeeMonth = Console.ReadLine(); Console.Write("Day of birth: "); String employeeDay = Console.ReadLine(); int employeeYearInt = Int32.Parse(employeeYear); int employeeMonthInt = Int32.Parse(employeeMonth); int employeeDayInt = Int32.Parse(employeeDay); employee.DOB = new System.DateTime(employeeYearInt, employeeMonthInt, employeeDayInt); employee.DOB = employee.DOB.AddHours(10); Console.WriteLine(employee.DOB); }