Example #1
0
        /// <summary>
        /// Fills in full time employee
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        private FulltimeEmployee FillFullTimeEmployee(SqlDataReader reader)
        {
            FulltimeEmployee ft     = EmployeeFactory.CreateFullTimeEmployee();
            float            salary = 0;
            DateTime         doh;
            DateTime         dot;

            FillBaseEmployee(ft, reader);

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

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

            if (float.TryParse(reader["salary_pay"].ToString(), out salary))
            {
                ft.Salary = salary;
            }
            else
            {
                ft.Salary = null;
            }


            return(ft);
        }