예제 #1
0
파일: Connection.cs 프로젝트: wes977/EMS
        /// <summary>
        /// Fill contract employee
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        private ContractEmployee FillContractEmployee(SqlDataReader reader)
        {
            DateTime         csd;
            DateTime         ced;
            float            fca;
            ContractEmployee ct = EmployeeFactory.CreateContractEmployee();

            FillBaseEmployee(ct, reader);

            if (DateTime.TryParse(reader["contractStartDate"].ToString(), out csd))
            {
                ct.ContractStartDate = csd;
            }
            else
            {
                ct.ContractStartDate = DateTime.MinValue;
            }

            if (DateTime.TryParse(reader["contractStopDate"].ToString(), out ced))
            {
                ct.ContractStopDate = ced;
            }
            else
            {
                ct.ContractStopDate = DateTime.MinValue;
            }

            if (float.TryParse(reader["fixedContractAmount"].ToString(), out fca))
            {
                ct.FixedContractAmount = fca;
            }
            else
            {
                ct.FixedContractAmount = null;
            }

            return(ct);
        }