static void InputOfficeStaff(int number) { int count = 0; Console.WriteLine("INPUT {0} OFFICE STAFF", number); while (count < number) { try { Console.Write("Enter ID: "); int id = int.Parse(Console.ReadLine()); Console.Write("Enter name: "); string name = Console.ReadLine(); Console.Write("Enter age: "); int age = int.Parse(Console.ReadLine()); Console.Write("Enter basic salary: "); double basicSalary = double.Parse(Console.ReadLine()); Console.Write("Enter salary rate: "); double rateSalary = double.Parse(Console.ReadLine()); Console.Write("Enter the number of non-working day: "); int numNonWorkingDay = int.Parse(Console.ReadLine()); Console.Write("Enter the decrease amount: "); double moneyDecrease = double.Parse(Console.ReadLine()); OfficeStaff officeStaff = new OfficeStaff(id, name, age, rateSalary, basicSalary, numNonWorkingDay, moneyDecrease); officeStaffList.Add(officeStaff); count++; } catch (FormatException e) { Console.WriteLine("An exception is thrown, likely because of your input"); Console.WriteLine(e.Message); continue; } } }
public static OfficeStaff OfficeStaff(Models.Staff entity) { if (entity == null) { return(null); } var s = new OfficeStaff(); s.Active = entity.StaffActive; s.DateCreated = entity.DateCreated; s.DateCreated = entity.DateCreated; s.Email = entity.StaffPrimaryEmail; s.FirstName = entity.StaffFirstName; s.HireDate = entity.StaffHireDate; s.ID = entity.ID; s.LastName = entity.StaffLastName; s.Phone = entity.StaffPrimaryPhone; s.TerminationDate = entity.StaffTerminatedDate; return(s); }
public bool RegisterOfficeStaff(OfficeStaff officeStaff) { //can apply some logic here later to work on the officeStaffobject before sending it to repo. return(((IRegistrationWriteRepository <OfficeStaff>)registrationRepository).Register(officeStaff)); }