private static void displayAllRecs() { var recs = component.FindEmployee(UIInteraction.GetString("Enter the name or part of the Name to search")); foreach (var emp in recs) { displayEmpInfo(emp); Console.WriteLine(); } }
static void Main(string[] args) { var fileName = args[0]; bool @continue = true; string menu = new StreamReader(fileName).ReadToEnd(); do { string choice = UIInteraction.GetString(menu); @continue = processMenu(choice); } while (@continue); }
private static void displayRec() { try { string name = UIInteraction.GetString("Enter the name to search"); var emp = component.FindEmployee(name); Console.WriteLine("The Name is " + emp.EmployeeName); Console.WriteLine("The Address is " + emp.EmployeeAddress); Console.WriteLine("The Age is " + emp.Age); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private static void createEmp() { try { var emp = new Employee(); emp.EmployeeID = UIInteraction.GetInteger("Enter the ID of the Employee"); emp.EmployeeName = UIInteraction.GetString("Enter the Name"); emp.EmployeeAddress = UIInteraction.GetString("Enter the Address"); emp.EmployeeDateOfBirth = UIInteraction.GetDate("Enter the date of birth in the format of dd/MM/yyyy"); component.AddNewEmployee(emp); } catch (Exception ex) { Console.WriteLine(ex.Message); } }