Пример #1
0
        /// <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);
        }