public List<BookRegisterDTO> SearchRequests(SearchRequestDTO dto)
        {
            SearchRequestDAO dao = new SearchRequestDAO();

            if(dto.Status==0)
            {
                return dao.SearchRequestAllStt(dto);
                //break;
            }
            else
            {
                return dao.SearchRequests(dto);
            }
        }
        public List<BookRegisterDTO> SearchRequests(SearchRequestDTO dto)
        {
            BookRegisterDTO bookReg;
            List<BookRegisterDTO> list = new List<BookRegisterDTO>();
            try
            {
                SqlDataReader reader = ConnectionManager.GetCommand("sp0003",
                                                                    new Dictionary<string, SqlDbType>()
                                                                        {
                                                                            {"@userName", SqlDbType.NVarChar},
                                                                            {"@title", SqlDbType.NVarChar},
                                                                            {"@status", SqlDbType.Int},
                                                                            {"@fromDate", SqlDbType.DateTime},
                                                                            {"@toDate", SqlDbType.DateTime}
                                                                        },
                                                                    new List<object>()
                                                                        {
                                                                            dto.UserName,
                                                                            dto.Title,
                                                                            dto.Status,
                                                                            dto.FromDate,
                                                                            dto.ToDate
                                                                        }).ExecuteReader();

                while (reader.Read())
                {
                    bookReg = new BookRegisterDTO();
                    bookReg.Username = reader["Username"].ToString();
                    bookReg.BookTitle = reader["Title"].ToString();
                    bookReg.RegisterDate = DateTime.Parse(reader["RegisterDate"].ToString());
                    bookReg.Note = reader["Note"].ToString();
                    int status;
                    int.TryParse(reader["Status"].ToString(), out status);
                    bookReg.Status = (BookRegisterStatus)Enum.Parse(typeof(BookRegisterStatus), status.ToString());
                    list.Add(bookReg);
                }

                reader.Close();
            }
            catch (Exception e)
            {
                Log.Error("Error at AuthorDAO - GetAuthorByID", e);
                return null;
            }
            return list;
        }
 private void ResetListRequest()
 {
     //_listRegister = _feature.GetAllRegister();
     //grdRegister.DataSource = _listRegister;
     var rDto = new SearchRequestDTO();
     rDto.Status = (int) BookRegisterStatus.NEW;
     rDto.FromDate = dteRequestFrom.Value.ToShortDateString();
     rDto.ToDate = dteRequestTo.Value.ToShortDateString();
     rDto.PageNumber = 1;
     var rBus = new SearchRequestBUS();
     grdRegister.DataSource = rBus.SearchRequests(rDto);
 }
 private void BtnRegisterSearchClick(object sender, EventArgs e)
 {
     SearchRequestDTO rDto = new SearchRequestDTO();
     rDto.UserName = txtRequestUser.Text;
     rDto.Title = txtRequestTitle.Text;
     rDto.Status = cboRequestStatus.SelectedIndex;
     rDto.FromDate = dteRequestFrom.Text;
     rDto.ToDate = dteRequestTo.Text;
     rDto.PageNumber = 1;
     SearchRequestBUS rBus = new SearchRequestBUS();
     grdRegister.DataSource = rBus.SearchRequests(rDto);
 }