public List<BookRegisterDTO> GetBookRegisterByStatusAndCreatedDate(BookRegisterStatus status, DateTime createdDate)
 {
     return _bookRegisterDao.GetByStatusAndCreatedDate(status, createdDate);
 }
        public List<BookRegisterDTO> GetByStatusAndCreatedDate(BookRegisterStatus status, DateTime createdDate)
        {
            var listRegister = new List<BookRegisterDTO>();

            try
            {
                SqlDataReader reader = ConnectionManager.GetCommand("SP1001ByStatusAndCreatedDate",
                                                                    new Dictionary<string, SqlDbType>()
                                                                    {
                                                                        {"@Status", SqlDbType.Int},
                                                                        {"@CreatedDate", SqlDbType.DateTime}
                                                                    },
                                                                    new List<object>()
                                                                    {
                                                                        (int) status,
                                                                        createdDate
                                                                    }).ExecuteReader();
                BookRegisterDTO register;

                while (reader.Read())
                {
                    register = new BookRegisterDTO();
                    register.UserId = reader["UserID"].ToString();
                    register.ISBN = reader["ISBN"].ToString();
                    register.RegisterDate = (DateTime)reader["RegisterDate"];
                    register.Note = reader["Note"].ToString();
                    int statusTmp;
                    int.TryParse(reader["Status"].ToString(), out statusTmp);
                    register.Status = (BookRegisterStatus)Enum.Parse(typeof(BookRegisterStatus), status.ToString());
                    register.CreatedDate = (DateTime)reader["CreatedDate"];
                    register.UpdatedDate = (DateTime)reader["UpdatedDate"];

                    listRegister.Add(register);
                }
            }
            catch (Exception e)
            {
                Log.Logger.Error("Error at BookRegisterDAO - GetByStatusAndCreatedDate", e);
                return null;
            }

            return listRegister;
        }