Ejemplo n.º 1
0
        /// <summary>
        /// Fills full time employee
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        private ParttimeEmployee FillPartTimeEmployee(SqlDataReader reader)
        {
            float            hourlyRate = 0;
            DateTime         doh;
            DateTime         dot;
            ParttimeEmployee pt = EmployeeFactory.CreatePartTimeEmployee();

            FillBaseEmployee(pt, reader);

            if (DateTime.TryParse(reader["dateOfHire"].ToString(), out doh))
            {
                pt.DateOfHire = doh;
            }
            else
            {
                pt.DateOfHire = DateTime.MinValue;
            }

            if (DateTime.TryParse(reader["dateOfTermination"].ToString(), out dot))
            {
                pt.DateOfTermination = dot;
            }
            else
            {
                pt.DateOfTermination = DateTime.MinValue;
            }

            if (float.TryParse(reader["hourly_rate"].ToString(), out hourlyRate))
            {
                pt.HourlyRate = hourlyRate;
            }
            else
            {
                pt.HourlyRate = null;
            }


            return(pt);
        }