public static List <EmployeeModel> GetAvaliableEmployees(string shiftDate) { List <ShiftModel> shifts = ShiftProcessor.LoadShiftByShiftDate(shiftDate); List <EmployeeModel> employees = new List <EmployeeModel>(); foreach (ShiftModel shift in shifts) { int num = shift.EmployeeID; string sql = @"select * from dbo.Employee where EmployeeId in @data"; employees.Add(SQLDataAccess.LoadByEmployeeID <EmployeeModel>(sql, num)[0]); } return(employees); }
public static List <EmployeeModel> GetEmployeesOnShift(int shiftId) { List <ShiftModel> shifts = ShiftProcessor.LoadShiftByShiftId(shiftId); // getting the list of shifts happening List <EmployeeModel> employees = new List <EmployeeModel>(); // creating list of employees that are working that shift foreach (ShiftModel shift in shifts) // for each shift { int num = shift.EmployeeID; // employee id associated with each shift string sql = @"select * from dbo.Employee where EmployeeId in @data"; // getting employee details employees.Add(SQLDataAccess.LoadByEmployeeID <EmployeeModel>(sql, num)[0]); // adding employee to list of employees } return(employees); }