public static List <SickDay> RePackage(SqlDataReader dr) { var sickDayList = new List <SickDay>(); var sickDayId = dr.GetOrdinal("SickDayId"); var sickDayDate = dr.GetOrdinal("Date"); var sickDayIsFullDay = dr.GetOrdinal("IsFullDay"); while (dr.Read()) { var sd = new SickDay(); sd.sickDayID = Convert.ToInt32(dr[sickDayId]); sd.date = Convert.ToDateTime(dr[sickDayDate]); sd.isFullDay = Convert.ToBoolean(dr[sickDayIsFullDay]); sickDayList.Add(sd); } return(sickDayList); }
public static bool RecordSickDay(SickDay sickday, int employeeId) { return(SickDaySQL.RecordSickDay(sickday, employeeId)); }
public static List <SickDay> GetSickDays(int employeeId) { return(SickDay.RePackage(EmployeeSQL.GetSickDays(employeeId))); }